diff --git a/build.gradle.kts b/build.gradle.kts index 5af625b..48587b4 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,13 +1,13 @@ import net.nemerosa.versioning.tasks.VersionDisplayTask import org.gradle.api.tasks.testing.logging.TestLogEvent -import org.jetbrains.kotlin.gradle.plugin.KotlinPluginWrapper +import org.jetbrains.kotlin.gradle.plugin.getKotlinPluginVersion plugins { `kotlin-dsl` `maven-publish` - id("com.gradle.plugin-publish") version "0.11.0" - id("net.nemerosa.versioning") version "2.12.0" - id("com.avast.gradle.docker-compose") version "0.10.7" + id("com.gradle.plugin-publish") version "0.18.0" + id("net.nemerosa.versioning") version "2.15.1" + id("com.avast.gradle.docker-compose") version "0.14.11" } group = "com.liftric.octopusdeploy" @@ -34,27 +34,26 @@ val integrationTestImplementation by configurations.getting { configurations["integrationTestRuntimeOnly"].extendsFrom(configurations.testRuntimeOnly.get()) repositories { mavenCentral() - jcenter() } -val kotlinVersion = plugins.getPlugin(KotlinPluginWrapper::class.java).kotlinPluginVersion +val kotlinVersion = project.getKotlinPluginVersion() dependencies { implementation(gradleApi()) implementation(kotlin("gradle-plugin")) implementation(kotlin("stdlib-jdk8")) - implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.6") + implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2") - implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.10.3") - implementation("com.squareup.retrofit2:retrofit:2.6.2") - implementation("com.squareup.retrofit2:converter-jackson:2.6.2") - implementation("com.squareup.retrofit2:converter-scalars:2.6.2") - implementation("com.squareup.okhttp3:logging-interceptor:4.7.2") + implementation("com.fasterxml.jackson.module:jackson-module-kotlin:2.13.0") + implementation("com.squareup.retrofit2:retrofit:2.9.0") + implementation("com.squareup.retrofit2:converter-jackson:2.9.0") + implementation("com.squareup.retrofit2:converter-scalars:2.9.0") + implementation("com.squareup.okhttp3:logging-interceptor:4.9.3") testImplementation(gradleTestKit()) - testImplementation("junit:junit:4.12") + testImplementation("junit:junit:4.13.2") testImplementation("com.github.stefanbirkner:system-rules:1.19.0") - integrationTestImplementation("junit:junit:4.12") - integrationTestImplementation("org.apache.httpcomponents:httpclient:4.5.12") + integrationTestImplementation("junit:junit:4.13.2") + integrationTestImplementation("org.apache.httpcomponents:httpclient:4.5.13") } java { sourceCompatibility = JavaVersion.VERSION_1_8 @@ -148,10 +147,10 @@ pluginBundle { tags = listOf("octopus", "deploy", "releases", "build-information", "upload", "packages") } dockerCompose { - useComposeFiles = listOf("docker-compose.yml") - waitForTcpPorts = true - captureContainersOutput = true - stopContainers = true - removeContainers = true - buildBeforeUp = true + useComposeFiles.set(listOf("docker-compose.yml")) + waitForTcpPorts.set(true) + captureContainersOutput.set(true) + stopContainers.set(true) + removeContainers.set(true) + buildBeforeUp.set(true) } diff --git a/docker-compose.yml b/docker-compose.yml index 9135cb7..62d00e5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3' services: db: - image: microsoft/mssql-server-linux + image: mcr.microsoft.com/mssql/server:2019-CU14-ubuntu-20.04 environment: SA_PASSWORD: yourStrong(!)Password ACCEPT_EULA: Y @@ -24,4 +24,4 @@ services: links: - db depends_on: - - db \ No newline at end of file + - db diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index f3d88b1..490fda8 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 6623300..3cd8500 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.1-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew.bat b/gradlew.bat index 9618d8d..62bd9b9 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" diff --git a/src/integrationTest/kotlin/com/liftric/octopusdeploy/api/octopus.kt b/src/integrationTest/kotlin/com/liftric/octopusdeploy/api/octopus.kt index 83f9e70..66505cd 100644 --- a/src/integrationTest/kotlin/com/liftric/octopusdeploy/api/octopus.kt +++ b/src/integrationTest/kotlin/com/liftric/octopusdeploy/api/octopus.kt @@ -23,7 +23,7 @@ private fun ObjectMapper.convert(k: kotlin.reflect.KClass<*>, fromJson: (Jso }) val mapper = jacksonObjectMapper().apply { - propertyNamingStrategy = PropertyNamingStrategy.LOWER_CAMEL_CASE + propertyNamingStrategy = PropertyNamingStrategies.LOWER_CAMEL_CASE setSerializationInclusion(JsonInclude.Include.NON_NULL) } diff --git a/src/integrationTest/kotlin/com/liftric/octopusdeploy/task/UploadBuildInformationTaskIntegrationTest.kt b/src/integrationTest/kotlin/com/liftric/octopusdeploy/task/UploadBuildInformationTaskIntegrationTest.kt index 1b50e7b..a732ed6 100644 --- a/src/integrationTest/kotlin/com/liftric/octopusdeploy/task/UploadBuildInformationTaskIntegrationTest.kt +++ b/src/integrationTest/kotlin/com/liftric/octopusdeploy/task/UploadBuildInformationTaskIntegrationTest.kt @@ -3,10 +3,8 @@ package com.liftric.octopusdeploy.task import com.liftric.octopusdeploy.apiKey import com.liftric.octopusdeploy.getBuildInformationResponse import com.liftric.octopusdeploy.serverUrl -import junit.framework.TestCase import junit.framework.TestCase.assertEquals import junit.framework.TestCase.assertNotNull -import org.gradle.internal.impldep.com.amazonaws.util.ValidationUtils import org.gradle.testkit.runner.GradleRunner import org.gradle.testkit.runner.TaskOutcome import org.junit.Rule @@ -35,10 +33,9 @@ class UploadBuildInformationTaskIntegrationTest { assertEquals(TaskOutcome.SUCCESS, result.task(":uploadBuildInformation")?.outcome) val buildInfoItem = getBuildInformationResponse() .items - ?.filter { + ?.firstOrNull { it.version == "$major.$minor.$micro" } - ?.firstOrNull() assertNotNull(buildInfoItem) assertEquals("Git", buildInfoItem?.vcsType) diff --git a/src/integrationTest/kotlin/com/liftric/octopusdeploy/task/UploadPackageTaskIntegrationTest.kt b/src/integrationTest/kotlin/com/liftric/octopusdeploy/task/UploadPackageTaskIntegrationTest.kt index 6941f2f..78d98a5 100644 --- a/src/integrationTest/kotlin/com/liftric/octopusdeploy/task/UploadPackageTaskIntegrationTest.kt +++ b/src/integrationTest/kotlin/com/liftric/octopusdeploy/task/UploadPackageTaskIntegrationTest.kt @@ -35,10 +35,9 @@ class UploadPackageTaskIntegrationTest { val packageItem = getPackageResponse() .items - ?.filter { + ?.firstOrNull { it.version == "$major.$minor.$micro" } - ?.firstOrNull() assertNotNull(packageItem) assertEquals(".jar", packageItem?.fileExtension) diff --git a/src/integrationTest/kotlin/com/liftric/octopusdeploy/task/UploadPackageTaskWithWaitIntegrationTest.kt b/src/integrationTest/kotlin/com/liftric/octopusdeploy/task/UploadPackageTaskWithWaitIntegrationTest.kt index 8f0e52f..fbbe1a4 100644 --- a/src/integrationTest/kotlin/com/liftric/octopusdeploy/task/UploadPackageTaskWithWaitIntegrationTest.kt +++ b/src/integrationTest/kotlin/com/liftric/octopusdeploy/task/UploadPackageTaskWithWaitIntegrationTest.kt @@ -35,10 +35,9 @@ class UploadPackageTaskWithWaitIntegrationTest { val packageItem = getPackageResponse() .items - ?.filter { + ?.firstOrNull { it.version == "$major.$minor.$micro" } - ?.firstOrNull() assertNotNull(packageItem) assertEquals(".jar", packageItem?.fileExtension) diff --git a/src/main/kotlin/com/liftric/octopusdeploy/rest/OctoApiClient.kt b/src/main/kotlin/com/liftric/octopusdeploy/rest/OctoApiClient.kt index 22077c9..f0b2206 100644 --- a/src/main/kotlin/com/liftric/octopusdeploy/rest/OctoApiClient.kt +++ b/src/main/kotlin/com/liftric/octopusdeploy/rest/OctoApiClient.kt @@ -2,7 +2,7 @@ package com.liftric.octopusdeploy.rest import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.databind.DeserializationFeature -import com.fasterxml.jackson.databind.PropertyNamingStrategy +import com.fasterxml.jackson.databind.PropertyNamingStrategies import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper import okhttp3.OkHttpClient import okhttp3.logging.HttpLoggingInterceptor @@ -11,7 +11,7 @@ import retrofit2.converter.jackson.JacksonConverterFactory import retrofit2.converter.scalars.ScalarsConverterFactory val mapper = jacksonObjectMapper().apply { - propertyNamingStrategy = PropertyNamingStrategy.LOWER_CAMEL_CASE + propertyNamingStrategy = PropertyNamingStrategies.LOWER_CAMEL_CASE setSerializationInclusion(JsonInclude.Include.NON_NULL) configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) } diff --git a/src/main/kotlin/com/liftric/octopusdeploy/task/CreateBuildInformationTask.kt b/src/main/kotlin/com/liftric/octopusdeploy/task/CreateBuildInformationTask.kt index 1fa2c65..c29458a 100644 --- a/src/main/kotlin/com/liftric/octopusdeploy/task/CreateBuildInformationTask.kt +++ b/src/main/kotlin/com/liftric/octopusdeploy/task/CreateBuildInformationTask.kt @@ -1,7 +1,7 @@ package com.liftric.octopusdeploy.task import com.fasterxml.jackson.annotation.JsonInclude -import com.fasterxml.jackson.databind.PropertyNamingStrategy +import com.fasterxml.jackson.databind.PropertyNamingStrategies import com.fasterxml.jackson.module.kotlin.jacksonObjectMapper import com.liftric.octopusdeploy.api.BuildInformationCli import com.liftric.octopusdeploy.api.CommitCli @@ -60,7 +60,7 @@ open class CreateBuildInformationTask : DefaultTask() { outputFile = File(outputDir, "build-information.json").apply { writeText( jacksonObjectMapper().apply { - propertyNamingStrategy = PropertyNamingStrategy.UPPER_CAMEL_CASE + propertyNamingStrategy = PropertyNamingStrategies.UPPER_CAMEL_CASE setSerializationInclusion(JsonInclude.Include.NON_NULL) }.writeValueAsString(BuildInformationCli().apply { PackageId = packageName.get()