Skip to content

Commit 548e60e

Browse files
committed
Update toolchain
1 parent 4eb54f6 commit 548e60e

File tree

10 files changed

+61
-89
lines changed

10 files changed

+61
-89
lines changed

build.gradle.kts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
12
import com.github.breadmoirai.githubreleaseplugin.GithubReleaseExtension
2-
import com.gradle.publish.PluginBundleExtension
33
import com.gradle.publish.PublishPlugin
44
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
55

@@ -14,6 +14,7 @@ val projectDescription: String by project
1414
val projectChangelog: String by project
1515
val kotlinVersion: String by project
1616
val androidBuildToolsVersion: String by project
17+
val dokkaVersion: String by project
1718
val ideaExtVersion: String by project
1819

1920
val devBuildNumber: String? by project
@@ -25,6 +26,7 @@ fun NamedDomainObjectContainer<PluginDeclaration>.createMultiGradlePlugin(type:
2526
displayName = "MultiGradle ${type.capitalize()} [${applicableTo.capitalize()}]"
2627
description = projectDescription.replace("%type%", type)
2728
implementationClass = "net.pearx.multigradle.plugin.$type.MultiGradle${type.capitalize()}${applicableTo.capitalize()}"
29+
tags.set(listOf("kotlin", "multiplatform", "modular", "kotlin-multiplatform"))
2830
}
2931
}
3032

@@ -60,10 +62,11 @@ subprojects {
6062
}
6163
}
6264

