95 Commits

Author SHA1 Message Date
renovate[bot]
d86c7016a9 Merge ed5d52738b into 375e3c1d6e 2024-09-06 17:23:59 +00:00
renovate[bot]
ed5d52738b Update dependency gradle to v8.10 2024-09-06 17:23:56 +00:00
375e3c1d6e Merge pull request #7 from InsanusMokrassar/renovate/test.ext.junit.version
Update dependency androidx.test.ext:junit to v1.2.1
2024-09-06 16:51:06 +06:00
renovate[bot]
d7b5ea6d83 Update dependency androidx.test.ext:junit to v1.2.1 2024-09-06 10:50:38 +00:00
4d8992e86f Merge pull request #6 from InsanusMokrassar/renovate/espresso.core
Update dependency androidx.test.espresso:espresso-core to v3.6.1
2024-09-06 16:50:14 +06:00
renovate[bot]
1b113fe006 Update dependency androidx.test.espresso:espresso-core to v3.6.1 2024-09-06 10:50:01 +00:00
3c8822e3e7 Merge pull request #4 from InsanusMokrassar/renovate/kotlin-monorepo
Update kotlin monorepo to v2.0.20
2024-09-06 16:42:12 +06:00
renovate[bot]
f7d115c624 Update kotlin monorepo to v2.0.20 2024-09-06 10:42:04 +00:00
bb798ccc67 Merge pull request #3 from InsanusMokrassar/renovate/kotlin.serialization
Update dependency org.jetbrains.kotlinx:kotlinx-serialization-json to v1.7.2
2024-09-06 16:40:50 +06:00
renovate[bot]
c4f147df83 Update dependency org.jetbrains.kotlinx:kotlinx-serialization-json to v1.7.2 2024-09-06 10:40:29 +00:00
c2fed22e80 Merge pull request #2 from InsanusMokrassar/renovate/configure
Configure Renovate
2024-09-06 16:39:55 +06:00
renovate[bot]
ec8915aed1 Add renovate.json 2024-09-06 10:37:23 +00:00
1d602c5d26 add .kotlin in .gitignore 2024-08-14 16:31:34 +06:00
2d36722c37 update template 2024-08-14 16:23:54 +06:00
37763d2221 Update libs.versions.toml 2024-04-02 22:10:50 +06:00
3ae29248af Update gradle-wrapper.properties 2024-04-02 22:09:19 +06:00
8f81904cdb update templates 2024-01-17 19:35:06 +06:00
33782f0cdb update dependencies 2024-01-17 19:15:48 +06:00
3bab6a95b2 Update libs.versions.toml 2023-11-29 02:55:39 +06:00
a757c4cf06 Update AndroidManifest.xml 2023-11-02 19:27:24 +06:00
453ae19a49 Update defaultAndroidSettings.gradle 2023-11-02 19:27:02 +06:00
631d74dc6b Update mppAndroidProject.gradle 2023-11-02 19:25:34 +06:00
bd455bebba Update mppProjectWithSerialization.gradle 2023-11-02 19:25:17 +06:00
bd07fb382e Update build.yml 2023-11-02 19:23:14 +06:00
297114273f Update settings.gradle 2023-11-02 19:22:12 +06:00
05f029c257 Update mppProjectWithSerialization.gradle 2023-11-02 19:21:20 +06:00
11ac3aebda Update mppAndroidProject.gradle 2023-11-02 19:20:55 +06:00
c5c7fd26e4 Update mppJavaProject.gradle 2023-11-02 19:20:45 +06:00
ce0aea6b77 Update defaultAndroidSettings.gradle 2023-11-02 19:19:33 +06:00
9d7955b9b0 Update libs.versions.toml 2023-11-02 19:19:01 +06:00
18b84216a5 Update gradle-wrapper.properties 2023-11-02 19:18:39 +06:00
1366dd55c2 Update libs.versions.toml 2023-10-31 17:33:03 +06:00
049dc8f5d7 Update libs.versions.toml 2023-10-16 13:13:56 +06:00
dac20a8a02 Update gradle-wrapper.properties 2023-10-16 13:13:13 +06:00
c1d6dae359 fix of build and templates 2023-08-24 14:22:43 +06:00
4ed6f8e104 Update mppProjectWithSerialization.gradle 2023-08-24 09:58:09 +06:00
dc07633928 Update mppAndroidProject.gradle 2023-08-24 09:57:37 +06:00
be7fa9241f Delete AndroidManifest.xml 2023-08-24 09:57:03 +06:00
df6c8b8358 Create AndroidManifest.xml 2023-08-24 09:56:44 +06:00
ca1ec3f208 Update libs.versions.toml 2023-08-24 09:50:34 +06:00
deba42332a Update libs.versions.toml 2023-05-20 22:18:47 +06:00
e0bce311d5 remove redundant template 2023-05-01 23:17:48 +06:00
ebc07f5c3d update dependencies and add ModuleGenerator templates 2023-05-01 23:13:49 +06:00
488e4b283d Update build.yml 2023-04-20 01:05:57 +06:00
c55087ce1b Update libs.versions.toml 2023-04-20 01:03:15 +06:00
80eb5bb6ba Update libs.versions.toml 2023-03-13 10:07:44 +06:00
8f1bd13ac5 Update libs.versions.toml 2023-03-01 15:39:09 +06:00
12220fab46 Update libs.versions.toml 2023-02-24 16:24:08 +06:00
263ee6475c Update libs.versions.toml 2022-12-18 10:09:09 +06:00
33b25af9a4 Update gradle-wrapper.properties 2022-12-09 21:32:57 +06:00
8f716be674 update android part 2022-11-21 21:21:05 +06:00
3de2e1ceb5 Update libs.versions.toml 2022-11-21 10:45:52 +06:00
836e768705 Update libs.versions.toml 2022-11-21 10:38:10 +06:00
c4ab6cbf74 Update libs.versions.toml 2022-09-26 03:51:16 +06:00
c881165417 improve lib and add template for libs 2022-09-12 14:32:45 +06:00
0ba983cf94 Update libs.versions.toml 2022-08-19 21:48:58 +06:00
04be74561d Update libs.versions.toml 2022-08-06 08:44:01 +06:00
37fe3701fb Update libs.versions.toml 2022-08-06 08:38:08 +06:00
9022faa898 Update gradle-wrapper.properties 2022-08-06 08:35:52 +06:00
e053157dd4 Update libs.versions.toml 2022-08-06 08:35:34 +06:00
7f6e9ae5e4 Update gradle-wrapper.properties 2022-07-22 20:23:30 +06:00
8339c290b9 Update mppProjectWithSerialization.gradle 2022-06-29 13:36:42 +06:00
b575a2ca2f Update mppJavaProject.gradle 2022-06-29 13:36:15 +06:00
71effb81c2 fixes 2022-06-01 01:29:44 +06:00
c2dce5f0b5 Update gradle-wrapper.properties 2022-05-22 23:10:04 +06:00
3974a48d93 Update libs.versions.toml 2022-05-16 17:39:26 +06:00
a964864c58 Update libs.versions.toml 2022-05-12 15:55:18 +06:00
bbfd5886d3 Update libs.versions.toml 2022-04-26 15:49:17 +06:00
323d7c9ee3 Update gradle-wrapper.properties 2022-02-12 12:57:53 +06:00
b7b6f4f7e2 Update libs.versions.toml 2022-02-12 12:57:34 +06:00
5494671ee1 updates and migration onto toml 2022-01-29 21:47:34 +06:00
052072dd5a Update build.yml 2022-01-14 23:22:26 +06:00
ffdfd4b4c5 Update gradle-wrapper.properties 2022-01-14 23:21:52 +06:00
a3cb678f76 Update gradle.properties 2022-01-14 23:21:27 +06:00
36de2d7082 Update gradle.properties 2021-11-26 14:28:17 +06:00
bda4913bf2 Update gradle.properties 2021-11-16 23:26:00 +06:00
acdb9d573e Update mppJsProject.gradle 2021-10-25 15:16:16 +06:00
3a2fda60ed Update mppJavaProject.gradle 2021-10-25 15:16:07 +06:00
da7aefa8ce Update mppProjectWithSerialization.gradle 2021-10-25 15:15:50 +06:00
4ac954d05f Update gradle.properties 2021-10-23 21:59:49 +06:00
c0bbaf0578 update serialization 2021-09-30 12:18:38 +06:00
d1c63deaec add java toolchain setup 2021-09-23 13:20:20 +06:00
e96207516f Update build.yml 2021-09-22 20:23:28 +06:00
adae653e33 Update gradle.properties 2021-09-22 19:48:29 +06:00
9d220c91e3 Update build.gradle 2021-09-04 18:54:59 +06:00
9bc410ccf8 Update gradle-wrapper.properties 2021-09-04 18:51:58 +06:00
018df3cd55 Update gradle.properties 2021-08-25 15:51:33 +06:00
20b356a22c Update gradle.properties 2021-08-17 09:25:09 +06:00
4816349d2d updates 2021-07-03 13:53:30 +06:00
6e7ea5688f Update gradle.properties 2021-07-03 13:25:25 +06:00
9aebefa6cd Update gradle.properties 2021-05-29 17:23:23 +06:00
5aa6388883 Update gradle-wrapper.properties 2021-05-18 11:58:37 +06:00
7e059271c2 Update build.gradle 2021-05-18 11:58:21 +06:00
4decf1ff0a Update gradle.properties 2021-05-06 17:56:28 +06:00
3eaeaf284e Merge pull request #1 from InsanusMokrassar/kotlin/1.5.0
Update gradle.properties
2021-05-02 00:49:19 +06:00
37 changed files with 486 additions and 312 deletions

