Skip to content

Commit b3f351d

Browse files
authored
Update kotlin MPP and AGP versions (#30)
* Update kotlin and AGP versions * add github action * Bump moar * Upgrade to new javascript gradle pluign * Fix CI working dir
1 parent b2ca602 commit b3f351d

22 files changed

+85
-152
lines changed

.github/workflows/android.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Android CI
2+
3+
on:
4+
push:
5+
branches: [ master ]
6+
pull_request:
7+
branches: [ master ]
8+
9+
jobs:
10+
build:
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: set up JDK 1.8
17+
uses: actions/setup-java@v1
18+
with:
19+
java-version: 1.8
20+
- name: Build with Gradle
21+
run: ./gradlew check
22+
- name: Cache dependencies
23+
uses: actions/cache@v1
24+
with:
25+
path: ~/.gradle/caches
26+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
27+
restore-keys: |
28+
${{ runner.os }}-gradle-

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ local.properties
1919
*.so
2020
*.nes
2121
.externalNativeBuild
22-
.cxx
22+
.cxx
23+
node_modules

.travis.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

android/build.gradle

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1+
plugins {
2+
id 'org.jetbrains.kotlin.multiplatform' version '1.3.71'
3+
}
4+
15
apply plugin: 'com.android.application'
2-
apply plugin: 'kotlin-multiplatform'
36
apply plugin: 'kotlin-android-extensions'
47

58
android {
6-
compileSdkVersion 28
9+
compileSdkVersion 29
710

811
defaultConfig {
912
applicationId "com.felipecsl.knes"
1013
minSdkVersion 16
11-
targetSdkVersion 28
14+
targetSdkVersion 29
1215
versionCode 1
1316
versionName "1.0"
1417
ndk {
@@ -52,7 +55,7 @@ dependencies {
5255
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
5356
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
5457
testImplementation 'junit:junit:4.12'
55-
testImplementation 'com.google.truth:truth:0.42'
58+
testImplementation 'com.google.truth:truth:1.0.1'
5659
testImplementation 'org.mockito:mockito-core:1.10.19'
5760
testImplementation "org.robolectric:robolectric:3.8"
5861
}

build.gradle

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
buildscript {
2-
ext.kotlin_version = '1.3.50'
3-
ext.android_gradle_plugin_version = '3.5.2'
2+
ext.kotlin_version = '1.3.71'
3+
ext.android_gradle_plugin_version = '4.0.0-beta01'
44

55
repositories {
66
mavenLocal()
@@ -16,8 +16,6 @@ buildscript {
1616
}
1717
dependencies {
1818
classpath "com.android.tools.build:gradle:$android_gradle_plugin_version"
19-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
20-
classpath "org.jetbrains.kotlin:kotlin-frontend-plugin:0.0.45"
2119
}
2220
}
2321

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip

lib/build.gradle

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
apply plugin: 'kotlin-multiplatform'
1+
plugins {
2+
id 'org.jetbrains.kotlin.multiplatform' version '1.3.71'
3+
}
4+
25
apply plugin: 'com.android.library'
36

47
android {
5-
compileSdkVersion 28
8+
compileSdkVersion 29
69

710
defaultConfig {
811
minSdkVersion 16
9-
targetSdkVersion 28
12+
targetSdkVersion 29
1013
}
1114
}
1215

@@ -15,19 +18,11 @@ dependencies {
1518
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
1619
}
1720

18-
afterEvaluate {
19-
compileKotlinJs {
20-
kotlinOptions.metaInfo = true
21-
kotlinOptions.outputFile = "${project.buildDir.path}/js/${project.name}.js"
22-
kotlinOptions.sourceMap = true
23-
kotlinOptions.moduleKind = 'commonjs'
24-
kotlinOptions.main = "call"
25-
}
26-
}
27-
2821
kotlin {
2922
jvm()
30-
js()
23+
js {
24+
browser {}
25+
}
3126
android()
3227
androidNativeArm32()
3328
androidNativeArm64()
@@ -59,22 +54,22 @@ kotlin {
5954
implementation "org.jetbrains.kotlin:kotlin-stdlib-common:$kotlin_version"
6055
}
6156
}
62-
jvm().compilations.main.defaultSourceSet {
57+
jvmMain {
6358
dependencies {
6459
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
6560
}
6661
}
67-
js().compilations.main.defaultSourceSet {
62+
jsMain {
6863
dependencies {
6964
implementation "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
7065
}
7166
}
72-
jvm().compilations.test.defaultSourceSet {
67+
jvmTest {
7368
dependencies {
7469
implementation "org.jetbrains.kotlin:kotlin-test:$kotlin_version"
7570
implementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
7671
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
77-
implementation 'com.google.truth:truth:0.42'
72+
implementation 'com.google.truth:truth:1.0.1'
7873
implementation 'org.mockito:mockito-core:1.10.19'
7974
implementation "org.robolectric:robolectric:3.8"
8075
}

web/build.gradle

Lines changed: 27 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,34 @@
1-
apply plugin: 'kotlin-multiplatform'
2-
apply plugin: 'org.jetbrains.kotlin.frontend'
3-
4-
kotlinFrontend {
5-
downloadNodeJsVersion = "latest"
6-
7-
webpackBundle {
8-
bundleName = "main"
9-
contentPath = file('src/jsMain/web')
10-
webpackConfigFile = file('webpack.config.js').absolutePath
11-
sourceMapEnabled = true
12-
mode = "development"
13-
}
14-
15-
npm {
16-
dependency "react"
17-
dependency "core-js"
18-
dependency "react-dom"
19-
dependency "react-router-dom"
20-
dependency "kotlin"
21-
// This looks like an unofficial package but I couldn't find the actual Jetbrains one, only kotlinx-html
22-
dependency "kotlinx-html-js"
23-
dependency "@jetbrains/kotlin-react"
24-
dependency "@jetbrains/kotlin-react-dom"
25-
dependency "@jetbrains/kotlin-extensions"
26-
dependency "@jetbrains/kotlin-react-router-dom"
27-
}
1+
plugins {
2+
id 'org.jetbrains.kotlin.js' version '1.3.71'
283
}
294

305
kotlin {
31-
sourceSets {
32-
jsMain {
33-
dependencies {
34-
implementation project(':lib')
35-
implementation "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
36-
// https://bintray.com/kotlin/kotlin-js-wrappers/kotlin-react
37-
implementation "org.jetbrains:kotlin-react:16.9.0-pre.83-kotlin-$kotlin_version"
38-
// https://bintray.com/kotlin/kotlin-js-wrappers/kotlin-react-dom
39-
implementation "org.jetbrains:kotlin-react-dom:16.9.0-pre.83-kotlin-$kotlin_version"
40-
// https://bintray.com/kotlin/kotlin-js-wrappers/kotlin-react-router-dom
41-
implementation "org.jetbrains:kotlin-react-router-dom:4.3.1-pre.83-kotlin-$kotlin_version"
42-
// https://github.com/Kotlin/kotlinx.html/releases
43-
implementation "org.jetbrains.kotlinx:kotlinx-html-js:0.6.12"
44-
}
6+
target {
7+
browser {
458
}
469
}
47-
48-
targets {
49-
fromPreset(presets.js, 'js') {
50-
configure([compilations.main, compilations.test]) {
51-
tasks.getByName(compileKotlinTaskName).kotlinOptions {
52-
metaInfo = true
53-
outputFile = file("build/js/${project.name}.js")
54-
sourceMap = true
55-
moduleKind = 'commonjs'
56-
}
57-
}
58-
59-
configure(compilations.main) {
60-
tasks.getByName(compileKotlinTaskName).kotlinOptions {
61-
main = "call"
62-
}
63-
}
64-
}
65-
}
66-
}
67-
68-
afterEvaluate {
69-
tasks.getByName('karma-run-single') {
70-
enabled false
71-
}
72-
}
73-
74-
task copyLibs(type: Copy) {
75-
destinationDir buildDir
76-
77-
into("js") {
78-
from project(':lib').file("build/js")
10+
sourceSets["main"].dependencies {
11+
implementation npm("react", "16.13.1")
12+
implementation npm("core-js", "3.6.4")
13+
implementation npm("react-dom", "16.13.1")
14+
implementation npm("react-router-dom", "5.1.2")
15+
// This looks like an unofficial package but I couldn't find the actual Jetbrains one, only kotlinx-html
16+
implementation npm("kotlinx-html-js", "0.6.4")
17+
implementation npm("@jetbrains/kotlin-react", "16.9.0-pre.91")
18+
implementation npm("@jetbrains/kotlin-react-dom", "16.9.0-pre.91")
19+
implementation npm("@jetbrains/kotlin-extensions", "1.0.1-pre.91")
20+
implementation npm("@jetbrains/kotlin-react-router-dom", "4.3.1-pre.91")
21+
22+
implementation project(':lib')
23+
24+
implementation "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
25+
// https://bintray.com/kotlin/kotlin-js-wrappers/kotlin-react
26+
implementation "org.jetbrains:kotlin-react:16.13.0-pre.94-kotlin-1.3.70"
27+
// https://bintray.com/kotlin/kotlin-js-wrappers/kotlin-react-dom
28+
implementation "org.jetbrains:kotlin-react-dom:16.13.0-pre.94-kotlin-1.3.70"
29+
// https://bintray.com/kotlin/kotlin-js-wrappers/kotlin-react-router-dom
30+
implementation "org.jetbrains:kotlin-react-router-dom:4.3.1-pre.94-kotlin-1.3.70"
31+
// https://github.com/Kotlin/kotlinx.html/releases
32+
implementation "org.jetbrains.kotlinx:kotlinx-html-js:0.7.1"
7933
}
80-
}
81-
82-
bundle {
83-
dependsOn copyLibs
84-
}
85-
86-
dependencies {
87-
implementation "org.jetbrains.kotlin:kotlin-stdlib-js:$kotlin_version"
8834
}
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)