-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#513] [KMM Support] Migrate to Gradle 8 #508
Changes from all commits
a02f4ee
80e67aa
cf0814e
0892122
1bc4cf4
f36674b
e670007
9f30b1a
9054dc1
4def9ea
799ed77
d49e49f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,12 +8,6 @@ jobs: | |
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
steps: | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
|
||
- name: Checkout source code | ||
uses: actions/[email protected] | ||
|
||
|
@@ -28,36 +22,20 @@ jobs: | |
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
|
||
# template-xml | ||
|
||
- name: Run Detekt on template-xml | ||
working-directory: ./template-xml | ||
run: ./gradlew detekt | ||
|
||
- name: Archive Detekt reports on template-xml | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: DetektReportsTemplateXML | ||
path: template-xml/build/reports/detekt/ | ||
|
||
- name: Run unit tests with Kover on template-xml | ||
working-directory: ./template-xml | ||
run: ./gradlew koverHtmlReport | ||
# template-compose | ||
|
||
- name: Archive code coverage reports on template-xml | ||
uses: actions/upload-artifact@v2 | ||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
name: CodeCoverageReportsTemplateXML | ||
path: template-xml/app/build/reports/kover/ | ||
|
||
# template-compose | ||
distribution: 'temurin' | ||
java-version: '17' | ||
|
||
- name: Run Detekt on template-compose | ||
working-directory: ./template-compose | ||
run: ./gradlew detekt | ||
|
||
- name: Archive Detekt reports on template-compose | ||
uses: actions/upload-artifact@v2 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: DetektReportsTemplateCompose | ||
path: template-compose/build/reports/detekt/ | ||
|
@@ -67,19 +45,47 @@ jobs: | |
run: ./gradlew koverHtmlReport | ||
|
||
- name: Archive code coverage reports on template-compose | ||
uses: actions/upload-artifact@v2 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: CodeCoverageReportsTemplateCompose | ||
path: template-compose/app/build/reports/kover/ | ||
|
||
# template-xml | ||
|
||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
|
||
- name: Run Detekt on template-xml | ||
working-directory: ./template-xml | ||
run: ./gradlew detekt | ||
|
||
- name: Archive Detekt reports on template-xml | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: DetektReportsTemplateXML | ||
path: template-xml/build/reports/detekt/ | ||
|
||
- name: Run unit tests with Kover on template-xml | ||
working-directory: ./template-xml | ||
run: ./gradlew koverHtmlReport | ||
|
||
- name: Archive code coverage reports on template-xml | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: CodeCoverageReportsTemplateXML | ||
path: template-xml/app/build/reports/kover/ | ||
|
||
# sample-xml | ||
|
||
- name: Run Detekt on sample-xml | ||
working-directory: ./sample-xml | ||
run: ./gradlew detekt | ||
|
||
- name: Archive Detekt reports on sample-xml | ||
uses: actions/upload-artifact@v2 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: DetektReportsTemplateXML | ||
path: sample-xml/build/reports/detekt/ | ||
|
@@ -89,7 +95,7 @@ jobs: | |
run: ./gradlew koverHtmlReport | ||
|
||
- name: Archive code coverage reports on sample-xml | ||
uses: actions/upload-artifact@v2 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: CodeCoverageReportsTemplateXML | ||
path: sample-xml/app/build/reports/kover/ | ||
|
@@ -101,7 +107,7 @@ jobs: | |
run: ./gradlew detekt | ||
|
||
- name: Archive Detekt reports on sample-compose | ||
uses: actions/upload-artifact@v2 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: DetektReportsTemplateCompose | ||
path: sample-compose/build/reports/detekt/ | ||
|
@@ -111,7 +117,7 @@ jobs: | |
run: ./gradlew koverHtmlReport | ||
|
||
- name: Archive code coverage reports on sample-compose | ||
uses: actions/upload-artifact@v2 | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: CodeCoverageReportsTemplateCompose | ||
path: sample-compose/app/build/reports/kover/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
import org.jetbrains.kotlin.konan.properties.loadProperties | ||
|
||
plugins { | ||
id(Plugins.ANDROID_APPLICATION) | ||
id(Plugins.KOTLIN_ANDROID) | ||
|
@@ -7,7 +9,7 @@ plugins { | |
id(Plugins.KOVER) | ||
} | ||
|
||
val keystoreProperties = rootDir.loadGradleProperties("signing.properties") | ||
val signingProperties = loadProperties("$rootDir/signing.properties") | ||
luongvo marked this conversation as resolved.
Show resolved
Hide resolved
|
||
val getVersionCode: () -> Int = { | ||
if (project.hasProperty("versionCode")) { | ||
(project.property("versionCode") as String).toInt() | ||
|
@@ -17,13 +19,29 @@ val getVersionCode: () -> Int = { | |
} | ||
|
||
android { | ||
namespace = "co.nimblehq.template.compose" | ||
compileSdk = Versions.ANDROID_COMPILE_SDK | ||
|
||
defaultConfig { | ||
applicationId = "co.nimblehq.template.compose" | ||
minSdk = Versions.ANDROID_MIN_SDK | ||
targetSdk = Versions.ANDROID_TARGET_SDK | ||
versionCode = getVersionCode() | ||
versionName = Versions.ANDROID_VERSION_NAME | ||
|
||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
vectorDrawables { | ||
useSupportLibrary = true | ||
} | ||
} | ||
|
||
signingConfigs { | ||
create(BuildTypes.RELEASE) { | ||
// Remember to edit signing.properties to have the correct info for release build. | ||
storeFile = file("../config/release.keystore") | ||
storePassword = keystoreProperties.getProperty("KEYSTORE_PASSWORD") as String | ||
keyPassword = keystoreProperties.getProperty("KEY_PASSWORD") as String | ||
keyAlias = keystoreProperties.getProperty("KEY_ALIAS") as String | ||
storePassword = signingProperties.getProperty("KEYSTORE_PASSWORD") as String | ||
keyPassword = signingProperties.getProperty("KEY_PASSWORD") as String | ||
keyAlias = signingProperties.getProperty("KEY_ALIAS") as String | ||
} | ||
|
||
getByName(BuildTypes.DEBUG) { | ||
|
@@ -34,18 +52,8 @@ android { | |
} | ||
} | ||
|
||
compileSdk = Versions.ANDROID_COMPILE_SDK | ||
defaultConfig { | ||
applicationId = "co.nimblehq.template.compose" | ||
minSdk = Versions.ANDROID_MIN_SDK | ||
targetSdk = Versions.ANDROID_TARGET_SDK | ||
versionCode = getVersionCode() | ||
versionName = Versions.ANDROID_VERSION_NAME | ||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
buildTypes { | ||
getByName(BuildTypes.RELEASE) { | ||
release { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need to update this? π€ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lydiasama |
||
isMinifyEnabled = true | ||
isDebuggable = false | ||
isShrinkResources = true | ||
|
@@ -54,7 +62,7 @@ android { | |
buildConfigField("String", "BASE_API_URL", "\"https://jsonplaceholder.typicode.com/\"") | ||
} | ||
|
||
getByName(BuildTypes.DEBUG) { | ||
debug { | ||
// For quickly testing build with proguard, enable this | ||
isMinifyEnabled = false | ||
signingConfig = signingConfigs[BuildTypes.DEBUG] | ||
|
@@ -76,20 +84,27 @@ android { | |
} | ||
|
||
compileOptions { | ||
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
sourceCompatibility = JavaVersion.VERSION_17 | ||
targetCompatibility = JavaVersion.VERSION_17 | ||
} | ||
|
||
kotlinOptions { | ||
jvmTarget = JavaVersion.VERSION_11.toString() | ||
jvmTarget = JavaVersion.VERSION_17.toString() | ||
} | ||
|
||
buildFeatures { | ||
compose = true | ||
buildConfig = true | ||
} | ||
|
||
composeOptions { | ||
kotlinCompilerExtensionVersion = Versions.COMPOSE_COMPILER | ||
} | ||
|
||
buildFeatures { | ||
compose = true | ||
packaging { | ||
resources { | ||
excludes += "/META-INF/{AL2.0,LGPL2.1}" | ||
} | ||
} | ||
|
||
lint { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove the Cache gems step and set the
bundler-cache: true
at Set up Ruby step like we did in KMM Templates?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lydiasama Yes, but it's out of this PR's scope. I recommend revising this workflow from this task instead #519.