Skip to content

Commit

Permalink
Merge pull request #9 from Liftric/feat/upgrade_dependencies
Browse files Browse the repository at this point in the history
feat(build): upgrade gradle, plugins, and dependencies
  • Loading branch information
Ingwersaft authored Dec 14, 2021
2 parents 8bab6b1 + 4274073 commit 5149c38
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 37 deletions.
41 changes: 20 additions & 21 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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
Expand Down Expand Up @@ -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)
}
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -24,4 +24,4 @@ services:
links:
- db
depends_on:
- db
- db
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ private fun <T> 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)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ class UploadPackageTaskIntegrationTest {

val packageItem = getPackageResponse()
.items
?.filter {
?.firstOrNull {
it.version == "$major.$minor.$micro"
}
?.firstOrNull()
assertNotNull(packageItem)
assertEquals(".jar", packageItem?.fileExtension)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ class UploadPackageTaskWithWaitIntegrationTest {

val packageItem = getPackageResponse()
.items
?.filter {
?.firstOrNull {
it.version == "$major.$minor.$micro"
}
?.firstOrNull()
assertNotNull(packageItem)
assertEquals(".jar", packageItem?.fileExtension)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 5149c38

Please sign in to comment.