Skip to content

Commit aa8f4df

Browse files
authored
chore(very_good_wear_app): migrates Groovy scripts to Kotlin DSL (#317)
1 parent e384bed commit aa8f4df

File tree

7 files changed

+142
-158
lines changed

7 files changed

+142
-158
lines changed

very_good_wear_app/__brick__/android/app/build.gradle

Lines changed: 0 additions & 113 deletions
This file was deleted.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import java.util.Properties
2+
import java.io.FileInputStream
3+
4+
plugins {
5+
id("com.android.application")
6+
id("kotlin-android")
7+
id("dev.flutter.flutter-gradle-plugin")
8+
}
9+
10+
val keystoreProperties = Properties()
11+
val keystorePropertiesFile = rootProject.file("key.properties")
12+
if (keystorePropertiesFile.exists()) {
13+
keystoreProperties.load(FileInputStream(keystorePropertiesFile))
14+
}
15+
16+
android {
17+
namespace = "{{application_id}}"
18+
compileSdk = flutter.compileSdkVersion
19+
ndkVersion = flutter.ndkVersion
20+
21+
compileOptions {
22+
sourceCompatibility = JavaVersion.VERSION_11
23+
targetCompatibility = JavaVersion.VERSION_11
24+
}
25+
26+
kotlinOptions {
27+
jvmTarget = JavaVersion.VERSION_11.toString()
28+
}
29+
30+
defaultConfig {
31+
applicationId = "{{application_id}}"
32+
minSdk = 30
33+
targetSdk = 32
34+
versionCode = flutter.versionCode
35+
versionName = flutter.versionName
36+
}
37+
38+
signingConfigs {
39+
create("release") {
40+
if (System.getenv("ANDROID_KEYSTORE_PATH") != null) {
41+
storeFile = file(System.getenv("ANDROID_KEYSTORE_PATH"))
42+
keyAlias = System.getenv("ANDROID_KEYSTORE_ALIAS")
43+
keyPassword = System.getenv("ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD")
44+
storePassword = System.getenv("ANDROID_KEYSTORE_PASSWORD")
45+
46+
} else {
47+
keyAlias = keystoreProperties["keyAlias"] as String?
48+
keyPassword = keystoreProperties["keyPassword"] as String?
49+
storeFile = keystoreProperties["storeFile"]?.let { file(it) }
50+
storePassword = keystoreProperties["storePassword"] as String?
51+
}
52+
}
53+
}
54+
55+
flavorDimensions += "default"
56+
productFlavors {
57+
create("production") {
58+
dimension = "default"
59+
applicationIdSuffix = ""
60+
manifestPlaceholders["appName"] = "{{project_name.titleCase()}}"
61+
}
62+
create("staging") {
63+
dimension = "default"
64+
applicationIdSuffix = ".stg"
65+
manifestPlaceholders["appName"] = "[STG] {{project_name.titleCase()}}"
66+
}
67+
create("development") {
68+
dimension = "default"
69+
applicationIdSuffix = ".dev"
70+
manifestPlaceholders["appName"] = "[DEV] {{project_name.titleCase()}}"
71+
}
72+
}
73+
74+
buildTypes {
75+
getByName("release") {
76+
signingConfig = signingConfigs.getByName("release")
77+
isMinifyEnabled = true
78+
proguardFiles(
79+
getDefaultProguardFile("proguard-android.txt"),
80+
"proguard-rules.pro"
81+
)
82+
}
83+
getByName("debug") {
84+
signingConfig = signingConfigs.getByName("debug")
85+
}
86+
}
87+
}
88+
89+
flutter {
90+
source = "../.."
91+
}
92+
93+
dependencies {
94+
implementation("androidx.wear:wear:1.3.0")
95+
}

very_good_wear_app/__brick__/android/build.gradle

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
allprojects {
2+
repositories {
3+
google()
4+
mavenCentral()
5+
}
6+
}
7+
8+
val newBuildDir: Directory = rootProject.layout.buildDirectory.dir("../../build").get()
9+
rootProject.layout.buildDirectory.value(newBuildDir)
10+
11+
subprojects {
12+
val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name)
13+
project.layout.buildDirectory.value(newSubprojectBuildDir)
14+
}
15+
subprojects {
16+
project.evaluationDependsOn(":app")
17+
}
18+
19+
tasks.register<Delete>("clean") {
20+
delete(rootProject.layout.buildDirectory)
21+
}

very_good_wear_app/__brick__/android/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-8.3-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip

very_good_wear_app/__brick__/android/settings.gradle

Lines changed: 0 additions & 26 deletions
This file was deleted.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
pluginManagement {
2+
val flutterSdkPath = run {
3+
val properties = java.util.Properties()
4+
file("local.properties").inputStream().use { properties.load(it) }
5+
val flutterSdkPath = properties.getProperty("flutter.sdk")
6+
require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" }
7+
flutterSdkPath
8+
}
9+
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
11+
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
18+
19+
plugins {
20+
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
21+
id("com.android.application") version "8.4.2" apply false
22+
id("org.jetbrains.kotlin.android") version "2.1.10" apply false
23+
}
24+
25+
include(":app")

0 commit comments

Comments
 (0)