63-
configure<PluginBundleExtension> {
64-
website = "https://github.com/pearxteam/multigradle"
65-
vcsUrl = "https://github.com/pearxteam/multigradle"
66-
tags = listOf("kotlin", "multiplatform", "modular", "kotlin-multiplatform")
65+
66+
67+
configure<GradlePluginDevelopmentExtension> {
68+
website.set("https://github.com/pearxteam/multigradle")
69+
vcsUrl.set("https://github.com/pearxteam/multigradle")
6770
}
6871

6972
tasks {
@@ -92,7 +95,7 @@ project(":multigradle") {
9295
dependencies {
9396
"implementation"("org.jetbrains.kotlin:kotlin-compiler-embeddable:$kotlinVersion")
9497
"api"("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
95-
"api"("org.jetbrains.dokka:dokka-gradle-plugin:$kotlinVersion")
98+
"api"("org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion")
9699
"api"("com.android.tools.build:gradle:$androidBuildToolsVersion")
97100
"api"("gradle.plugin.org.jetbrains.gradle.plugin.idea-ext:gradle-idea-ext:$ideaExtVersion")
98101
}

gradle.properties

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1-
projectVersion=1.11.0
1+
projectVersion=1.12.0
22
projectChangelog=Update dependencies, disable generation of Javadocs for JVM platofrm
33

44
projectDescription=A Gradle plugin that simplifies the creation of %type% multiplatform Kotlin projects.
55

6-
kotlinVersion=1.4.32
7-
pluginPublishVersion=1.0.0-rc-2
8-
githubReleaseVersion=2.3.7
9-
androidBuildToolsVersion=7.2.1
10-
ideaExtVersion=1.1.4
6+
kotlinVersion=1.8.20
7+
dokkaVersion=1.8.10
8+
pluginPublishVersion=1.1.0
9+
githubReleaseVersion=2.4.1
10+
androidBuildToolsVersion=7.4.2
11+
ideaExtVersion=1.1.5

gradle/wrapper/gradle-wrapper.jar

1.75 KB
Binary file not shown.
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.1-bin.zip
4+
networkTimeout=10000
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists

gradlew

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# Darwin, MinGW, and NonStop.
5656
#
5757
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
58+
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5959
# within the Gradle project.
6060
#
6161
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,10 +80,10 @@ do
8080
esac
8181
done
8282

83-
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84-
85-
APP_NAME="Gradle"
83+
# This is normally unused
84+
# shellcheck disable=SC2034
8685
APP_BASE_NAME=${0##*/}
86+
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
8787

8888
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
8989
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
@@ -143,12 +143,16 @@ fi
143143
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144144
case $MAX_FD in #(
145145
max*)
146+
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
147+
# shellcheck disable=SC3045
146148
MAX_FD=$( ulimit -H -n ) ||
147149
warn "Could not query maximum file descriptor limit"
148150
esac
149151
case $MAX_FD in #(
150152
'' | soft) :;; #(
151153
*)
154+
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
155+
# shellcheck disable=SC3045
152156
ulimit -n "$MAX_FD" ||
153157
warn "Could not set maximum file descriptor limit to $MAX_FD"
154158
esac
@@ -205,6 +209,12 @@ set -- \
205209
org.gradle.wrapper.GradleWrapperMain \
206210
"$@"
207211

212+
# Stop when "xargs" is not available.
213+
if ! command -v xargs >/dev/null 2>&1
214+
then
215+
die "xargs is not available"
216+
fi
217+
208218
# Use "xargs" to parse quoted args.
209219
#
210220
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.

gradlew.bat

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@rem limitations under the License.
1515
@rem
1616

17-
@if "%DEBUG%" == "" @echo off
17+
@if "%DEBUG%"=="" @echo off
1818
@rem ##########################################################################
1919
@rem
2020
@rem Gradle startup script for Windows
@@ -25,7 +25,8 @@
2525
if "%OS%"=="Windows_NT" setlocal
2626

2727
set DIRNAME=%~dp0
28-
if "%DIRNAME%" == "" set DIRNAME=.
28+
if "%DIRNAME%"=="" set DIRNAME=.
29+
@rem This is normally unused
2930
set APP_BASE_NAME=%~n0
3031
set APP_HOME=%DIRNAME%
3132

@@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome
4041

4142
set JAVA_EXE=java.exe
4243
%JAVA_EXE% -version >NUL 2>&1
43-
if "%ERRORLEVEL%" == "0" goto execute
44+
if %ERRORLEVEL% equ 0 goto execute
4445

4546
echo.
4647
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
7576

7677
:end
7778
@rem End local scope for the variables with windows NT shell
78-
if "%ERRORLEVEL%"=="0" goto mainEnd
79+
if %ERRORLEVEL% equ 0 goto mainEnd
7980

8081
:fail
8182
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
8283
rem the _cmd.exe /c_ return code!
83-
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84-
exit /b 1
84+
set EXIT_CODE=%ERRORLEVEL%
85+
if %EXIT_CODE% equ 0 set EXIT_CODE=1
86+
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
87+
exit /b %EXIT_CODE%
8588

8689
:mainEnd
8790
if "%OS%"=="Windows_NT" endlocal

multigradle/src/main/kotlin/net/pearx/multigradle/util/platform/AndroidPlatform.kt

Lines changed: 19 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,37 @@ package net.pearx.multigradle.util.platform
99

1010
import com.android.build.gradle.LibraryExtension
1111
import com.android.build.gradle.LibraryPlugin
12-
import com.android.build.gradle.tasks.GenerateBuildConfig
1312
import net.pearx.multigradle.util.alias
1413
import net.pearx.multigradle.util.kotlinMpp
1514
import org.gradle.api.Project
16-
import org.gradle.api.Task
17-
import org.gradle.api.plugins.ExtensionAware
1815
import org.gradle.kotlin.dsl.*
19-
import org.gradle.plugins.ide.idea.model.IdeaModel
20-
import org.jetbrains.gradle.ext.ProjectSettings
21-
import org.jetbrains.gradle.ext.TaskTriggersConfig
2216

2317
class AndroidPlatformConfig(project: Project) : PlatformConfig(project) {
2418
var compileSdkVersion: String by project.the<LibraryExtension>().alias({ compileSdkVersion!! }, { compileSdkVersion = it })
2519
var buildToolsVersion: String by project.the<LibraryExtension>().alias({ buildToolsVersion }, { buildToolsVersion = it })
2620
lateinit var junitVersion: String
21+
private lateinit var _javaVersion: String
22+
var javaVersion: String
23+
get() = _javaVersion
24+
set(value) {
25+
_javaVersion = value
26+
project.the<LibraryExtension>().compileOptions.targetCompatibility("1.$value")
27+
project.the<LibraryExtension>().compileOptions.sourceCompatibility("1.$value")
28+
project.kotlinMpp.android {
29+
compilations.configureEach { kotlinOptions.jvmTarget = "1.$value" }
30+
}
31+
}
2732
}
2833

34+
val Project.androidPackageName
35+
get() = mutableListOf<String>().also {
36+
it += project.group.toString()
37+
it += project.name.split('-').drop(1)
38+
}.joinToString(".") // todo a bit hacky :(
39+
2940
val AndroidPlatform = platform("android", listOf("testReleaseUnitTest", "testDebugUnitTest"), { AndroidPlatformConfig(it) }) { ext ->
3041
apply<LibraryPlugin>()
3142

32-
val manifestPath = file("$buildDir/AndroidManifest.xml")
33-
3443
repositories {
3544
google()
3645
}
@@ -43,7 +52,7 @@ val AndroidPlatform = platform("android", listOf("testReleaseUnitTest", "testDeb
4352
implementation(kotlin("stdlib"))
4453
}
4554
}
46-
named("androidTest") {
55+
named("androidUnitTest") {
4756
dependencies {
4857
implementation(kotlin("test-annotations-common"))
4958
implementation(kotlin("test-junit"))
@@ -58,47 +67,6 @@ val AndroidPlatform = platform("android", listOf("testReleaseUnitTest", "testDeb
5867
}
5968

6069
configure<LibraryExtension> {
61-
defaultConfig {
62-
63-
}
64-
buildTypes.configureEach {
65-
sourceSets.configureEach {
66-
manifest.srcFile(manifestPath)
67-
}
68-
}
69-
}
70-
71-
72-
tasks {
73-
val generateAndroidManifest by registering(Task::class) {
74-
with(inputs) {
75-
property("group", project.group)
76-
property("name", project.name)
77-
}
78-
outputs.file(manifestPath)
79-
doLast {
80-
val pkg = mutableListOf<String>().also {
81-
it += project.group.toString()
82-
it += project.name.split('-').drop(1)
83-
}.joinToString(".") // todo a bit hacky :(
84-
manifestPath.writeText("""
85-
<?xml version="1.0" encoding="utf-8"?>
86-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
87-
package="$pkg"/>
88-
""".trimIndent())
89-
}
90-
}
91-
92-
configure<IdeaModel> {
93-
(project as ExtensionAware).configure<ProjectSettings> {
94-
(this as ExtensionAware).configure<TaskTriggersConfig> {
95-
beforeSync(generateAndroidManifest)
96-
}
97-
}
98-
}
99-
100-
withType<GenerateBuildConfig> {
101-
dependsOn(generateAndroidManifest)
102-
}
70+
namespace = project.androidPackageName
10371
}
10472
}

multigradle/src/main/kotlin/net/pearx/multigradle/util/platform/JsPlatform.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class JsPlatformConfig(project: Project) : PlatformConfig(project)
1616

1717
val JsPlatform = platform("js", listOf("jsTest"), { JsPlatformConfig(it) }) {
1818
kotlinMpp {
19-
js {
19+
js(IR) {
2020
nodejs {
2121
testTask {
2222
useMocha()

multigradle/src/main/kotlin/net/pearx/multigradle/util/platform/NativePlatforms.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,16 @@ private val nativeSourceSetRelations = mapOf(
2525

2626
val LinuxX64Platform = nativePlatform("linuxX64", "linux", test = true)
2727
val LinuxArm64Platform = nativePlatform("linuxArm64", "linux")
28-
val LinuxArm32HfpPlatform = nativePlatform("linuxArm32Hfp", "linux")
29-
val LinuxMips32Platform = nativePlatform("linuxMips32", "linux")
30-
val LinuxMipsel32Platform = nativePlatform("linuxMipsel32", "linux")
3128
val AndroidNativeArm32Platform = nativePlatform("androidNativeArm32", "androidNative")
3229
val AndroidNativeArm64Platform = nativePlatform("androidNativeArm64", "androidNative")
3330
val TvOsArm32Platform = nativePlatform("tvosArm64", "tvos")
3431
val TvOsX64Platform = nativePlatform("tvosX64", "tvos", test = true)
35-
val IOsArm32Platform = nativePlatform("iosArm32", "ios")
3632
val IOsArm64Platform = nativePlatform("iosArm64", "ios")
3733
val IOsX64Platform = nativePlatform("iosX64", "ios", test = true)
3834
val WatchOsArm32Platform = nativePlatform("watchosArm32", "watchos")
3935
val WatchOsArm64Platform = nativePlatform("watchosArm64", "watchos")
40-
val WatchOsX86Platform = nativePlatform("watchosX86", "watchos", test = true)
4136
val MacOsX64Platform = nativePlatform("macosX64", "macos", test = true)
4237
val MingwX64Platform = nativePlatform("mingwX64", "mingw", test = true)
43-
val MingwX86Platform = nativePlatform("mingwX86", "mingw")
44-
val Wasm32Platform = nativePlatform("wasm32", "wasm")
4538

4639
private fun KotlinMultiplatformExtension.createConfiguration(name: String): KotlinSourceSet {
4740
return if (ideaActive) { // hack. idea doesn't go well with common native source sets as good as gradle does.

multigradle/src/main/kotlin/net/pearx/multigradle/util/platform/Platforms.kt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -52,21 +52,14 @@ val PLATFORMS = setOf(
5252
AndroidPlatform,
5353
LinuxX64Platform,
5454
LinuxArm64Platform,
55-
LinuxArm32HfpPlatform,
56-
LinuxMips32Platform,
57-
LinuxMipsel32Platform,
5855
AndroidNativeArm32Platform,
5956
AndroidNativeArm64Platform,
6057
TvOsArm32Platform,
6158
TvOsX64Platform,
62-
IOsArm32Platform,
6359
IOsArm64Platform,
6460
IOsX64Platform,
6561
WatchOsArm32Platform,
6662
WatchOsArm64Platform,
67-
WatchOsX86Platform,
6863
MacOsX64Platform,
69-
MingwX86Platform,
7064
MingwX64Platform,
71-
Wasm32Platform
7265
).associateBy { p -> p.name }

0 commit comments

Comments
 (0)