View File

@@ -5,12 +5,11 @@ on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 1.8
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 17
- name: Build with Gradle
run: ./gradlew build

5
.gitignore vendored
View File

@@ -1,4 +1,5 @@
.idea
.kotlin
out/*
*.iml
target
@@ -10,6 +11,8 @@ build/
out/
secret.gradle
local.properties
local.*
local/
kotlin-js-store/
publishing.sh

4
.templates/README.md Normal file
View File

@@ -0,0 +1,4 @@
# Templates
This folder contains templates to generate your modules in Intellij Idea with plugin
[ModuleGenerator](https://plugins.jetbrains.com/plugin/21100-segment-generator)

View File

@@ -0,0 +1,5 @@
{
"module_name": "sample",
"module_package": "feature.{{.module_name}}",
"full_module_package": "project_group.project_name.{{.module_package}}"
}

View File

@@ -0,0 +1,8 @@
plugins {
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.kotlin.plugin.serialization"
id "com.android.library"
}
apply from: "$mppAndroidProjectPresetPath"

View File

@@ -0,0 +1 @@
package {{.full_module_package}}

View File

@@ -0,0 +1 @@
package {{.full_module_package}}

View File

@@ -0,0 +1,5 @@
{
"module_name": "sample",
"module_package": "feature.{{.module_name}}",
"full_module_package": "project_group.project_name.{{.module_package}}"
}

View File

@@ -0,0 +1,7 @@
plugins {
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.kotlin.plugin.serialization"
}
apply from: "$mppJavaProjectPresetPath"

View File

@@ -0,0 +1 @@
package {{.full_module_package}}

View File

@@ -0,0 +1 @@
package {{.full_module_package}}

View File

@@ -0,0 +1,5 @@
{
"module_name": "sample",
"module_package": "feature.{{.module_name}}",
"full_module_package": "project_group.project_name.{{.module_package}}"
}

View File

@@ -0,0 +1,7 @@
plugins {
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.kotlin.plugin.serialization"
}
apply from: "$mppJsProjectPresetPath"

View File

@@ -0,0 +1 @@
package {{.full_module_package}}

View File

@@ -0,0 +1 @@
package {{.full_module_package}}

View File

@@ -0,0 +1,5 @@
{
"module_name": "sample",
"module_package": "feature.{{.module_name}}",
"full_module_package": "project_group.project_name.{{.module_package}}"
}

View File

@@ -0,0 +1,8 @@
plugins {
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.kotlin.plugin.serialization"
id "com.android.library"
}
apply from: "$mppProjectWithSerializationPresetPath"

View File

@@ -0,0 +1 @@
package {{.full_module_package}}

View File

@@ -0,0 +1 @@
package {{.full_module_package}}

View File

@@ -26,17 +26,21 @@ this case you must rename it in `settings.gradle` file.
## JVM sources in Android target
By default JVM code is not included in Android target. In case you wish to include JVM sources in Android build, use
next method in the end of your `build.gradle`:
next method in the `sourceSets` section of your `build.gradle`:
```groovy
enableIncludingJvmCodeInAndroidPart()
kotlin {
sourceSets {
// Some other code
androidMain {
// Some other code (like dependencies)
dependsOn jvmMain
}
}
}
```
In case when you need to be sure that JVM sources are not included in Android part, use this snippet:
```groovy
disableIncludingJvmCodeInAndroidPart()
```
In case when you need to be sure that JVM sources are not included in Android part, just remove line with `dependsOn jvmMain`
## Types of projects

View File

@@ -1,6 +1,5 @@
buildscript {
repositories {
jcenter()
google()
mavenCentral()
mavenLocal()
@@ -8,21 +7,19 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
classpath "com.getkeepsafe.dexcount:dexcount-gradle-plugin:$dexcount_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
classpath libs.android.tools.build
classpath libs.android.dexcount
classpath libs.kotlin.gradle.plugin
classpath libs.kotlin.serialization.plugin
classpath libs.kotlin.dokka.plugin
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
mavenCentral()
google()
maven { url "https://kotlin.bintray.com/kotlinx" }
}
}

View File

@@ -1,37 +1,15 @@
apply plugin: 'com.getkeepsafe.dexcount'
android {
ext {
jvmKotlinFolderFile = {
String sep = File.separator
return new File("${project.projectDir}${sep}src${sep}jvmMain${sep}kotlin")
}
compileSdkVersion libs.versions.android.compileSdk.get().toInteger()
buildToolsVersion libs.versions.android.buildTools.get()
enableIncludingJvmCodeInAndroidPart = {
File jvmKotlinFolder = jvmKotlinFolderFile()
if (jvmKotlinFolder.exists()) {
android.sourceSets.main.java.srcDirs += jvmKotlinFolder.path
}
}
disableIncludingJvmCodeInAndroidPart = {
File jvmKotlinFolder = jvmKotlinFolderFile()
String[] oldDirs = android.sourceSets.main.java.srcDirs
android.sourceSets.main.java.srcDirs = []
for (oldDir in oldDirs) {
if (oldDir != jvmKotlinFolder.path) {
android.sourceSets.main.java.srcDirs += oldDir
}
}
}
}
compileSdkVersion "$android_compileSdkVersion".toInteger()
buildToolsVersion "$android_buildToolsVersion"
namespace "${group}.${project.name}"
defaultConfig {
minSdkVersion "$android_minSdkVersion".toInteger()
targetSdkVersion "$android_compileSdkVersion".toInteger()
minSdkVersion libs.versions.android.minSdk.get().toInteger()
compileSdkVersion libs.versions.android.compileSdk.get().toInteger()
targetSdkVersion libs.versions.android.compileSdk.get().toInteger()
versionCode "${android_code_version}".toInteger()
versionName "$version"
}
@@ -51,12 +29,8 @@ android {
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8.toString()
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
sourceSets {

View File

@@ -6,25 +6,6 @@ kotlin.incremental.js=true
android.useAndroidX=true
android.enableJetifier=true
kotlin_version=1.5.0
kotlin_serialisation_core_version=1.2.0
# github_release_plugin_version=2.2.12
# ANDROID
android_minSdkVersion=21
android_compileSdkVersion=30
android_buildToolsVersion=30.0.2
dexcount_version=2.0.0
junit_version=4.12
test_ext_junit_version=1.1.2
espresso_core=3.3.0
# Dokka
dokka_version=1.4.30
# Project data
group=project_group

40
gradle/libs.versions.toml Normal file
View File

@@ -0,0 +1,40 @@
[versions]
kotlin = "2.0.20"
kotlin-serialization = "1.7.2"
dokka = "1.9.20"
dexcount = "4.0.0"
junit_version = "4.12"
test_ext_junit_version = "1.2.1"
espresso_core = "3.6.1"
android-gradle-plugin = "8.2.2"
android-minSdk = "21"
android-compileSdk = "35"
android-buildTools = "35.0.0"
[libraries]
kotlin = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
kotlin-serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlin-serialization" }
kotlin-test-common = { module = "org.jetbrains.kotlin:kotlin-test-common", version.ref = "kotlin" }
kotlin-test-annotations-common = { module = "org.jetbrains.kotlin:kotlin-test-annotations-common", version.ref = "kotlin" }
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
kotlin-test-js = { module = "org.jetbrains.kotlin:kotlin-test-js", version.ref = "kotlin" }
android-test-junit = { module = "androidx.test.ext:junit", version.ref = "test_ext_junit_version" }
android-test-espresso-core = { module = "androidx.test.espresso:espresso-core", version.ref = "espresso_core" }
# buildscript classpaths
android-tools-build = { module = "com.android.tools.build:gradle", version.ref = "android-gradle-plugin" }
android-dexcount = { module = "com.getkeepsafe.dexcount:dexcount-gradle-plugin", version.ref = "dexcount" }
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlin-serialization-plugin = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" }
kotlin-dokka-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
[plugins]
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }

Binary file not shown.

View File

@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists

297
gradlew vendored
View File

@@ -1,7 +1,7 @@
#!/usr/bin/env sh
#!/bin/sh
#
# Copyright 2015 the original author or authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -15,69 +15,104 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
#
##############################################################################
##
## Gradle start up script for UN*X
##
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
' "$PWD" ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
MAX_FD=maximum
warn () {
echo "$*"
}
} >&2
die () {
echo
echo "$*"
echo
exit 1
}
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@@ -87,9 +122,9 @@ CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -98,88 +133,120 @@ Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
JAVACMD=java
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"

37
gradlew.bat vendored
View File

@@ -13,8 +13,10 @@
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem
@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@@ -25,7 +27,8 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@@ -40,13 +43,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
@@ -56,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2
goto fail
@@ -75,13 +78,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal

View File

@@ -1,4 +1,4 @@
package project_group
package project_group.project_name.lib
class Library {
fun someLibraryMethod(): Boolean {

View File

@@ -1,7 +1,7 @@
/*
* This Kotlin source file was generated by the Gradle 'init' task.
*/
package project_group
package project_group.project_name.lib
import kotlin.test.Test
import kotlin.test.assertTrue

