From 3aa6f80eec4e922add92646a5d5547b6db82cc4b Mon Sep 17 00:00:00 2001 From: Kamil Doległo Date: Wed, 18 Sep 2019 15:10:24 +0200 Subject: Move gradle-integration-tests to new module --- .../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 ++++++ .../testData/androidMultiFlavourApp/build.gradle | 21 ++++++ .../testData/androidMultiFlavourApp/fileTree.txt | 47 +++++++++++++ .../androidMultiFlavourApp/settings.gradle | 3 + 21 files changed, 379 insertions(+) create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/build.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/AndroidManifest.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/kotlin/org/example/kotlin/mixed/free/AdActivity.kt create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/layout/activity_ad.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/values/strings.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/AndroidManifest.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-hdpi/ic_launcher.png create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-mdpi/ic_launcher.png create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-xhdpi/ic_launcher.png create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main2.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main_activity2.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/dimens.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/strings.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/styles.xml create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/build.gradle create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/fileTree.txt create mode 100644 integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/settings.gradle (limited to 'integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp') diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/build.gradle b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/build.gradle new file mode 100644 index 00000000..660257ab --- /dev/null +++ b/integration-tests/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/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/AndroidManifest.xml b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/AndroidManifest.xml new file mode 100644 index 00000000..3ecbcd3a --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/AndroidManifest.xml @@ -0,0 +1,9 @@ + + + + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/kotlin/org/example/kotlin/mixed/free/AdActivity.kt b/integration-tests/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/integration-tests/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/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/layout/activity_ad.xml b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/layout/activity_ad.xml new file mode 100644 index 00000000..e6443d05 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/layout/activity_ad.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/values/strings.xml b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/values/strings.xml new file mode 100644 index 00000000..bbdf2d06 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/free/res/values/strings.xml @@ -0,0 +1,3 @@ + + AdActivity + diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/AndroidManifest.xml b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/AndroidManifest.xml new file mode 100644 index 00000000..b4e1a892 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/AndroidManifest.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/java/org/example/kotlin/mixed/JavaActivity.java b/integration-tests/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/integration-tests/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/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/kotlin/org/example/kotlin/mixed/KotlinActivity.kt b/integration-tests/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/integration-tests/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/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-hdpi/ic_launcher.png b/integration-tests/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/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-hdpi/ic_launcher.png differ diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-mdpi/ic_launcher.png b/integration-tests/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/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-mdpi/ic_launcher.png differ diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-xhdpi/ic_launcher.png b/integration-tests/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/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/drawable-xhdpi/ic_launcher.png differ diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main.xml b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main.xml new file mode 100644 index 00000000..ede57c39 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main2.xml b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main2.xml new file mode 100644 index 00000000..d707536a --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/layout/activity_main2.xml @@ -0,0 +1,24 @@ + + + + + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main.xml b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main.xml new file mode 100644 index 00000000..f3b10b6c --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main.xml @@ -0,0 +1,6 @@ + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main_activity2.xml b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main_activity2.xml new file mode 100644 index 00000000..f3b10b6c --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/menu/main_activity2.xml @@ -0,0 +1,6 @@ + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/dimens.xml b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/dimens.xml new file mode 100644 index 00000000..47c82246 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/dimens.xml @@ -0,0 +1,5 @@ + + + 16dp + 16dp + diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/strings.xml b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/strings.xml new file mode 100644 index 00000000..d8f08bc2 --- /dev/null +++ b/integration-tests/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/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/styles.xml b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/styles.xml new file mode 100644 index 00000000..6ce89c7b --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/app/src/main/res/values/styles.xml @@ -0,0 +1,20 @@ + + + + + + + + + diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/build.gradle b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/build.gradle new file mode 100644 index 00000000..35356b90 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/build.gradle @@ -0,0 +1,21 @@ +buildscript { + repositories { + mavenCentral() + jcenter() + maven { url 'https://maven.google.com' } + maven { url "https://dl.bintray.com/kotlin/kotlin-eap-1.1" } + maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } + } + dependencies { + classpath "com.android.tools.build:gradle:$abt_plugin_version" + } +} + +allprojects { + repositories { + mavenCentral() + jcenter() + maven { url "https://dl.bintray.com/kotlin/kotlin-eap-1.1" } + maven { url "https://dl.bintray.com/kotlin/kotlin-dev" } + } +} diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/fileTree.txt b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/fileTree.txt new file mode 100644 index 00000000..77b563b2 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/fileTree.txt @@ -0,0 +1,47 @@ +/ + all/ + app/ + alltypes/ + index.html + index-outline.html + index.html + org.example.kotlin.mixed/ + -java-activity/ + -init-.html + index.html + on-create-options-menu.html + on-create.html + -kotlin-activity/ + -init-.html + index.html + on-create-options-menu.html + on-create.html + index.html + org.example.kotlin.mixed.free/ + -ad-activity/ + -init-.html + index.html + on-create.html + index.html + package-list + style.css + fullOnly/ + full/ + alltypes/ + index.html + index-outline.html + index.html + org.example.kotlin.mixed/ + -java-activity/ + -init-.html + index.html + on-create-options-menu.html + on-create.html + -kotlin-activity/ + -init-.html + index.html + on-create-options-menu.html + on-create.html + index.html + package-list + style.css diff --git a/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/settings.gradle b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/settings.gradle new file mode 100644 index 00000000..1feb2867 --- /dev/null +++ b/integration-tests/gradle-integration-tests/testData/androidMultiFlavourApp/settings.gradle @@ -0,0 +1,3 @@ +rootProject.name = "androidApp" + +include ':app' \ No newline at end of file -- cgit