From 2f97edc5929b12e236aafca3fed4565560d4fd50 Mon Sep 17 00:00:00 2001 From: Ryan Brink <5607577+unredundant@users.noreply.github.com> Date: Tue, 11 Jan 2022 19:42:21 -0500 Subject: [PATCH] fix: compiler args (#32) --- .github/workflows/publish.yml | 2 +- CHANGELOG.md | 4 ++++ .../gradle/application/jvm/ApplicationJvmPlugin.kt | 12 +++++++----- gradle.properties | 2 +- .../sourdough/gradle/library/jvm/LibraryJvmPlugin.kt | 12 +++++++----- 5 files changed, 20 insertions(+), 12 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 518d922..ff0dd59 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,7 +11,7 @@ jobs: with: distribution: 'adopt' java-version: '8' - - name: Unit Tests + - name: Publish to GitHub Packages uses: burrunan/gradle-cache-action@v1 with: gradle-version: wrapper diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e2e443..9d3fec2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.5.4] - January 11th, 2022 +### Changed +- Fixed bug where compiler args were not being applied + ## [0.5.3] - January 11th, 2022 ### Changed - Fixed bug causing version in library to be null diff --git a/application-jvm/src/main/kotlin/io/bkbn/sourdough/gradle/application/jvm/ApplicationJvmPlugin.kt b/application-jvm/src/main/kotlin/io/bkbn/sourdough/gradle/application/jvm/ApplicationJvmPlugin.kt index fa1b9e2..af288c8 100644 --- a/application-jvm/src/main/kotlin/io/bkbn/sourdough/gradle/application/jvm/ApplicationJvmPlugin.kt +++ b/application-jvm/src/main/kotlin/io/bkbn/sourdough/gradle/application/jvm/ApplicationJvmPlugin.kt @@ -39,11 +39,13 @@ class ApplicationJvmPlugin : Plugin { } private fun Project.configureKotlin(ext: ApplicationJvmExtension) { - tasks.withType(KotlinCompile::class.java) { - it.sourceCompatibility = ext.jvmTarget.get() - it.kotlinOptions { - jvmTarget = ext.jvmTarget.get() - freeCompilerArgs = freeCompilerArgs + ext.compilerArgs.get() + afterEvaluate { + tasks.withType(KotlinCompile::class.java) { + it.sourceCompatibility = ext.jvmTarget.get() + it.kotlinOptions { + jvmTarget = ext.jvmTarget.get() + freeCompilerArgs = freeCompilerArgs + ext.compilerArgs.get() + } } } } diff --git a/gradle.properties b/gradle.properties index 83fe0f4..f9588f9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Project -project.version=0.5.3 +project.version=0.5.4 # Kotlin kotlin.code.style=official diff --git a/library-jvm/src/main/kotlin/io/bkbn/sourdough/gradle/library/jvm/LibraryJvmPlugin.kt b/library-jvm/src/main/kotlin/io/bkbn/sourdough/gradle/library/jvm/LibraryJvmPlugin.kt index a3b0509..4999d94 100644 --- a/library-jvm/src/main/kotlin/io/bkbn/sourdough/gradle/library/jvm/LibraryJvmPlugin.kt +++ b/library-jvm/src/main/kotlin/io/bkbn/sourdough/gradle/library/jvm/LibraryJvmPlugin.kt @@ -53,11 +53,13 @@ class LibraryJvmPlugin : Plugin { } private fun Project.configureKotlin(ext: LibraryJvmExtension) { - tasks.withType(KotlinCompile::class.java) { - it.sourceCompatibility = ext.jvmTarget.get() - it.kotlinOptions { - jvmTarget = ext.jvmTarget.get() - freeCompilerArgs = freeCompilerArgs + ext.compilerArgs.get() + afterEvaluate { + tasks.withType(KotlinCompile::class.java) { + it.sourceCompatibility = ext.jvmTarget.get() + it.kotlinOptions { + jvmTarget = ext.jvmTarget.get() + freeCompilerArgs = freeCompilerArgs + ext.compilerArgs.get() + } } } }