From 4417ab37e0e16663bde81efd5207c0e1929b881a Mon Sep 17 00:00:00 2001 From: Kamil Doległo Date: Fri, 17 Jan 2020 15:01:18 +0100 Subject: Move the Gradle integration tests back to `:runners` --- .../androidMultiFlavourApp/app/build.gradle | 75 +++++++++++++++++++++ .../app/src/free/AndroidManifest.xml | 9 +++ .../org/example/kotlin/mixed/free/AdActivity.kt | 14 ++++ .../app/src/free/res/layout/activity_ad.xml | 24 +++++++ .../app/src/free/res/values/strings.xml | 3 + .../app/src/main/AndroidManifest.xml | 26 +++++++ .../org/example/kotlin/mixed/JavaActivity.java | 34 ++++++++++ .../org/example/kotlin/mixed/KotlinActivity.kt | 28 ++++++++ .../app/src/main/res/drawable-hdpi/ic_launcher.png | Bin 0 -> 9397 bytes .../app/src/main/res/drawable-mdpi/ic_launcher.png | Bin 0 -> 5237 bytes .../src/main/res/drawable-xhdpi/ic_launcher.png | Bin 0 -> 14383 bytes .../app/src/main/res/layout/activity_main.xml | 24 +++++++ .../app/src/main/res/layout/activity_main2.xml | 24 +++++++ .../app/src/main/res/menu/main.xml | 6 ++ .../app/src/main/res/menu/main_activity2.xml | 6 ++ .../app/src/main/res/values/dimens.xml | 5 ++ .../app/src/main/res/values/strings.xml | 10 +++ .../app/src/main/res/values/styles.xml | 20 ++++++ 18 files changed, 308 insertions(+) create mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/build.gradle create mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/AndroidManifest.xml create mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/kotlin/org/example/kotlin/mixed/free/AdActivity.kt create mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/layout/activity_ad.xml create mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/values/strings.xml create mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/AndroidManifest.xml create mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java create mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt create mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-hdpi/ic_launcher.png create mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-mdpi/ic_launcher.png create mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-xhdpi/ic_launcher.png create mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main.xml create mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main2.xml create mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main.xml create mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main_activity2.xml create mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/dimens.xml create mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/strings.xml create mode 100644 runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/styles.xml (limited to 'runners/gradle-integration-tests/testData/androidMultiFlavourApp/app') diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/build.gradle b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/build.gradle new file mode 100644 index 00000000..660257ab --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/build.gradle @@ -0,0 +1,75 @@ +buildscript { + repositories { + jcenter() + mavenLocal() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$test_kotlin_version" + } +} + +plugins { + id 'org.jetbrains.dokka' +} + + +apply plugin: 'com.android.application' +apply plugin: 'kotlin-android' +apply plugin: 'kotlin-android-extensions' + +android { + compileSdkVersion Integer.parseInt(sdk_version) + buildToolsVersion abt_version + + defaultConfig { + applicationId "org.example.kotlin.mixed" + minSdkVersion 14 + targetSdkVersion Integer.parseInt(sdk_version) + versionCode 1 + versionName "1.0" + } + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android.txt') + } + } + + flavorDimensions "mode" + productFlavors { + free { + dimension "mode" + applicationIdSuffix ".free" + versionNameSuffix "-free" + } + full { + dimension "mode" + applicationIdSuffix ".full" + versionNameSuffix "-full" + } + } + sourceSets { + main.java.srcDirs += 'src/main/kotlin' + free.java.srcDirs += 'src/free/kotlin' + } +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib:$test_kotlin_version" + dokkaRuntime files(dokka_fatjar) +} + + +dokka { + outputDirectory = "$buildDir/dokka/all" +} + +task dokkaFullFlavourOnly(type: org.jetbrains.dokka.gradle.DokkaTask) { + outputDirectory = "$buildDir/dokka/fullOnly" + configuration { + moduleName = "full" + kotlinTasks { + ["compileFullReleaseKotlin"] + } + } +} \ No newline at end of file diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/AndroidManifest.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/AndroidManifest.xml new file mode 100644 index 00000000..3ecbcd3a --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/AndroidManifest.xml @@ -0,0 +1,9 @@ + + + + + + diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/kotlin/org/example/kotlin/mixed/free/AdActivity.kt b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/kotlin/org/example/kotlin/mixed/free/AdActivity.kt new file mode 100644 index 00000000..b0b980fd --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/kotlin/org/example/kotlin/mixed/free/AdActivity.kt @@ -0,0 +1,14 @@ +package org.example.kotlin.mixed.free + +import android.os.Bundle +import android.app.Activity +import org.example.kotlin.mixed.R + +class AdActivity : Activity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_ad) + } + +} diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/layout/activity_ad.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/layout/activity_ad.xml new file mode 100644 index 00000000..e6443d05 --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/layout/activity_ad.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/values/strings.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/values/strings.xml new file mode 100644 index 00000000..bbdf2d06 --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/values/strings.xml @@ -0,0 +1,3 @@ + + AdActivity + diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/AndroidManifest.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..b4e1a892 --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java new file mode 100644 index 00000000..3668c594 --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java @@ -0,0 +1,34 @@ +package org.example.kotlin.mixed; + +import android.content.Intent; +import android.os.Bundle; +import android.app.Activity; +import android.view.Menu; +import android.view.View; +import android.widget.Button; + +public class JavaActivity extends Activity { + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + Button next = (Button) findViewById(R.id.Button01); + next.setOnClickListener(new View.OnClickListener() { + public void onClick(View view) { + Intent myIntent = new Intent(view.getContext(), KotlinActivity.class); + startActivityForResult(myIntent, 0); + } + }); + } + + + @Override + public boolean onCreateOptionsMenu(Menu menu) { + // Inflate the menu; this adds items to the action bar if it is present. + getMenuInflater().inflate(R.menu.main, menu); + return true; + } + +} diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt new file mode 100644 index 00000000..ca2f27b0 --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt @@ -0,0 +1,28 @@ +package org.example.kotlin.mixed + +import android.content.Intent +import android.os.Bundle +import android.app.Activity +import android.view.Menu +import android.widget.Button + +class KotlinActivity : Activity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContentView(R.layout.activity_main2) + + val next = findViewById(R.id.Button02) as Button + next.setOnClickListener { + val intent: Intent = Intent() + setResult(RESULT_OK, intent) + finish() + } + } + + override fun onCreateOptionsMenu(menu: Menu?): Boolean { + // Inflate the menu; this adds items to the action bar if it is present. + menuInflater.inflate(R.menu.main_activity2, menu) + return true + } +} diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-hdpi/ic_launcher.png b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-hdpi/ic_launcher.png new file mode 100644 index 00000000..96a442e5 Binary files /dev/null and b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-hdpi/ic_launcher.png differ diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-mdpi/ic_launcher.png b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-mdpi/ic_launcher.png new file mode 100644 index 00000000..359047df Binary files /dev/null and b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-mdpi/ic_launcher.png differ diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-xhdpi/ic_launcher.png b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-xhdpi/ic_launcher.png new file mode 100644 index 00000000..71c6d760 Binary files /dev/null and b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-xhdpi/ic_launcher.png differ diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main.xml new file mode 100644 index 00000000..ede57c39 --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main2.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main2.xml new file mode 100644 index 00000000..d707536a --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main2.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main.xml new file mode 100644 index 00000000..f3b10b6c --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main.xml @@ -0,0 +1,6 @@ + + + diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main_activity2.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main_activity2.xml new file mode 100644 index 00000000..f3b10b6c --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main_activity2.xml @@ -0,0 +1,6 @@ + + + diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/dimens.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/dimens.xml new file mode 100644 index 00000000..47c82246 --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/dimens.xml @@ -0,0 +1,5 @@ + + + 16dp + 16dp + diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/strings.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/strings.xml new file mode 100644 index 00000000..d8f08bc2 --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/strings.xml @@ -0,0 +1,10 @@ + + + + AndroidSample + Settings + Hello world! + JavaActivity + KotlinActivity + + diff --git a/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/styles.xml b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..6ce89c7b --- /dev/null +++ b/runners/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/styles.xml @@ -0,0 +1,20 @@ + + + + + + + + + -- cgit