-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #96 from fingerprintjs/migrate-gradle-scripts-to-kts
Rewrite gradle scripts to kotlin DSL + remove a bit of code that was …
- Loading branch information
Showing
11 changed files
with
221 additions
and
210 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
import com.android.build.gradle.internal.api.BaseVariantOutputImpl | ||
|
||
plugins { | ||
id("com.android.application") | ||
id("kotlin-android") | ||
id("kotlin-parcelize") | ||
id("kotlin-kapt") | ||
} | ||
|
||
android { | ||
compileSdk = 33 | ||
|
||
defaultConfig { | ||
applicationId = "com.fingerprintjs.android.playground" | ||
minSdk = 21 | ||
targetSdk = 33 | ||
versionCode = Integer.parseInt(project.property("VERSION_CODE") as String) | ||
versionName = project.property("VERSION_NAME") as String | ||
|
||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
} | ||
|
||
signingConfigs { | ||
create("release") { | ||
storeFile = file("release.jks") | ||
storePassword = System.getenv("KEYSTORE_PASSWORD") | ||
keyAlias = System.getenv("RELEASE_SIGN_KEY_ALIAS") | ||
keyPassword = System.getenv("RELEASE_SIGN_KEY_PASSWORD") | ||
} | ||
|
||
create("releaseDummySign") { | ||
storeFile = file("release_dummy.jks") | ||
storePassword = "password" | ||
keyAlias = "key0" | ||
keyPassword = "password" | ||
} | ||
} | ||
|
||
buildTypes { | ||
release { | ||
isMinifyEnabled = true | ||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") | ||
signingConfig = signingConfigs.getByName("release") | ||
} | ||
// build release app locally using a dummy signature | ||
create("releaseDummySign") { | ||
isMinifyEnabled = true | ||
proguardFiles (getDefaultProguardFile ("proguard-android-optimize.txt"), "proguard-rules.pro") | ||
signingConfig = signingConfigs.getByName("releaseDummySign") | ||
setMatchingFallbacks("release") | ||
} | ||
// same as previous, but also profileable | ||
// when changing the name of the following build type, don't forget to update src/{this_build_type} dir | ||
create("releaseDummySignProfileable") { | ||
initWith(buildTypes.getByName("releaseDummySign")) | ||
} | ||
} | ||
|
||
namespace = "com.fingerprintjs.android.playground" | ||
|
||
applicationVariants.all { | ||
val variant = this | ||
this.outputs.all { | ||
(this as? BaseVariantOutputImpl)?.outputFileName = "Playground-${variant.name}-${variant.versionName}.apk" | ||
} | ||
} | ||
|
||
buildFeatures { | ||
compose = true | ||
} | ||
|
||
composeOptions { | ||
kotlinCompilerExtensionVersion = "1.4.7" | ||
} | ||
} | ||
|
||
dependencies { | ||
implementation(project(":fingerprint")) | ||
implementation("org.jetbrains.kotlin:kotlin-stdlib:${Constants.kotlinVersion}") | ||
implementation("com.google.android.material:material:1.9.0") | ||
implementation("androidx.core:core-ktx:1.10.0") | ||
implementation("androidx.appcompat:appcompat:1.6.1") | ||
|
||
val composeBom = platform("androidx.compose:compose-bom:2022.11.00") | ||
implementation(composeBom) | ||
androidTestImplementation(composeBom) | ||
implementation("androidx.compose.material3:material3") | ||
implementation("androidx.compose.ui:ui-tooling-preview") | ||
debugImplementation("androidx.compose.ui:ui-tooling") | ||
implementation("androidx.compose.material:material-icons-extended") | ||
implementation("androidx.activity:activity-compose:1.7.1") | ||
implementation("androidx.lifecycle:lifecycle-viewmodel-compose:2.6.1") | ||
implementation("androidx.navigation:navigation-compose:2.5.3") | ||
implementation("androidx.core:core-splashscreen:1.0.1") | ||
|
||
implementation("com.google.accompanist:accompanist-pager:0.27.0") | ||
|
||
implementation("com.google.dagger:dagger:2.44") | ||
kapt("com.google.dagger:dagger-compiler:2.44") | ||
|
||
implementation("com.google.code.gson:gson:2.10") | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
buildscript { | ||
repositories { | ||
google() | ||
mavenCentral() | ||
gradlePluginPortal() | ||
} | ||
dependencies { | ||
classpath("com.android.tools.build:gradle:7.4.2") | ||
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:${Constants.kotlinVersion}") | ||
classpath("com.github.dcendents:android-maven-gradle-plugin:2.1") | ||
} | ||
} | ||
|
||
task<Delete>("clean") { | ||
delete(rootProject.buildDir) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/.gradle | ||
/build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
plugins { | ||
`kotlin-dsl` | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
object Constants { | ||
const val kotlinVersion = "1.8.21" | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.