Skip to content

Commit

Permalink
Merge pull request #82 from marcodallaba/chore/gradle_plugin_8.0.1_ko…
Browse files Browse the repository at this point in the history
…tlin_1.8.21
  • Loading branch information
yshrsmz authored May 24, 2023
2 parents 830540f + 39b65bf commit 37224d6
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
restore-keys: |
${{ runner.os }}-gradle-
- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'

- name: Execute test cases
run: ./gradlew test
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ jobs:
- name: Checkout the repo
uses: actions/checkout@v2

- name: Set up JDK 11
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'

- name: Publish the artifacts to Maven Central
env:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ buildkonfig {
<summary>Kotlin DSL</summary>

```kotlin
import com.codingfeline.buildkonfig.compiler.FieldSpec.Type.
import com.codingfeline.buildkonfig.compiler.FieldSpec.Type.String
import com.codingfeline.buildkonfig.gradle.TargetConfigDsl

buildkonfig {
Expand Down
2 changes: 1 addition & 1 deletion buildkonfig-compiler/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ tasks.create("pluginVersion") {
afterEvaluate {
tasks.named("compileKotlin").configure { dependsOn("pluginVersion") }
tasks.named("dokkaHtml").configure { dependsOn("pluginVersion") }
tasks.named("javaSourcesJar").configure { dependsOn("pluginVersion") }
tasks.named("kotlinSourcesJar").configure { dependsOn("pluginVersion") }
}

tasks.compileKotlin {
Expand Down
10 changes: 3 additions & 7 deletions buildkonfig-gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,19 @@ val POM_DESCRIPTION: String by project
val POM_NAME: String by project

gradlePlugin {
website.set(POM_URL)
vcsUrl.set("https://github.com/yshrsmz/BuildKonfig.git")
plugins {
create("buildKonfig") {
id = "com.codingfeline.buildkonfig"
implementationClass = "com.codingfeline.buildkonfig.gradle.BuildKonfigPlugin"
displayName = POM_NAME
description = POM_DESCRIPTION
tags.set(listOf("BuildConfig", "Kotlin", "Kotlin Multiplatform"))
}
}
}

pluginBundle {
website = POM_URL
vcsUrl = "https://github.com/yshrsmz/BuildKonfig.git"
description = POM_DESCRIPTION
tags = listOf("BuildConfig", "Kotlin", "Kotlin Multiplatform")
}

val fixtureClasspath by configurations.creating

// Append any extra dependencies to the test fixtures via a custom configuration classpath. This
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ internal fun KotlinMultiplatformExtension.sources(): List<Source> {
val all = compilation.allKotlinSourceSets
.filter {
it.name != "${target.name}Main" &&
it.name != compilation.defaultSourceSetName
it.name != compilation.defaultSourceSet.name
}

default to all
}
else -> {
compilation.defaultSourceSet to compilation.allKotlinSourceSets
.filter { it.name != compilation.defaultSourceSetName }
.filter { it.name != compilation.defaultSourceSet.name }
}
}
Source(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,8 @@ class BuildKonfigPluginHMPPTest {
.also {
it.writeText(
"""
kotlin.mpp.stability.nowarn=true
kotlin.mpp.enableGranularSourceSetsMetadata=true
kotlin.native.enableDependencyPropagation=false
kotlin.mpp.androidSourceSetLayoutVersion=2
kotlin.js.compiler=ir
""".trimMargin()
)
}
Expand Down Expand Up @@ -84,6 +83,8 @@ class BuildKonfigPluginHMPPTest {
| manifest.srcFile 'src/androidMain/AndroidManifest.xml'
| }
| }
|
| namespace = "com.sample"
|}
|buildkonfig {
| packageName = "com.sample"
Expand All @@ -110,7 +111,7 @@ class BuildKonfigPluginHMPPTest {
|kotlin {
| android('customAndroid')
| jvm()
| js {
| js(IR) {
| browser()
| nodejs()
| }
Expand Down Expand Up @@ -240,6 +241,8 @@ class BuildKonfigPluginHMPPTest {
| manifest.srcFile 'src/androidMain/AndroidManifest.xml'
| }
| }
|
| namespace = "com.sample"
|}
|buildkonfig {
| packageName = "com.sample"
Expand Down Expand Up @@ -442,6 +445,8 @@ class BuildKonfigPluginHMPPTest {
| manifest.srcFile 'src/androidMain/AndroidManifest.xml'
| }
| }
|
| namespace = "com.sample"
|}
|buildkonfig {
| packageName = "com.sample"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,16 @@ class BuildKonfigPluginTest {
buildFile = projectDir.newFile("build.gradle")
settingFile = projectDir.newFile("settings.gradle")
settingFile.writeText(settingsGradle)

projectDir.newFile("gradle.properties")
.also {
it.writeText(
"""
kotlin.mpp.androidSourceSetLayoutVersion=2
kotlin.js.compiler=ir
""".trimMargin()
)
}
}

@Test
Expand Down Expand Up @@ -198,6 +208,8 @@ class BuildKonfigPluginTest {
| manifest.srcFile 'src/androidMain/AndroidManifest.xml'
| }
| }
|
| namespace = "com.sample"
|}
|buildkonfig {
| packageName = "com.sample"
Expand All @@ -224,7 +236,7 @@ class BuildKonfigPluginTest {
|kotlin {
| android('customAndroid')
| jvm()
| js {
| js(IR) {
| browser()
| nodejs()
| }
Expand Down Expand Up @@ -342,6 +354,8 @@ class BuildKonfigPluginTest {
| manifest.srcFile 'src/androidMain/AndroidManifest.xml'
| }
| }
|
| namespace = "com.sample"
|}
|buildkonfig {
| packageName = "com.sample"
Expand Down Expand Up @@ -443,6 +457,8 @@ class BuildKonfigPluginTest {
| manifest.srcFile 'src/androidMain/AndroidManifest.xml'
| }
| }
|
| namespace = "com.sample"
|}
|buildkonfig {
| packageName = "com.sample"
Expand Down Expand Up @@ -543,6 +559,8 @@ class BuildKonfigPluginTest {
| manifest.srcFile 'src/androidMain/AndroidManifest.xml'
| }
| }
|
| namespace = "com.sample"
|}
|buildkonfig {
| packageName = "com.sample"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ class BuildkonfigPluginKotlinDSLTest {
| minSdkVersion(21)
| targetSdkVersion(30)
| }
|
| namespace = "com.sample"
|}
""".trimMargin()
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.junit.rules.TemporaryFolder

val androidManifest = """
|<?xml version="1.0" encoding="utf-8"?>
|<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.sample"/>
|<manifest xmlns:android="http://schemas.android.com/apk/res/android" />
""".trimMargin()

fun createAndroidManifest(projectDir: TemporaryFolder, sourceSetName: String = "androidMain") {
Expand Down
14 changes: 7 additions & 7 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
[versions]
gradle = "7.4.2"
kotlin = "1.6.21"
dokka = "1.6.21"
gradle = "8.0.1"
kotlin = "1.8.21"
dokka = "1.8.10"

jvmTarget = "1.8"

[libraries]
kotlinpoet = { module = "com.squareup:kotlinpoet", version = "1.12.0" }
kotlinpoet = { module = "com.squareup:kotlinpoet", version = "1.13.2" }
junit = { module = "junit:junit", version = "4.13.2" }
truth = { module = "com.google.truth:truth", version = "1.1.3" }

kotlin-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
android-plugin = { module = "com.android.tools.build:gradle", version = "7.2.2" }
android-plugin = { module = "com.android.tools.build:gradle", version.ref = "gradle" }

[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
dokka = { id = "org.jetbrains.dokka", version.ref = "dokka" }
versions = { id = "com.github.ben-manes.versions", version = "0.42.0" }
pluginPublish = { id = "com.gradle.plugin-publish", version = "0.21.0" }
mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.21.0" }
pluginPublish = { id = "com.gradle.plugin-publish", version = "1.2.0" }
mavenPublish = { id = "com.vanniktech.maven.publish", version = "0.25.2" }
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-7.4.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion sample/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id("org.jetbrains.kotlin.multiplatform") version "1.6.21"
id("org.jetbrains.kotlin.multiplatform") version "1.8.21"
id("com.codingfeline.buildkonfig") version "+"
}

Expand Down

0 comments on commit 37224d6

Please sign in to comment.