View File

@@ -1 +0,0 @@
<manifest package="project_group.lib"/>

View File

@@ -4,20 +4,33 @@ project.group = "$group"
// apply from: "$publishGradlePath"
kotlin {
android {
androidTarget {
publishAllLibraryVariants()
compilations.all {
kotlinOptions {
jvmTarget = "17"
}
}
}
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib')
implementation libs.kotlin
api libs.kotlin.serialization
}
}
commonTest {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
implementation libs.kotlin.test.common
implementation libs.kotlin.test.annotations.common
}
}
androidUnitTest {
dependencies {
implementation libs.kotlin.test.junit
implementation libs.android.test.junit
implementation libs.android.test.espresso.core
}
}
}

View File

@@ -5,26 +5,35 @@ project.group = "$group"
kotlin {
jvm {
compilations.main.kotlinOptions.useIR = true
compilations.main {
kotlinOptions {
jvmTarget = "17"
}
}
}
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib')
implementation libs.kotlin
api libs.kotlin.serialization
}
}
commonTest {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
implementation libs.kotlin.test.common
implementation libs.kotlin.test.annotations.common
}
}
jvmTest {
dependencies {
implementation kotlin('test-junit')
implementation libs.kotlin.test.junit
}
}
}
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

View File

@@ -4,7 +4,7 @@ project.group = "$group"
// apply from: "$publishGradlePath"
kotlin {
js (BOTH) {
js (IR) {
browser()
nodejs()
}
@@ -12,19 +12,19 @@ kotlin {
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib')
implementation libs.kotlin
api libs.kotlin.serialization
}
}
commonTest {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
implementation libs.kotlin.test.common
implementation libs.kotlin.test.annotations.common
}
}
jsTest {
dependencies {
implementation kotlin('test-js')
implementation kotlin('test-junit')
implementation libs.kotlin.test.js
}
}
}

