File tree Expand file tree Collapse file tree 3 files changed +30
-31
lines changed Expand file tree Collapse file tree 3 files changed +30
-31
lines changed Original file line number Diff line number Diff line change
1
+ plugins {
2
+ id " com.android.application"
3
+ id " kotlin-android"
4
+ id " kotlin-kapt"
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,11 +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 plugin : ' kotlin-kapt'
27
- apply from : " $flutterRoot /packages/flutter_tools/gradle/flutter.gradle"
28
-
29
26
android {
30
27
namespace " com.fluttercandies.wechatCameraPickerExample"
31
28
Original file line number Diff line number Diff line change 1
- buildscript {
2
- ext. kotlin_version = ' 1.9.20'
3
- repositories {
4
- google()
5
- mavenCentral()
6
- }
7
-
8
- dependencies {
9
- classpath ' com.android.tools.build:gradle:8.2.2'
10
- classpath " org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version "
11
- }
12
- }
13
-
14
1
allprojects {
15
2
repositories {
16
3
google()
Original file line number Diff line number Diff line change 2
2
// Use of this source code is governed by a BSD-style license that can be
3
3
// found in the LICENSE file.
4
4
5
- include ' :app'
5
+ pluginManagement {
6
+ def flutterSdkPath = {
7
+ def properties = new Properties ()
8
+ file(" local.properties" ). withInputStream { properties. load(it) }
9
+ def flutterSdkPath = properties. getProperty(" flutter.sdk" )
10
+ assert flutterSdkPath != null , " flutter.sdk not set in local.properties"
11
+ return flutterSdkPath
12
+ }
13
+ settings. ext. flutterSdkPath = flutterSdkPath()
6
14
7
- def localPropertiesFile = new File (rootProject. projectDir, " local.properties" )
8
- def properties = new Properties ()
15
+ includeBuild(" ${ settings.ext.flutterSdkPath} /packages/flutter_tools/gradle" )
9
16
10
- assert localPropertiesFile. exists()
11
- localPropertiesFile. withReader(" UTF-8" ) { reader -> properties. load(reader) }
17
+ repositories {
18
+ google()
19
+ mavenCentral()
20
+ gradlePluginPortal()
21
+ }
22
+ }
12
23
13
- def flutterSdkPath = properties. getProperty(" flutter.sdk" )
14
- assert flutterSdkPath != null , " flutter.sdk not set in local.properties"
15
- apply from : " $flutterSdkPath /packages/flutter_tools/gradle/app_plugin_loader.gradle"
24
+ plugins {
25
+ id " dev.flutter.flutter-plugin-loader" version " 1.0.0"
26
+ id " com.android.application" version " 8.2.2" apply false
27
+ id " org.jetbrains.kotlin.android" version " 1.9.20" apply false
28
+ }
29
+
30
+ include " :app"
You can’t perform that action at this time.
0 commit comments