From 4c24dd704d35644a215584ee98446b8820545620 Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Sat, 7 Nov 2015 19:49:00 -0800 Subject: [PATCH] Warnings. --- .../beust/kobalt/internal/remote/GetDependenciesCommand.kt | 2 +- src/main/kotlin/com/beust/kobalt/plugin/java/JavaProject.kt | 2 +- .../kotlin/com/beust/kobalt/plugin/kotlin/KotlinPlugin.kt | 2 +- .../com/beust/kobalt/plugin/packaging/PackagingPlugin.kt | 2 +- src/main/kotlin/com/beust/kobalt/plugin/publish/JCenterApi.kt | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/kotlin/com/beust/kobalt/internal/remote/GetDependenciesCommand.kt b/src/main/kotlin/com/beust/kobalt/internal/remote/GetDependenciesCommand.kt index 8cbe2f4c..009ecab8 100644 --- a/src/main/kotlin/com/beust/kobalt/internal/remote/GetDependenciesCommand.kt +++ b/src/main/kotlin/com/beust/kobalt/internal/remote/GetDependenciesCommand.kt @@ -57,7 +57,7 @@ class GetDependenciesCommand @Inject constructor(val executors: KobaltExecutors, allDeps(project.testDependencies).map { toDependencyData(it, "testCompile") } + allDeps(project.testProvidedDependencies).map { toDependencyData(it, "testProvided") } - projects.add(ProjectData(project.name!!, allDependencies)) + projects.add(ProjectData(project.name, allDependencies)) } log(1, "Returning BuildScriptInfo") val result = toCommandData(Gson().toJson(GetDependenciesData(projects))) diff --git a/src/main/kotlin/com/beust/kobalt/plugin/java/JavaProject.kt b/src/main/kotlin/com/beust/kobalt/plugin/java/JavaProject.kt index 76f36ca4..60b9b96b 100644 --- a/src/main/kotlin/com/beust/kobalt/plugin/java/JavaProject.kt +++ b/src/main/kotlin/com/beust/kobalt/plugin/java/JavaProject.kt @@ -27,6 +27,6 @@ public class JavaProject( : Project(name, version, directory, buildDirectory, group, artifactId, packaging, dependencies, ".java", projectInfo = JavaProjectInfo()) { - override public fun toString() = toString("JavaProject", "name", name!!) + override public fun toString() = toString("JavaProject", "name", name) } diff --git a/src/main/kotlin/com/beust/kobalt/plugin/kotlin/KotlinPlugin.kt b/src/main/kotlin/com/beust/kobalt/plugin/kotlin/KotlinPlugin.kt index 45cfffa0..a09a9930 100644 --- a/src/main/kotlin/com/beust/kobalt/plugin/kotlin/KotlinPlugin.kt +++ b/src/main/kotlin/com/beust/kobalt/plugin/kotlin/KotlinPlugin.kt @@ -36,7 +36,7 @@ class KotlinPlugin @Inject constructor( @Task(name = TASK_COMPILE, description = "Compile the project") fun taskCompile(project: Project): TaskResult { copyResources(project, JvmCompilerPlugin.SOURCE_SET_MAIN) - val classpath = jvmCompiler.calculateDependencies(project, context!!, project.compileDependencies, + val classpath = jvmCompiler.calculateDependencies(project, context, project.compileDependencies, project.compileProvidedDependencies) val projectDirectory = java.io.File(project.directory) diff --git a/src/main/kotlin/com/beust/kobalt/plugin/packaging/PackagingPlugin.kt b/src/main/kotlin/com/beust/kobalt/plugin/packaging/PackagingPlugin.kt index 97f86468..35c0ad4b 100644 --- a/src/main/kotlin/com/beust/kobalt/plugin/packaging/PackagingPlugin.kt +++ b/src/main/kotlin/com/beust/kobalt/plugin/packaging/PackagingPlugin.kt @@ -224,7 +224,7 @@ class PackagingPlugin @Inject constructor(val dependencyManager : DependencyMana includedFiles: List, expandJarFiles : Boolean = false, outputStreamFactory: (OutputStream) -> ZipOutputStream = DEFAULT_STREAM_FACTORY) : File { - val fullArchiveName = archiveName ?: arrayListOf(project.name!!, project.version!!).joinToString("-") + suffix + val fullArchiveName = archiveName ?: arrayListOf(project.name, project.version!!).joinToString("-") + suffix val archiveDir = libsDir(project) val result = File(archiveDir.path, fullArchiveName) val outStream = outputStreamFactory(FileOutputStream(result)) diff --git a/src/main/kotlin/com/beust/kobalt/plugin/publish/JCenterApi.kt b/src/main/kotlin/com/beust/kobalt/plugin/publish/JCenterApi.kt index 02234875..72e00b5a 100644 --- a/src/main/kotlin/com/beust/kobalt/plugin/publish/JCenterApi.kt +++ b/src/main/kotlin/com/beust/kobalt/plugin/publish/JCenterApi.kt @@ -69,7 +69,7 @@ public class JCenterApi @Inject constructor (@Nullable @Assisted("username") val // } fun uploadMaven(project: Project, files: List, config: JCenterConfig?) : TaskResult { - if (! packageExists(project.name!!)) { + if (! packageExists(project.name)) { throw KobaltException("Couldn't find a package called ${project.name} on bintray, please create one first" + " as explained at https://bintray.com/docs/usermanual/uploads/uploads_creatinganewpackage.html") } @@ -79,7 +79,7 @@ public class JCenterApi @Inject constructor (@Nullable @Assisted("username") val UnauthenticatedJCenterApi.BINTRAY_URL_API_CONTENT, username!!, "maven", - project.name!!, + project.name, project.version!!, project.group!!.replace(".", "/"), project.artifactId!!,