diff --git a/README.md b/README.md index 880ca617..f17a51c3 100644 --- a/README.md +++ b/README.md @@ -165,6 +165,8 @@ While developing, you can build, run pre-commits, checks & tests on the plugin u Make sure your tests are all green ✅ locally before submitting PRs. +NOTE: If you don't have the [Android SDK](https://developer.android.com/studio/releases/sdk-tools) you can skip the Android related tasks by setting `SKIP_ANDROID` enviromental variable (tests will be run on the CI anyway). + ## Contributing/Support Support for this project is offered in the [#swagger-gradle-codegen](https://kotlinlang.slack.com/archives/CU233PG2Z) channel on the Kotlinlang slack ([request an invite here](http://slack.kotlinlang.org/)). diff --git a/samples/junit-tests/build.gradle b/samples/junit-tests/build.gradle index ffb409e7..ebcf3933 100644 --- a/samples/junit-tests/build.gradle +++ b/samples/junit-tests/build.gradle @@ -1,21 +1,10 @@ plugins { - id("com.android.library") - id("kotlin-android") + id("kotlin") id("com.yelp.codegen.plugin") id("io.gitlab.arturbosch.detekt") id("kotlin-kapt") } -android { - compileSdkVersion = 28 - defaultConfig { - minSdkVersion 21 - targetSdkVersion 28 - versionCode = 1 - versionName = "1.0" - } -} - dependencies { // Kotlin implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.70" diff --git a/samples/junit-tests/src/main/AndroidManifest.xml b/samples/junit-tests/src/main/AndroidManifest.xml deleted file mode 100644 index 574a3c27..00000000 --- a/samples/junit-tests/src/main/AndroidManifest.xml +++ /dev/null @@ -1,2 +0,0 @@ - diff --git a/settings.gradle.kts b/settings.gradle.kts index 288c62dd..b345b8f6 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -17,10 +17,27 @@ pluginManagement { } } -include( - ":samples:junit-tests", +include(":samples:junit-tests") + +if (shouldIncludeAndroidProjects()) { + include( ":samples:kotlin-android", ":samples:kotlin-coroutines", - ":samples:groovy-android") + ":samples:groovy-android" + ) +} includeBuild("gradle-plugin") + +fun shouldIncludeAndroidProjects(): Boolean { + if (System.getenv("CI") != null) { + // Ensure that on CI systems we run all the gradle tasks (including the Android specific ones) + return true; + } + + if (System.getenv("SKIP_ANDROID") != null) { + return false; + } + + return true; +}