From 3914e92f6d24b6f90952181f220d95eb356c779f Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Fri, 18 Dec 2015 02:26:49 +0400 Subject: [PATCH] Break Kobalt in two projects. --- .gitignore | 2 + kobalt/src/Build.kt | 116 +++++++++++------- kobalt/wrapper/kobalt-wrapper.properties | 2 +- .../kobalt-plugin-api/kobalt-plugin-api.iml | 13 ++ .../src}/main/kotlin/com/beust/kobalt/Args.kt | 0 .../main/kotlin/com/beust/kobalt/AsciiArt.kt | 0 .../kotlin/com/beust/kobalt/BasePluginTask.kt | 0 .../kotlin/com/beust/kobalt/BuildScript.kt | 0 .../main/kotlin/com/beust/kobalt/Constants.kt | 0 .../main/kotlin/com/beust/kobalt/FileSpec.kt | 0 .../main/kotlin/com/beust/kobalt/JavaInfo.kt | 0 .../src}/main/kotlin/com/beust/kobalt/Jvm.kt | 0 .../com/beust/kobalt/KobaltException.kt | 0 .../com/beust/kobalt/OperatingSystem.kt | 0 .../main/kotlin/com/beust/kobalt/Plugins.kt | 0 .../com/beust/kobalt/ResolveDependency.kt | 6 +- .../com/beust/kobalt/SystemProperties.kt | 0 .../kotlin/com/beust/kobalt/TaskResult.kt | 0 .../main/kotlin/com/beust/kobalt/Template.kt | 0 .../kotlin/com/beust/kobalt/TestDirective.kt | 0 .../main/kotlin/com/beust/kobalt/Variant.kt | 0 .../kotlin/com/beust/kobalt/api/BasePlugin.kt | 0 .../beust/kobalt/api/CompilerActionInfo.kt | 0 .../com/beust/kobalt/api/ConfigPlugin.kt | 0 .../com/beust/kobalt/api/ConfigsPlugin.kt | 0 .../kotlin/com/beust/kobalt/api/IAffinity.kt | 0 .../api/IBuildConfigFieldContributor.kt | 0 .../kobalt/api/IBuildDirectoryInterceptor.kt | 0 .../beust/kobalt/api/IClasspathContributor.kt | 0 .../beust/kobalt/api/IClasspathDependency.kt | 0 .../beust/kobalt/api/IClasspathInterceptor.kt | 0 .../beust/kobalt/api/ICompilerContributor.kt | 0 .../kobalt/api/ICompilerFlagContributor.kt | 0 .../beust/kobalt/api/ICompilerInterceptor.kt | 0 .../com/beust/kobalt/api/IDocContributor.kt | 0 .../kotlin/com/beust/kobalt/api/IFactory.kt | 0 .../com/beust/kobalt/api/IInitContributor.kt | 0 .../beust/kobalt/api/IMavenIdInterceptor.kt | 0 .../kotlin/com/beust/kobalt/api/IPlugin.kt | 0 .../com/beust/kobalt/api/IPluginActor.kt | 0 .../com/beust/kobalt/api/IProjectAffinity.kt | 0 .../beust/kobalt/api/IProjectContributor.kt | 0 .../com/beust/kobalt/api/IRepoContributor.kt | 0 .../beust/kobalt/api/IRunnerContributor.kt | 0 .../com/beust/kobalt/api/ISimpleAffinity.kt | 0 .../api/ISourceDirectoriesInterceptor.kt | 0 .../kobalt/api/ISourceDirectoryContributor.kt | 0 .../com/beust/kobalt/api/ITaskContributor.kt | 0 .../kobalt/api/ITestRunnerContributor.kt | 0 .../api/ITestSourceDirectoryContributor.kt | 0 .../kotlin/com/beust/kobalt/api/JarFinder.kt | 0 .../kotlin/com/beust/kobalt/api/Kobalt.kt | 0 .../com/beust/kobalt/api/KobaltContext.kt | 0 .../com/beust/kobalt/api/PluginProperties.kt | 0 .../kotlin/com/beust/kobalt/api/PluginTask.kt | 0 .../kotlin/com/beust/kobalt/api/Project.kt | 0 .../com/beust/kobalt/api/ProjectProperties.kt | 0 .../main/kotlin/com/beust/kobalt/api/Task.kt | 0 .../com/beust/kobalt/api/TaskContributor.kt | 0 .../kobalt/api/annotation/Annotations.kt | 0 .../com/beust/kobalt/internal/ActorUtils.kt | 0 .../com/beust/kobalt/internal/DocUrl.kt | 0 .../com/beust/kobalt/internal/DynamicGraph.kt | 0 .../beust/kobalt/internal/GenericRunner.kt | 0 .../com/beust/kobalt/internal/JUnitRunner.kt | 0 .../com/beust/kobalt/internal/JvmCompiler.kt | 0 .../kobalt/internal/JvmCompilerPlugin.kt | 0 .../beust/kobalt/internal/KobaltPluginXml.kt | 0 .../com/beust/kobalt/internal/PluginLoader.kt | 0 .../com/beust/kobalt/internal/ProjectInfo.kt | 0 .../com/beust/kobalt/internal/SpekRunner.kt | 0 .../com/beust/kobalt/internal/TaskManager.kt | 0 .../com/beust/kobalt/internal/TestNgRunner.kt | 0 .../internal/remote/GetDependenciesCommand.kt | 0 .../kobalt/internal/remote/KobaltServer.kt | 0 .../kobalt/internal/remote/PingCommand.kt | 0 .../kobalt/kotlin/ParentLastClassLoader.kt | 0 .../com/beust/kobalt/maven/ArtifactFetcher.kt | 0 .../com/beust/kobalt/maven/CompletedFuture.kt | 0 .../com/beust/kobalt/maven/DepFactory.kt | 24 ++-- .../beust/kobalt/maven/DependencyManager.kt | 0 .../main/kotlin/com/beust/kobalt/maven/Gpg.kt | 0 .../kotlin/com/beust/kobalt/maven/Http.kt | 0 .../kotlin/com/beust/kobalt/maven/Kurl.kt | 0 .../kotlin/com/beust/kobalt/maven/LocalDep.kt | 0 .../com/beust/kobalt/maven/LocalRepo.kt | 0 .../kotlin/com/beust/kobalt/maven/MavenId.kt | 0 .../main/kotlin/com/beust/kobalt/maven/Md5.kt | 0 .../main/kotlin/com/beust/kobalt/maven/Pom.kt | 0 .../com/beust/kobalt/maven/PomGenerator.kt | 0 .../com/beust/kobalt/maven/RepoFinder.kt | 0 .../com/beust/kobalt/maven/SimpleDep.kt | 0 .../com/beust/kobalt/maven/UnversionedDep.kt | 0 .../kobalt/maven/dependency/FileDependency.kt | 0 .../maven/dependency/MavenDependency.kt | 0 .../com/beust/kobalt/misc/Benchmarks.kt | 0 .../com/beust/kobalt/misc/CheckVersions.kt | 0 .../kobalt/misc/CountingFileRequestBody.kt | 0 .../kotlin/com/beust/kobalt/misc/GithubApi.kt | 0 .../kotlin/com/beust/kobalt/misc/JarUtils.kt | 0 .../kotlin/com/beust/kobalt/misc/KFiles.kt | 6 +- .../com/beust/kobalt/misc/KobaltExecutors.kt | 0 .../com/beust/kobalt/misc/KobaltLogger.kt | 0 .../kobalt/misc/KobaltWrapperProperties.kt | 0 .../com/beust/kobalt/misc/LocalProperties.kt | 0 .../com/beust/kobalt/misc/MainModule.kt | 0 .../main/kotlin/com/beust/kobalt/misc/Node.kt | 0 .../com/beust/kobalt/misc/RunCommand.kt | 0 .../kotlin/com/beust/kobalt/misc/Strings.kt | 0 .../kotlin/com/beust/kobalt/misc/ToString.kt | 0 .../com/beust/kobalt/misc/Topological.kt | 0 .../kotlin/com/beust/kobalt/misc/Versions.kt | 0 .../beust/kobalt/internal/build/BuildFile.kt | 17 --- .../kobalt/internal/build/VersionFile.kt | 20 --- 114 files changed, 111 insertions(+), 95 deletions(-) create mode 100644 modules/kobalt-plugin-api/kobalt-plugin-api.iml rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/Args.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/AsciiArt.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/BasePluginTask.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/BuildScript.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/Constants.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/FileSpec.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/JavaInfo.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/Jvm.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/KobaltException.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/OperatingSystem.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/Plugins.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/ResolveDependency.kt (91%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/SystemProperties.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/TaskResult.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/Template.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/TestDirective.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/Variant.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/BasePlugin.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/CompilerActionInfo.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/ConfigPlugin.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/ConfigsPlugin.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/IAffinity.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/IBuildConfigFieldContributor.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/IBuildDirectoryInterceptor.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/IClasspathContributor.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/IClasspathDependency.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/IClasspathInterceptor.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/ICompilerContributor.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/ICompilerFlagContributor.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/ICompilerInterceptor.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/IDocContributor.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/IFactory.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/IInitContributor.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/IMavenIdInterceptor.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/IPlugin.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/IPluginActor.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/IProjectAffinity.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/IProjectContributor.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/IRepoContributor.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/IRunnerContributor.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/ISimpleAffinity.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/ISourceDirectoriesInterceptor.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/ISourceDirectoryContributor.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/ITaskContributor.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/ITestRunnerContributor.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/ITestSourceDirectoryContributor.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/JarFinder.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/Kobalt.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/KobaltContext.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/PluginProperties.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/PluginTask.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/Project.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/ProjectProperties.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/Task.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/TaskContributor.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/api/annotation/Annotations.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/internal/ActorUtils.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/internal/DocUrl.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/internal/DynamicGraph.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/internal/GenericRunner.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/internal/JUnitRunner.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/internal/JvmCompiler.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/internal/KobaltPluginXml.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/internal/PluginLoader.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/internal/ProjectInfo.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/internal/SpekRunner.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/internal/TaskManager.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/internal/TestNgRunner.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/internal/remote/GetDependenciesCommand.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/internal/remote/KobaltServer.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/internal/remote/PingCommand.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/kotlin/ParentLastClassLoader.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/maven/ArtifactFetcher.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/maven/CompletedFuture.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/maven/DepFactory.kt (67%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/maven/DependencyManager.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/maven/Gpg.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/maven/Http.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/maven/Kurl.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/maven/LocalDep.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/maven/LocalRepo.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/maven/MavenId.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/maven/Md5.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/maven/Pom.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/maven/PomGenerator.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/maven/RepoFinder.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/maven/SimpleDep.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/maven/UnversionedDep.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/maven/dependency/FileDependency.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/maven/dependency/MavenDependency.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/misc/Benchmarks.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/misc/CheckVersions.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/misc/CountingFileRequestBody.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/misc/GithubApi.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/misc/JarUtils.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/misc/KFiles.kt (97%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/misc/KobaltExecutors.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/misc/KobaltLogger.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/misc/KobaltWrapperProperties.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/misc/LocalProperties.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/misc/MainModule.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/misc/Node.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/misc/RunCommand.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/misc/Strings.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/misc/ToString.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/misc/Topological.kt (100%) rename {src => modules/kobalt-plugin-api/src}/main/kotlin/com/beust/kobalt/misc/Versions.kt (100%) delete mode 100644 src/main/kotlin/com/beust/kobalt/internal/build/BuildFile.kt delete mode 100644 src/main/kotlin/com/beust/kobalt/internal/build/VersionFile.kt diff --git a/.gitignore b/.gitignore index 6a15e2a07..d6c778df6 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ classes libs .kobalt/ build/ +out +.DS_Store diff --git a/kobalt/src/Build.kt b/kobalt/src/Build.kt index eca4cd558..bc7f53f2c 100644 --- a/kobalt/src/Build.kt +++ b/kobalt/src/Build.kt @@ -1,14 +1,19 @@ -import com.beust.kobalt.* -import com.beust.kobalt.api.* +import com.beust.kobalt.TaskResult +import com.beust.kobalt.api.License +import com.beust.kobalt.api.Project +import com.beust.kobalt.api.Scm import com.beust.kobalt.api.annotation.Task +import com.beust.kobalt.homeDir import com.beust.kobalt.plugin.application.application -import com.beust.kobalt.plugin.java.* -import com.beust.kobalt.plugin.kotlin.* +import com.beust.kobalt.plugin.java.javaCompiler +import com.beust.kobalt.plugin.java.javaProject +import com.beust.kobalt.plugin.kotlin.kotlinCompiler +import com.beust.kobalt.plugin.kotlin.kotlinProject import com.beust.kobalt.plugin.packaging.assemble import com.beust.kobalt.plugin.publish.github import com.beust.kobalt.plugin.publish.jcenter -import com.beust.kobalt.plugin.retrolambda.* +import com.beust.kobalt.repos import com.beust.kobalt.test import java.io.File import java.nio.file.Files @@ -35,25 +40,18 @@ val wrapper = javaProject { } } -// retrolambda { -// } - - productFlavor("dev") { - } - - buildType("debug") { - } - application { mainClass = "com.beust.kobalt.wrapper.Main" } } -val kobalt = kotlinProject(wrapper) { - name = "kobalt" + +val kobaltPluginApi = kotlinProject { + name = "kobalt-plugin-api" group = "com.beust" artifactId = name version = readVersion() + directory = "modules/kobalt-plugin-api" description = "A build system in Kotlin" url = "http://beust.com/kobalt" licenses = arrayListOf(License("Apache 2.0", "http://www.apache.org/licenses/LICENSE-2.0")) @@ -66,27 +64,20 @@ val kobalt = kotlinProject(wrapper) { } dependencies { - compile("org.jetbrains.kotlin:kotlin-stdlib:1.0.0-beta-3595", - "org.jetbrains.kotlin:kotlin-compiler-embeddable:1.0.0-beta-3595", - "org.jetbrains.dokka:dokka-fatjar:0.9.3", - "org.jetbrains.kotlinx:kotlinx.dom:0.0.4", + compile("org.jetbrains.kotlinx:kotlinx.dom:0.0.4", - "com.android.tools.build:builder:2.0.0-alpha3", - - "com.beust:jcommander:1.48", "com.squareup.okhttp:okhttp:2.5.0", - "org.jsoup:jsoup:1.8.3", + "com.squareup.okio:okio:1.6.0", "com.google.inject:guice:4.0", "com.google.inject.extensions:guice-assistedinject:4.0", "javax.inject:javax.inject:1", "com.google.guava:guava:19.0-rc2", "org.apache.maven:maven-model:3.3.3", - "com.github.spullara.mustache.java:compiler:0.9.1", "io.reactivex:rxjava:1.0.16", "com.google.code.gson:gson:2.4", "com.squareup.retrofit:retrofit:1.9.0", - "com.squareup.okio:okio:1.6.0" - ) + "com.beust:jcommander:1.48" + ) } @@ -97,13 +88,6 @@ val kobalt = kotlinProject(wrapper) { attributes("Main-Class", "com.beust.kobalt.MainKt") } } - zip { - include("kobaltw") - include(from("$buildDirectory/libs"), to("kobalt/wrapper"), - "$projectName-$version.jar") - include(from("modules/wrapper/$buildDirectory/libs"), to("kobalt/wrapper"), - "$projectName-wrapper.jar") - } } // install { @@ -118,21 +102,67 @@ val kobalt = kotlinProject(wrapper) { args("-nowarn") } -// dokka { -// outputFormat = "markdown" -// } -// -// dokka { -// outputFormat = "html" -// } + jcenter { + publish = true + } +} - github { - file("$buildDirectory/libs/$name-$version.zip", "$name/$version/$name-$version.zip") +val kobaltApp = kotlinProject(kobaltPluginApi, wrapper) { + name = "kobalt" + group = "com.beust" + artifactId = name + version = readVersion() + + dependencies { + // Used by the plugins + compile("com.android.tools.build:builder:2.0.0-alpha3", + "org.jetbrains.kotlin:kotlin-compiler-embeddable:1.0.0-beta-3595", + "org.jetbrains.dokka:dokka-fatjar:0.9.3") + + // Used by the main app + compile("com.github.spullara.mustache.java:compiler:0.9.1", + "com.squareup.okhttp:okhttp:2.5.0", + "javax.inject:javax.inject:1", + "com.google.inject:guice:4.0", + "com.google.inject.extensions:guice-assistedinject:4.0", + "com.beust:jcommander:1.48", + "com.squareup.retrofit:retrofit:1.9.0", + "org.apache.maven:maven-model:3.3.3", + "org.codehaus.plexus:plexus-utils:3.0.22") + + } + + dependenciesTest { + compile("org.testng:testng:6.9.9") + } + + assemble { + mavenJars { + fatJar = true + manifest { + attributes("Main-Class", "com.beust.kobalt.MainKt") + } + } + zip { + include("kobaltw") + include(from("$buildDirectory/libs"), to("kobalt/wrapper"), + "$projectName-$version.jar") + include(from("modules/wrapper/$buildDirectory/libs"), to("kobalt/wrapper"), + "$projectName-wrapper.jar") + } + } + + kotlinCompiler { + args("-nowarn") } jcenter { publish = true } + + github { + file("$buildDirectory/libs/$name-$version.zip", "$name/$version/$name-$version.zip") + } } fun readVersion() : String { diff --git a/kobalt/wrapper/kobalt-wrapper.properties b/kobalt/wrapper/kobalt-wrapper.properties index 4fdda8d67..bc4e2e90c 100644 --- a/kobalt/wrapper/kobalt-wrapper.properties +++ b/kobalt/wrapper/kobalt-wrapper.properties @@ -1 +1 @@ -kobalt.version=0.343 \ No newline at end of file +kobalt.version=0.338 \ No newline at end of file diff --git a/modules/kobalt-plugin-api/kobalt-plugin-api.iml b/modules/kobalt-plugin-api/kobalt-plugin-api.iml new file mode 100644 index 000000000..5562e3596 --- /dev/null +++ b/modules/kobalt-plugin-api/kobalt-plugin-api.iml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/kotlin/com/beust/kobalt/Args.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/Args.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/Args.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/Args.kt diff --git a/src/main/kotlin/com/beust/kobalt/AsciiArt.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/AsciiArt.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/AsciiArt.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/AsciiArt.kt diff --git a/src/main/kotlin/com/beust/kobalt/BasePluginTask.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/BasePluginTask.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/BasePluginTask.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/BasePluginTask.kt diff --git a/src/main/kotlin/com/beust/kobalt/BuildScript.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/BuildScript.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/BuildScript.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/BuildScript.kt diff --git a/src/main/kotlin/com/beust/kobalt/Constants.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/Constants.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/Constants.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/Constants.kt diff --git a/src/main/kotlin/com/beust/kobalt/FileSpec.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/FileSpec.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/FileSpec.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/FileSpec.kt diff --git a/src/main/kotlin/com/beust/kobalt/JavaInfo.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/JavaInfo.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/JavaInfo.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/JavaInfo.kt diff --git a/src/main/kotlin/com/beust/kobalt/Jvm.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/Jvm.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/Jvm.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/Jvm.kt diff --git a/src/main/kotlin/com/beust/kobalt/KobaltException.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/KobaltException.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/KobaltException.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/KobaltException.kt diff --git a/src/main/kotlin/com/beust/kobalt/OperatingSystem.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/OperatingSystem.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/OperatingSystem.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/OperatingSystem.kt diff --git a/src/main/kotlin/com/beust/kobalt/Plugins.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/Plugins.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/Plugins.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/Plugins.kt diff --git a/src/main/kotlin/com/beust/kobalt/ResolveDependency.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/ResolveDependency.kt similarity index 91% rename from src/main/kotlin/com/beust/kobalt/ResolveDependency.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/ResolveDependency.kt index 588252b9a..a5ef7abb8 100644 --- a/src/main/kotlin/com/beust/kobalt/ResolveDependency.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/ResolveDependency.kt @@ -1,6 +1,7 @@ package com.beust.kobalt import com.beust.kobalt.api.IClasspathDependency +import com.beust.kobalt.maven.LocalRepo import com.beust.kobalt.maven.MavenId import com.beust.kobalt.maven.RepoFinder import com.beust.kobalt.maven.SimpleDep @@ -13,7 +14,7 @@ import java.util.* /** * Display information about a Maven id. */ -class ResolveDependency @Inject constructor(val repoFinder: RepoFinder) { +class ResolveDependency @Inject constructor(val repoFinder: RepoFinder, val localRepo: LocalRepo) { val increment = 8 val leftFirst = "\u2558" val leftMiddle = "\u255f" @@ -35,7 +36,8 @@ class ResolveDependency @Inject constructor(val repoFinder: RepoFinder) { val simpleDep = SimpleDep(MavenId.create(id)) val url = repoResult.hostConfig.url + simpleDep.toJarFile(repoResult) - AsciiArt.logBox(listOf(id, url).map { " $it" }, {s -> println(s) }) + val localFile = localRepo.toFullPath(simpleDep.toJarFile(repoResult)) + AsciiArt.logBox(listOf(id, url, localFile).map { " $it" }, {s -> println(s) }) display(root.children) println("") diff --git a/src/main/kotlin/com/beust/kobalt/SystemProperties.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/SystemProperties.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/SystemProperties.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/SystemProperties.kt diff --git a/src/main/kotlin/com/beust/kobalt/TaskResult.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/TaskResult.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/TaskResult.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/TaskResult.kt diff --git a/src/main/kotlin/com/beust/kobalt/Template.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/Template.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/Template.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/Template.kt diff --git a/src/main/kotlin/com/beust/kobalt/TestDirective.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/TestDirective.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/TestDirective.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/TestDirective.kt diff --git a/src/main/kotlin/com/beust/kobalt/Variant.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/Variant.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/Variant.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/Variant.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/BasePlugin.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/BasePlugin.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/BasePlugin.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/BasePlugin.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/CompilerActionInfo.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/CompilerActionInfo.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/CompilerActionInfo.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/CompilerActionInfo.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/ConfigPlugin.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ConfigPlugin.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/ConfigPlugin.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ConfigPlugin.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/ConfigsPlugin.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ConfigsPlugin.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/ConfigsPlugin.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ConfigsPlugin.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/IAffinity.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IAffinity.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/IAffinity.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IAffinity.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/IBuildConfigFieldContributor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IBuildConfigFieldContributor.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/IBuildConfigFieldContributor.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IBuildConfigFieldContributor.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/IBuildDirectoryInterceptor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IBuildDirectoryInterceptor.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/IBuildDirectoryInterceptor.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IBuildDirectoryInterceptor.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/IClasspathContributor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IClasspathContributor.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/IClasspathContributor.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IClasspathContributor.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/IClasspathDependency.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IClasspathDependency.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/IClasspathDependency.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IClasspathDependency.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/IClasspathInterceptor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IClasspathInterceptor.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/IClasspathInterceptor.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IClasspathInterceptor.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/ICompilerContributor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ICompilerContributor.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/ICompilerContributor.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ICompilerContributor.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/ICompilerFlagContributor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ICompilerFlagContributor.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/ICompilerFlagContributor.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ICompilerFlagContributor.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/ICompilerInterceptor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ICompilerInterceptor.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/ICompilerInterceptor.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ICompilerInterceptor.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/IDocContributor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IDocContributor.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/IDocContributor.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IDocContributor.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/IFactory.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IFactory.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/IFactory.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IFactory.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/IInitContributor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IInitContributor.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/IInitContributor.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IInitContributor.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/IMavenIdInterceptor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IMavenIdInterceptor.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/IMavenIdInterceptor.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IMavenIdInterceptor.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/IPlugin.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IPlugin.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/IPlugin.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IPlugin.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/IPluginActor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IPluginActor.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/IPluginActor.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IPluginActor.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/IProjectAffinity.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IProjectAffinity.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/IProjectAffinity.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IProjectAffinity.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/IProjectContributor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IProjectContributor.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/IProjectContributor.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IProjectContributor.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/IRepoContributor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IRepoContributor.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/IRepoContributor.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IRepoContributor.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/IRunnerContributor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IRunnerContributor.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/IRunnerContributor.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/IRunnerContributor.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/ISimpleAffinity.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ISimpleAffinity.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/ISimpleAffinity.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ISimpleAffinity.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/ISourceDirectoriesInterceptor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ISourceDirectoriesInterceptor.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/ISourceDirectoriesInterceptor.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ISourceDirectoriesInterceptor.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/ISourceDirectoryContributor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ISourceDirectoryContributor.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/ISourceDirectoryContributor.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ISourceDirectoryContributor.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/ITaskContributor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ITaskContributor.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/ITaskContributor.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ITaskContributor.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/ITestRunnerContributor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ITestRunnerContributor.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/ITestRunnerContributor.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ITestRunnerContributor.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/ITestSourceDirectoryContributor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ITestSourceDirectoryContributor.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/ITestSourceDirectoryContributor.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ITestSourceDirectoryContributor.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/JarFinder.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/JarFinder.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/JarFinder.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/JarFinder.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/Kobalt.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/Kobalt.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/Kobalt.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/Kobalt.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/KobaltContext.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/KobaltContext.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/KobaltContext.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/KobaltContext.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/PluginProperties.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/PluginProperties.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/PluginProperties.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/PluginProperties.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/PluginTask.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/PluginTask.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/PluginTask.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/PluginTask.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/Project.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/Project.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/Project.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/Project.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/ProjectProperties.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ProjectProperties.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/ProjectProperties.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/ProjectProperties.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/Task.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/Task.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/Task.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/Task.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/TaskContributor.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/TaskContributor.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/TaskContributor.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/TaskContributor.kt diff --git a/src/main/kotlin/com/beust/kobalt/api/annotation/Annotations.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/annotation/Annotations.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/api/annotation/Annotations.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/api/annotation/Annotations.kt diff --git a/src/main/kotlin/com/beust/kobalt/internal/ActorUtils.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/ActorUtils.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/internal/ActorUtils.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/ActorUtils.kt diff --git a/src/main/kotlin/com/beust/kobalt/internal/DocUrl.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/DocUrl.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/internal/DocUrl.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/DocUrl.kt diff --git a/src/main/kotlin/com/beust/kobalt/internal/DynamicGraph.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/DynamicGraph.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/internal/DynamicGraph.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/DynamicGraph.kt diff --git a/src/main/kotlin/com/beust/kobalt/internal/GenericRunner.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/GenericRunner.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/internal/GenericRunner.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/GenericRunner.kt diff --git a/src/main/kotlin/com/beust/kobalt/internal/JUnitRunner.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/JUnitRunner.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/internal/JUnitRunner.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/JUnitRunner.kt diff --git a/src/main/kotlin/com/beust/kobalt/internal/JvmCompiler.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/JvmCompiler.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/internal/JvmCompiler.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/JvmCompiler.kt diff --git a/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/JvmCompilerPlugin.kt diff --git a/src/main/kotlin/com/beust/kobalt/internal/KobaltPluginXml.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/KobaltPluginXml.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/internal/KobaltPluginXml.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/KobaltPluginXml.kt diff --git a/src/main/kotlin/com/beust/kobalt/internal/PluginLoader.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/PluginLoader.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/internal/PluginLoader.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/PluginLoader.kt diff --git a/src/main/kotlin/com/beust/kobalt/internal/ProjectInfo.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/ProjectInfo.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/internal/ProjectInfo.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/ProjectInfo.kt diff --git a/src/main/kotlin/com/beust/kobalt/internal/SpekRunner.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/SpekRunner.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/internal/SpekRunner.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/SpekRunner.kt diff --git a/src/main/kotlin/com/beust/kobalt/internal/TaskManager.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/TaskManager.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/internal/TaskManager.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/TaskManager.kt diff --git a/src/main/kotlin/com/beust/kobalt/internal/TestNgRunner.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/TestNgRunner.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/internal/TestNgRunner.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/TestNgRunner.kt diff --git a/src/main/kotlin/com/beust/kobalt/internal/remote/GetDependenciesCommand.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/remote/GetDependenciesCommand.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/internal/remote/GetDependenciesCommand.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/remote/GetDependenciesCommand.kt diff --git a/src/main/kotlin/com/beust/kobalt/internal/remote/KobaltServer.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/remote/KobaltServer.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/internal/remote/KobaltServer.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/remote/KobaltServer.kt diff --git a/src/main/kotlin/com/beust/kobalt/internal/remote/PingCommand.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/remote/PingCommand.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/internal/remote/PingCommand.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/internal/remote/PingCommand.kt diff --git a/src/main/kotlin/com/beust/kobalt/kotlin/ParentLastClassLoader.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/kotlin/ParentLastClassLoader.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/kotlin/ParentLastClassLoader.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/kotlin/ParentLastClassLoader.kt diff --git a/src/main/kotlin/com/beust/kobalt/maven/ArtifactFetcher.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/ArtifactFetcher.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/maven/ArtifactFetcher.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/ArtifactFetcher.kt diff --git a/src/main/kotlin/com/beust/kobalt/maven/CompletedFuture.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/CompletedFuture.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/maven/CompletedFuture.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/CompletedFuture.kt diff --git a/src/main/kotlin/com/beust/kobalt/maven/DepFactory.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/DepFactory.kt similarity index 67% rename from src/main/kotlin/com/beust/kobalt/maven/DepFactory.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/DepFactory.kt index 7896b652b..10f2e4a7a 100644 --- a/src/main/kotlin/com/beust/kobalt/maven/DepFactory.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/DepFactory.kt @@ -32,22 +32,26 @@ public class DepFactory @Inject constructor(val localRepo: LocalRepo, return FileDependency(id.substring(FileDependency.PREFIX_FILE.length)) } else { val mavenId = MavenId.create(id) - var version = mavenId.version + var tentativeVersion = mavenId.version var packaging = mavenId.packaging var repoResult: RepoFinder.RepoResult? - if (version == null || MavenId.isRangedVersion(version)) { - var localVersion: String? = version - if (localFirst) localVersion = localRepo.findLocalVersion(mavenId.groupId, mavenId.artifactId, mavenId.packaging) - if (!localFirst || localVersion == null) { - repoResult = remoteRepo.findCorrectRepo(id) - if (!repoResult.found) { - throw KobaltException("Couldn't resolve $id") + val version = + if (tentativeVersion != null && ! MavenId.isRangedVersion(tentativeVersion)) tentativeVersion + else { + var localVersion: String? = tentativeVersion + if (localFirst) localVersion = localRepo.findLocalVersion(mavenId.groupId, mavenId.artifactId, mavenId.packaging) + if (localFirst && localVersion != null) { + localVersion } else { - version = repoResult.version?.version + repoResult = remoteRepo.findCorrectRepo(id) + if (!repoResult.found) { + throw KobaltException("Couldn't resolve $id") + } else { + repoResult.version?.version + } } } - } return MavenDependency(MavenId.create(mavenId.groupId, mavenId.artifactId, packaging, version), executor, localRepo, remoteRepo, pomFactory, downloadManager) diff --git a/src/main/kotlin/com/beust/kobalt/maven/DependencyManager.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/DependencyManager.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/maven/DependencyManager.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/DependencyManager.kt diff --git a/src/main/kotlin/com/beust/kobalt/maven/Gpg.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/Gpg.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/maven/Gpg.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/Gpg.kt diff --git a/src/main/kotlin/com/beust/kobalt/maven/Http.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/Http.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/maven/Http.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/Http.kt diff --git a/src/main/kotlin/com/beust/kobalt/maven/Kurl.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/Kurl.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/maven/Kurl.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/Kurl.kt diff --git a/src/main/kotlin/com/beust/kobalt/maven/LocalDep.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/LocalDep.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/maven/LocalDep.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/LocalDep.kt diff --git a/src/main/kotlin/com/beust/kobalt/maven/LocalRepo.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/LocalRepo.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/maven/LocalRepo.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/LocalRepo.kt diff --git a/src/main/kotlin/com/beust/kobalt/maven/MavenId.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/MavenId.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/maven/MavenId.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/MavenId.kt diff --git a/src/main/kotlin/com/beust/kobalt/maven/Md5.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/Md5.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/maven/Md5.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/Md5.kt diff --git a/src/main/kotlin/com/beust/kobalt/maven/Pom.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/Pom.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/maven/Pom.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/Pom.kt diff --git a/src/main/kotlin/com/beust/kobalt/maven/PomGenerator.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/PomGenerator.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/maven/PomGenerator.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/PomGenerator.kt diff --git a/src/main/kotlin/com/beust/kobalt/maven/RepoFinder.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/RepoFinder.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/maven/RepoFinder.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/RepoFinder.kt diff --git a/src/main/kotlin/com/beust/kobalt/maven/SimpleDep.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/SimpleDep.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/maven/SimpleDep.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/SimpleDep.kt diff --git a/src/main/kotlin/com/beust/kobalt/maven/UnversionedDep.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/UnversionedDep.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/maven/UnversionedDep.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/UnversionedDep.kt diff --git a/src/main/kotlin/com/beust/kobalt/maven/dependency/FileDependency.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/dependency/FileDependency.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/maven/dependency/FileDependency.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/dependency/FileDependency.kt diff --git a/src/main/kotlin/com/beust/kobalt/maven/dependency/MavenDependency.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/dependency/MavenDependency.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/maven/dependency/MavenDependency.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/maven/dependency/MavenDependency.kt diff --git a/src/main/kotlin/com/beust/kobalt/misc/Benchmarks.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/Benchmarks.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/misc/Benchmarks.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/Benchmarks.kt diff --git a/src/main/kotlin/com/beust/kobalt/misc/CheckVersions.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/CheckVersions.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/misc/CheckVersions.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/CheckVersions.kt diff --git a/src/main/kotlin/com/beust/kobalt/misc/CountingFileRequestBody.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/CountingFileRequestBody.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/misc/CountingFileRequestBody.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/CountingFileRequestBody.kt diff --git a/src/main/kotlin/com/beust/kobalt/misc/GithubApi.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/GithubApi.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/misc/GithubApi.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/GithubApi.kt diff --git a/src/main/kotlin/com/beust/kobalt/misc/JarUtils.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/JarUtils.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/misc/JarUtils.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/JarUtils.kt diff --git a/src/main/kotlin/com/beust/kobalt/misc/KFiles.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/KFiles.kt similarity index 97% rename from src/main/kotlin/com/beust/kobalt/misc/KFiles.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/KFiles.kt index 419487bdd..c27949c77 100644 --- a/src/main/kotlin/com/beust/kobalt/misc/KFiles.kt +++ b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/KFiles.kt @@ -34,8 +34,10 @@ class KFiles { // Will only happen when building kobalt itself: the jar file might not be in the dist/ directory // yet since we're currently building it. Instead, use the classes directly debug("Couldn't find ${jarFile.absolutePath}, using build/classes/main") - return listOf(File(homeDir("kotlin", "kobalt", "build", "classes", "main")).absolutePath, - File(homeDir("kotlin", "kobalt", "classes", "production", "kobalt-plugin-api")).absolutePath) + val result = listOf("kobalt", "kobalt-plugin-api", "kobalt-wrapper").map { + File(homeDir(KFiles.joinDir("kotlin", "kobalt", "out", "production", it))).absolutePath + } + return result } } } diff --git a/src/main/kotlin/com/beust/kobalt/misc/KobaltExecutors.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/KobaltExecutors.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/misc/KobaltExecutors.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/KobaltExecutors.kt diff --git a/src/main/kotlin/com/beust/kobalt/misc/KobaltLogger.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/KobaltLogger.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/misc/KobaltLogger.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/KobaltLogger.kt diff --git a/src/main/kotlin/com/beust/kobalt/misc/KobaltWrapperProperties.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/KobaltWrapperProperties.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/misc/KobaltWrapperProperties.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/KobaltWrapperProperties.kt diff --git a/src/main/kotlin/com/beust/kobalt/misc/LocalProperties.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/LocalProperties.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/misc/LocalProperties.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/LocalProperties.kt diff --git a/src/main/kotlin/com/beust/kobalt/misc/MainModule.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/MainModule.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/misc/MainModule.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/MainModule.kt diff --git a/src/main/kotlin/com/beust/kobalt/misc/Node.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/Node.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/misc/Node.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/Node.kt diff --git a/src/main/kotlin/com/beust/kobalt/misc/RunCommand.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/RunCommand.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/misc/RunCommand.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/RunCommand.kt diff --git a/src/main/kotlin/com/beust/kobalt/misc/Strings.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/Strings.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/misc/Strings.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/Strings.kt diff --git a/src/main/kotlin/com/beust/kobalt/misc/ToString.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/ToString.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/misc/ToString.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/ToString.kt diff --git a/src/main/kotlin/com/beust/kobalt/misc/Topological.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/Topological.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/misc/Topological.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/Topological.kt diff --git a/src/main/kotlin/com/beust/kobalt/misc/Versions.kt b/modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/Versions.kt similarity index 100% rename from src/main/kotlin/com/beust/kobalt/misc/Versions.kt rename to modules/kobalt-plugin-api/src/main/kotlin/com/beust/kobalt/misc/Versions.kt diff --git a/src/main/kotlin/com/beust/kobalt/internal/build/BuildFile.kt b/src/main/kotlin/com/beust/kobalt/internal/build/BuildFile.kt deleted file mode 100644 index 17954ed09..000000000 --- a/src/main/kotlin/com/beust/kobalt/internal/build/BuildFile.kt +++ /dev/null @@ -1,17 +0,0 @@ -package com.beust.kobalt.internal.build - -import java.io.File -import java.nio.file.Files -import java.nio.file.Path -import java.nio.file.attribute.BasicFileAttributes -/** - * Sometimes, build files are moved to temporary files, so we give them a specific name for clarity. - */ -class BuildFile(val path: Path, val name: String) { - public fun exists() : Boolean = Files.exists(path) - - public val lastModified : Long - get() = Files.readAttributes(path, BasicFileAttributes::class.java).lastModifiedTime().toMillis() - - public val directory : File get() = path.toFile().directory -} diff --git a/src/main/kotlin/com/beust/kobalt/internal/build/VersionFile.kt b/src/main/kotlin/com/beust/kobalt/internal/build/VersionFile.kt deleted file mode 100644 index 4343ed3f4..000000000 --- a/src/main/kotlin/com/beust/kobalt/internal/build/VersionFile.kt +++ /dev/null @@ -1,20 +0,0 @@ -package com.beust.kobalt.internal.build - -import com.beust.kobalt.api.Kobalt -import com.beust.kobalt.misc.KFiles -import java.io.File - -class VersionFile { - companion object { - private val VERSION_FILE = "version.txt" - - fun generateVersionFile(directory: File) { - KFiles.saveFile(File(directory, VERSION_FILE), Kobalt.version) - } - - fun isSameVersionFile(directory: File) = - with(File(directory, VERSION_FILE)) { - ! exists() || (exists() && readText() == Kobalt.version) - } - } -} \ No newline at end of file