File tree 4 files changed +54
-48
lines changed
4 files changed +54
-48
lines changed Original file line number Diff line number Diff line change
1
+ plugins {
2
+ id " com.android.library"
3
+ }
4
+
1
5
group ' com.optimizely.optimizely_flutter_sdk'
2
6
version ' 1.0'
3
7
4
- buildscript {
5
-
6
- def version_name = System . getenv(' TRAVIS_TAG' )
7
- if (version_name != null ) {
8
- rootProject. ext. version_name = version_name
9
- } else {
10
- rootProject. ext. version_name = ' debugVersion'
11
- }
12
-
13
- repositories {
14
- google()
15
- mavenCentral()
16
- }
17
-
18
- dependencies {
19
- classpath ' com.android.tools.build:gradle:7.2.1'
20
- }
8
+ def version_name = System . getenv(' TRAVIS_TAG' )
9
+ if (version_name != null ) {
10
+ rootProject. ext. version_name = version_name
11
+ } else {
12
+ rootProject. ext. version_name = ' debugVersion'
21
13
}
14
+
22
15
configurations {
23
16
all* . exclude group : ' com.google.guava' , module : ' listenablefuture'
24
17
}
@@ -29,7 +22,6 @@ rootProject.allprojects {
29
22
}
30
23
}
31
24
32
- apply plugin : ' com.android.library'
33
25
34
26
ext {
35
27
compile_sdk_version = 32
@@ -71,7 +63,6 @@ android {
71
63
72
64
}
73
65
74
-
75
66
dependencies {
76
67
implementation ' androidx.multidex:multidex:2.0.0'
77
68
implementation ' com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava'
Original file line number Diff line number Diff line change
1
+
2
+ plugins {
3
+ id " com.android.application"
4
+ id " org.jetbrains.kotlin.android"
5
+ id " dev.flutter.flutter-gradle-plugin"
6
+ }
7
+
1
8
def localProperties = new Properties ()
2
9
def localPropertiesFile = rootProject. file(' local.properties' )
3
10
if (localPropertiesFile. exists()) {
@@ -6,11 +13,6 @@ if (localPropertiesFile.exists()) {
6
13
}
7
14
}
8
15
9
- def flutterRoot = localProperties. getProperty(' flutter.sdk' )
10
- if (flutterRoot == null ) {
11
- throw new GradleException (" Flutter SDK not found. Define location with flutter.sdk in the local.properties file." )
12
- }
13
-
14
16
def flutterVersionCode = localProperties. getProperty(' flutter.versionCode' )
15
17
if (flutterVersionCode == null ) {
16
18
flutterVersionCode = ' 1'
@@ -21,10 +23,6 @@ if (flutterVersionName == null) {
21
23
flutterVersionName = ' 1.0'
22
24
}
23
25
24
- apply plugin : ' com.android.application'
25
- apply plugin : ' kotlin-android'
26
- apply from : " $flutterRoot /packages/flutter_tools/gradle/flutter.gradle"
27
-
28
26
android {
29
27
compileSdkVersion 32
30
28
ndkVersion flutter. ndkVersion
@@ -57,3 +55,7 @@ android {
57
55
flutter {
58
56
source ' ../..'
59
57
}
58
+
59
+ dependencies {
60
+ implementation ' com.android.support:multidex:1.0.3'
61
+ }
Original file line number Diff line number Diff line change 1
- buildscript {
2
- ext. kotlin_version = ' 1.6.10'
3
- repositories {
4
- google()
5
- mavenCentral()
6
- }
7
1
8
- dependencies {
9
- classpath ' com.android.tools.build:gradle:7.2.1'
10
- classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version "
11
- }
12
- }
13
2
ext {
14
3
android_sdk_version = " 4.0.0"
15
4
}
5
+
16
6
allprojects {
17
7
repositories {
18
8
google()
@@ -28,6 +18,6 @@ subprojects {
28
18
project. evaluationDependsOn(' :app' )
29
19
}
30
20
31
- task clean ( type : Delete ) {
21
+ tasks . register( " clean " , Delete ) {
32
22
delete rootProject. buildDir
33
23
}
Original file line number Diff line number Diff line change 1
- include ' :app'
1
+ pluginManagement {
2
+ def flutterSdkPath = {
3
+ def properties = new Properties ()
4
+ file(" local.properties" ). withInputStream { properties. load(it) }
5
+ def flutterSdkPath = properties. getProperty(" flutter.sdk" )
6
+ assert flutterSdkPath != null , " flutter.sdk not set in local.properties"
7
+ return flutterSdkPath
8
+ }
9
+
10
+ settings. ext. flutterSdkPath = flutterSdkPath()
11
+ includeBuild(" ${ settings.ext.flutterSdkPath} /packages/flutter_tools/gradle" )
2
12
3
- def localPropertiesFile = new File (rootProject. projectDir, " local.properties" )
4
- def properties = new Properties ()
13
+ repositories {
14
+ google()
15
+ mavenCentral()
16
+ gradlePluginPortal()
17
+ }
18
+ resolutionStrategy {
19
+ eachPlugin {
20
+ if (requested. id. namespace == ' dev.flutter' ) {
21
+ useModule(" dev.flutter:${ requested.id.name} :${ requested.version} " )
22
+ }
23
+ }
24
+ }
25
+ }
5
26
6
- assert localPropertiesFile. exists()
7
- localPropertiesFile. withReader(" UTF-8" ) { reader -> properties. load(reader) }
27
+ plugins {
28
+ id " dev.flutter.flutter-plugin-loader" version " 1.0.0"
29
+ id " com.android.application" version " 7.2.1" apply false
30
+ id " org.jetbrains.kotlin.android" version " 1.6.10" apply false
31
+ }
32
+
33
+ include " :app"
8
34
9
- def flutterSdkPath = properties. getProperty(" flutter.sdk" )
10
- assert flutterSdkPath != null , " flutter.sdk not set in local.properties"
11
- apply from : " $flutterSdkPath /packages/flutter_tools/gradle/app_plugin_loader.gradle"
You can’t perform that action at this time.
0 commit comments