Skip to content

Commit 78039cd

Browse files
mdmahendrivbuberen
authored andcommitted
refactor(package_info_plus): change android gradle from groovy to kotlin
1 parent ee23d0a commit 78039cd

10 files changed

Lines changed: 156 additions & 166 deletions

File tree

packages/package_info_plus/package_info_plus/android/build.gradle

Lines changed: 0 additions & 53 deletions
This file was deleted.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
group = "dev.fluttercommunity.plus.packageinfo"
2+
version = "1.0-SNAPSHOT"
3+
4+
buildscript {
5+
val kotlinVersion = "2.2.0"
6+
7+
repositories {
8+
google()
9+
mavenCentral()
10+
}
11+
12+
dependencies {
13+
classpath("com.android.tools.build:gradle:8.12.1")
14+
classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion")
15+
}
16+
}
17+
18+
allprojects {
19+
repositories {
20+
google()
21+
mavenCentral()
22+
}
23+
}
24+
25+
plugins {
26+
id("com.android.library")
27+
id("kotlin-android")
28+
}
29+
30+
kotlin {
31+
compilerOptions {
32+
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
33+
}
34+
}
35+
36+
android {
37+
namespace = "dev.fluttercommunity.plus.packageinfo"
38+
compileSdk = flutter.compileSdkVersion
39+
40+
compileOptions {
41+
sourceCompatibility = JavaVersion.VERSION_17
42+
targetCompatibility = JavaVersion.VERSION_17
43+
}
44+
45+
defaultConfig {
46+
minSdk = 19
47+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
48+
}
49+
50+
lint {
51+
disable.add("InvalidPackage")
52+
}
53+
}

packages/package_info_plus/package_info_plus/android/settings.gradle

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
rootProject.name = "package_info_plus"

packages/package_info_plus/package_info_plus/example/android/app/build.gradle

Lines changed: 0 additions & 71 deletions
This file was deleted.
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
plugins {
2+
id("com.android.application")
3+
id("kotlin-android")
4+
id("dev.flutter.flutter-gradle-plugin")
5+
}
6+
7+
kotlin {
8+
compilerOptions {
9+
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17
10+
}
11+
}
12+
13+
android {
14+
namespace = "io.flutter.plugins.packageinfoexample"
15+
compileSdk = flutter.compileSdkVersion
16+
17+
compileOptions {
18+
sourceCompatibility = JavaVersion.VERSION_17
19+
targetCompatibility = JavaVersion.VERSION_17
20+
}
21+
22+
defaultConfig {
23+
applicationId = "io.flutter.plugins.packageinfoexample"
24+
minSdk = flutter.minSdkVersion
25+
targetSdk = flutter.targetSdkVersion
26+
versionCode = flutter.versionCode
27+
versionName = flutter.versionName
28+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
29+
}
30+
31+
lint {
32+
disable.add("InvalidPackage")
33+
}
34+
35+
buildTypes {
36+
release {
37+
// Signing with the debug keys for now, so `flutter run --release` works.
38+
signingConfig = signingConfigs.getByName("debug")
39+
}
40+
}
41+
}
42+
43+
flutter {
44+
source = "../.."
45+
}
46+
47+
dependencies {
48+
testImplementation("junit:junit:4.13.2")
49+
androidTestImplementation("androidx.test:runner:1.2.0")
50+
androidTestImplementation("androidx.test.espresso:espresso-core:3.2.0")
51+
}

packages/package_info_plus/package_info_plus/example/android/build.gradle

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

packages/package_info_plus/package_info_plus/example/android/settings.gradle

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

0 commit comments

Comments
 (0)