From 03f053a7384538dd2292813e164c8e631db60156 Mon Sep 17 00:00:00 2001 From: Jakob Andersen Date: Mon, 20 Mar 2017 16:15:02 +0100 Subject: [PATCH] Update complex_layout and microbenchmarks to Gradle build. (#8890) --- .../complex_layout/android/.gitignore | 12 +++++ .../complex_layout/android/app/build.gradle | 46 ++++++++++++++++++ .../{ => app/src/main}/AndroidManifest.xml | 0 .../src/main}/res/mipmap-hdpi/ic_launcher.png | Bin .../src/main}/res/mipmap-mdpi/ic_launcher.png | Bin .../main}/res/mipmap-xhdpi/ic_launcher.png | Bin .../main}/res/mipmap-xxhdpi/ic_launcher.png | Bin .../main}/res/mipmap-xxxhdpi/ic_launcher.png | Bin .../complex_layout/android/build.gradle | 28 +++++++++++ .../complex_layout/android/gradle.properties | 1 + .../complex_layout/android/settings.gradle | 1 + .../microbenchmarks/android/.gitignore | 12 +++++ .../microbenchmarks/android/app/build.gradle | 46 ++++++++++++++++++ .../{ => app/src/main}/AndroidManifest.xml | 0 .../src/main}/res/mipmap-hdpi/ic_launcher.png | Bin .../src/main}/res/mipmap-mdpi/ic_launcher.png | Bin .../main}/res/mipmap-xhdpi/ic_launcher.png | Bin .../main}/res/mipmap-xxhdpi/ic_launcher.png | Bin .../main}/res/mipmap-xxxhdpi/ic_launcher.png | Bin .../microbenchmarks/android/build.gradle | 28 +++++++++++ .../microbenchmarks/android/gradle.properties | 1 + .../microbenchmarks/android/settings.gradle | 1 + 22 files changed, 176 insertions(+) create mode 100644 dev/benchmarks/complex_layout/android/.gitignore create mode 100644 dev/benchmarks/complex_layout/android/app/build.gradle rename dev/benchmarks/complex_layout/android/{ => app/src/main}/AndroidManifest.xml (100%) rename dev/benchmarks/complex_layout/android/{ => app/src/main}/res/mipmap-hdpi/ic_launcher.png (100%) rename dev/benchmarks/complex_layout/android/{ => app/src/main}/res/mipmap-mdpi/ic_launcher.png (100%) rename dev/benchmarks/complex_layout/android/{ => app/src/main}/res/mipmap-xhdpi/ic_launcher.png (100%) rename dev/benchmarks/complex_layout/android/{ => app/src/main}/res/mipmap-xxhdpi/ic_launcher.png (100%) rename dev/benchmarks/complex_layout/android/{ => app/src/main}/res/mipmap-xxxhdpi/ic_launcher.png (100%) create mode 100644 dev/benchmarks/complex_layout/android/build.gradle create mode 100644 dev/benchmarks/complex_layout/android/gradle.properties create mode 100644 dev/benchmarks/complex_layout/android/settings.gradle create mode 100644 dev/benchmarks/microbenchmarks/android/.gitignore create mode 100644 dev/benchmarks/microbenchmarks/android/app/build.gradle rename dev/benchmarks/microbenchmarks/android/{ => app/src/main}/AndroidManifest.xml (100%) rename dev/benchmarks/microbenchmarks/android/{ => app/src/main}/res/mipmap-hdpi/ic_launcher.png (100%) rename dev/benchmarks/microbenchmarks/android/{ => app/src/main}/res/mipmap-mdpi/ic_launcher.png (100%) rename dev/benchmarks/microbenchmarks/android/{ => app/src/main}/res/mipmap-xhdpi/ic_launcher.png (100%) rename dev/benchmarks/microbenchmarks/android/{ => app/src/main}/res/mipmap-xxhdpi/ic_launcher.png (100%) rename dev/benchmarks/microbenchmarks/android/{ => app/src/main}/res/mipmap-xxxhdpi/ic_launcher.png (100%) create mode 100644 dev/benchmarks/microbenchmarks/android/build.gradle create mode 100644 dev/benchmarks/microbenchmarks/android/gradle.properties create mode 100644 dev/benchmarks/microbenchmarks/android/settings.gradle diff --git a/dev/benchmarks/complex_layout/android/.gitignore b/dev/benchmarks/complex_layout/android/.gitignore new file mode 100644 index 0000000000..5c4ef82869 --- /dev/null +++ b/dev/benchmarks/complex_layout/android/.gitignore @@ -0,0 +1,12 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures + +/gradle +/gradlew +/gradlew.bat diff --git a/dev/benchmarks/complex_layout/android/app/build.gradle b/dev/benchmarks/complex_layout/android/app/build.gradle new file mode 100644 index 0000000000..4e2e46b56c --- /dev/null +++ b/dev/benchmarks/complex_layout/android/app/build.gradle @@ -0,0 +1,46 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withInputStream { stream -> + localProperties.load(stream) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +apply plugin: 'com.android.application' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + + lintOptions { + disable 'InvalidPackage' + } + + defaultConfig { + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies { + androidTestCompile 'com.android.support:support-annotations:25.0.0' + androidTestCompile 'com.android.support.test:runner:0.5' + androidTestCompile 'com.android.support.test:rules:0.5' +} diff --git a/dev/benchmarks/complex_layout/android/AndroidManifest.xml b/dev/benchmarks/complex_layout/android/app/src/main/AndroidManifest.xml similarity index 100% rename from dev/benchmarks/complex_layout/android/AndroidManifest.xml rename to dev/benchmarks/complex_layout/android/app/src/main/AndroidManifest.xml diff --git a/dev/benchmarks/complex_layout/android/res/mipmap-hdpi/ic_launcher.png b/dev/benchmarks/complex_layout/android/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from dev/benchmarks/complex_layout/android/res/mipmap-hdpi/ic_launcher.png rename to dev/benchmarks/complex_layout/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/dev/benchmarks/complex_layout/android/res/mipmap-mdpi/ic_launcher.png b/dev/benchmarks/complex_layout/android/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from dev/benchmarks/complex_layout/android/res/mipmap-mdpi/ic_launcher.png rename to dev/benchmarks/complex_layout/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/dev/benchmarks/complex_layout/android/res/mipmap-xhdpi/ic_launcher.png b/dev/benchmarks/complex_layout/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from dev/benchmarks/complex_layout/android/res/mipmap-xhdpi/ic_launcher.png rename to dev/benchmarks/complex_layout/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/dev/benchmarks/complex_layout/android/res/mipmap-xxhdpi/ic_launcher.png b/dev/benchmarks/complex_layout/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from dev/benchmarks/complex_layout/android/res/mipmap-xxhdpi/ic_launcher.png rename to dev/benchmarks/complex_layout/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/dev/benchmarks/complex_layout/android/res/mipmap-xxxhdpi/ic_launcher.png b/dev/benchmarks/complex_layout/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from dev/benchmarks/complex_layout/android/res/mipmap-xxxhdpi/ic_launcher.png rename to dev/benchmarks/complex_layout/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/dev/benchmarks/complex_layout/android/build.gradle b/dev/benchmarks/complex_layout/android/build.gradle new file mode 100644 index 0000000000..3053745fdc --- /dev/null +++ b/dev/benchmarks/complex_layout/android/build.gradle @@ -0,0 +1,28 @@ +buildscript { + repositories { + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:2.2.3' + } +} + +allprojects { + repositories { + jcenter() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} + +task clean(type: Delete) { + delete rootProject.buildDir +} + +task wrapper(type: Wrapper) { + gradleVersion = '2.14.1' +} diff --git a/dev/benchmarks/complex_layout/android/gradle.properties b/dev/benchmarks/complex_layout/android/gradle.properties new file mode 100644 index 0000000000..8bd86f6805 --- /dev/null +++ b/dev/benchmarks/complex_layout/android/gradle.properties @@ -0,0 +1 @@ +org.gradle.jvmargs=-Xmx1536M diff --git a/dev/benchmarks/complex_layout/android/settings.gradle b/dev/benchmarks/complex_layout/android/settings.gradle new file mode 100644 index 0000000000..e7b4def49c --- /dev/null +++ b/dev/benchmarks/complex_layout/android/settings.gradle @@ -0,0 +1 @@ +include ':app' diff --git a/dev/benchmarks/microbenchmarks/android/.gitignore b/dev/benchmarks/microbenchmarks/android/.gitignore new file mode 100644 index 0000000000..5c4ef82869 --- /dev/null +++ b/dev/benchmarks/microbenchmarks/android/.gitignore @@ -0,0 +1,12 @@ +*.iml +.gradle +/local.properties +/.idea/workspace.xml +/.idea/libraries +.DS_Store +/build +/captures + +/gradle +/gradlew +/gradlew.bat diff --git a/dev/benchmarks/microbenchmarks/android/app/build.gradle b/dev/benchmarks/microbenchmarks/android/app/build.gradle new file mode 100644 index 0000000000..4e2e46b56c --- /dev/null +++ b/dev/benchmarks/microbenchmarks/android/app/build.gradle @@ -0,0 +1,46 @@ +def localProperties = new Properties() +def localPropertiesFile = rootProject.file('local.properties') +if (localPropertiesFile.exists()) { + localPropertiesFile.withInputStream { stream -> + localProperties.load(stream) + } +} + +def flutterRoot = localProperties.getProperty('flutter.sdk') +if (flutterRoot == null) { + throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") +} + +apply plugin: 'com.android.application' +apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" + +android { + compileSdkVersion 25 + buildToolsVersion '25.0.2' + + lintOptions { + disable 'InvalidPackage' + } + + defaultConfig { + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + } + + buildTypes { + release { + // TODO: Add your own signing config for the release build. + // Signing with the debug keys for now, so `flutter run --release` works. + signingConfig signingConfigs.debug + } + } +} + +flutter { + source '../..' +} + +dependencies { + androidTestCompile 'com.android.support:support-annotations:25.0.0' + androidTestCompile 'com.android.support.test:runner:0.5' + androidTestCompile 'com.android.support.test:rules:0.5' +} diff --git a/dev/benchmarks/microbenchmarks/android/AndroidManifest.xml b/dev/benchmarks/microbenchmarks/android/app/src/main/AndroidManifest.xml similarity index 100% rename from dev/benchmarks/microbenchmarks/android/AndroidManifest.xml rename to dev/benchmarks/microbenchmarks/android/app/src/main/AndroidManifest.xml diff --git a/dev/benchmarks/microbenchmarks/android/res/mipmap-hdpi/ic_launcher.png b/dev/benchmarks/microbenchmarks/android/app/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from dev/benchmarks/microbenchmarks/android/res/mipmap-hdpi/ic_launcher.png rename to dev/benchmarks/microbenchmarks/android/app/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/dev/benchmarks/microbenchmarks/android/res/mipmap-mdpi/ic_launcher.png b/dev/benchmarks/microbenchmarks/android/app/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from dev/benchmarks/microbenchmarks/android/res/mipmap-mdpi/ic_launcher.png rename to dev/benchmarks/microbenchmarks/android/app/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/dev/benchmarks/microbenchmarks/android/res/mipmap-xhdpi/ic_launcher.png b/dev/benchmarks/microbenchmarks/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from dev/benchmarks/microbenchmarks/android/res/mipmap-xhdpi/ic_launcher.png rename to dev/benchmarks/microbenchmarks/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/dev/benchmarks/microbenchmarks/android/res/mipmap-xxhdpi/ic_launcher.png b/dev/benchmarks/microbenchmarks/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from dev/benchmarks/microbenchmarks/android/res/mipmap-xxhdpi/ic_launcher.png rename to dev/benchmarks/microbenchmarks/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/dev/benchmarks/microbenchmarks/android/res/mipmap-xxxhdpi/ic_launcher.png b/dev/benchmarks/microbenchmarks/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from dev/benchmarks/microbenchmarks/android/res/mipmap-xxxhdpi/ic_launcher.png rename to dev/benchmarks/microbenchmarks/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/dev/benchmarks/microbenchmarks/android/build.gradle b/dev/benchmarks/microbenchmarks/android/build.gradle new file mode 100644 index 0000000000..3053745fdc --- /dev/null +++ b/dev/benchmarks/microbenchmarks/android/build.gradle @@ -0,0 +1,28 @@ +buildscript { + repositories { + jcenter() + } + + dependencies { + classpath 'com.android.tools.build:gradle:2.2.3' + } +} + +allprojects { + repositories { + jcenter() + } +} + +rootProject.buildDir = '../build' +subprojects { + project.buildDir = "${rootProject.buildDir}/${project.name}" +} + +task clean(type: Delete) { + delete rootProject.buildDir +} + +task wrapper(type: Wrapper) { + gradleVersion = '2.14.1' +} diff --git a/dev/benchmarks/microbenchmarks/android/gradle.properties b/dev/benchmarks/microbenchmarks/android/gradle.properties new file mode 100644 index 0000000000..8bd86f6805 --- /dev/null +++ b/dev/benchmarks/microbenchmarks/android/gradle.properties @@ -0,0 +1 @@ +org.gradle.jvmargs=-Xmx1536M diff --git a/dev/benchmarks/microbenchmarks/android/settings.gradle b/dev/benchmarks/microbenchmarks/android/settings.gradle new file mode 100644 index 0000000000..e7b4def49c --- /dev/null +++ b/dev/benchmarks/microbenchmarks/android/settings.gradle @@ -0,0 +1 @@ +include ':app'