View File

@@ -5,48 +5,61 @@ project.group = "$group"
kotlin {
jvm {
compilations.main.kotlinOptions.useIR = true
compilations.main {
kotlinOptions {
jvmTarget = "17"
}
}
}
js (BOTH) {
js (IR) {
browser()
nodejs()
}
android {
androidTarget {
publishAllLibraryVariants()
compilations.all {
kotlinOptions {
jvmTarget = "17"
}
}
}
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib')
api "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlin_serialisation_core_version"
implementation libs.kotlin
api libs.kotlin.serialization
}
}
commonTest {
dependencies {
implementation kotlin('test-common')
implementation kotlin('test-annotations-common')
implementation libs.kotlin.test.common
implementation libs.kotlin.test.annotations.common
}
}
jvmTest {
dependencies {
implementation kotlin('test-junit')
implementation libs.kotlin.test.junit
}
}
jsTest {
dependencies {
implementation kotlin('test-js')
implementation kotlin('test-junit')
implementation libs.kotlin.test.js
}
}
androidTest {
androidUnitTest {
dependencies {
implementation kotlin('test-junit')
implementation "androidx.test.ext:junit:$test_ext_junit_version"
implementation "androidx.test.espresso:espresso-core:$espresso_core"
implementation libs.kotlin.test.junit
implementation libs.android.test.junit
implementation libs.android.test.espresso.core
}
}
}
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
apply from: "$defaultAndroidSettingsPresetPath"

6
renovate.json Normal file
View File

@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
]
}

View File

@@ -6,8 +6,8 @@ String[] includes = [
includes.each { originalName ->
String projectDirectory = "${rootProject.projectDir.getAbsolutePath()}${originalName.replaceAll(":", File.separator)}"
String projectName = "${rootProject.name}${originalName.replaceAll(":", ".")}"
String projectDirectory = "${rootProject.projectDir.getAbsolutePath()}${originalName.replace(":", File.separator)}"
String projectName = "${rootProject.name}${originalName.replace(":", ".")}"
String projectIdentifier = ":${projectName}"
include projectIdentifier
ProjectDescriptor project = project(projectIdentifier)