-
Notifications
You must be signed in to change notification settings - Fork 67
Add possibility to check flavoured android modules #143
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Open
sebastienrouif
wants to merge
1
commit into
Kotlin:master
Choose a base branch
from
sebastienrouif:task/flavouredAndroidChecks
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
src/functionalTest/resources/examples/classes/FlavourGreen.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Copyright 2016-2022 JetBrains s.r.o. | ||
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
*/ | ||
|
||
package examples.classes | ||
|
||
class FlavourGreen { | ||
|
||
fun foo(): String = "foo" | ||
internal fun bar(): String = "bar" | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
src/functionalTest/resources/examples/classes/FlavourRed.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Copyright 2016-2022 JetBrains s.r.o. | ||
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
*/ | ||
|
||
package examples.classes | ||
|
||
class FlavourRed { | ||
|
||
fun foo(): String = "foo" | ||
internal fun bar(): String = "bar" | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
src/functionalTest/resources/examples/classes/KotlinFlavour.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
* Copyright 2016-2022 JetBrains s.r.o. | ||
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
*/ | ||
|
||
package examples.classes | ||
|
||
class KotlinFlavour { | ||
|
||
fun foo(): String = "foo" | ||
internal fun bar(): String = "bar" | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
src/functionalTest/resources/examples/classes/KotlinFlavouredLib.dump
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
public final class examples/classes/FlavourGreen { | ||
public fun <init> ()V | ||
public final fun foo ()Ljava/lang/String; | ||
} | ||
|
||
public final class examples/classes/KotlinFlavour { | ||
public fun <init> ()V | ||
public final fun foo ()Ljava/lang/String; | ||
} | ||
|
||
public final class examples/classes/KotlinLib { | ||
public fun <init> ()V | ||
public final fun foo ()Ljava/lang/String; | ||
} | ||
|
||
public final class org/jetbrains/kotlinx/android/kotlin/library/BuildConfig { | ||
public static final field BUILD_TYPE Ljava/lang/String; | ||
public static final field DEBUG Z | ||
public static final field FLAVOR Ljava/lang/String; | ||
public static final field LIBRARY_PACKAGE_NAME Ljava/lang/String; | ||
public fun <init> ()V | ||
} | ||
|
53 changes: 53 additions & 0 deletions
53
src/functionalTest/resources/examples/gradle/base/androidFlavouredKotlinLibrary.gradle.kts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Copyright 2016-2022 JetBrains s.r.o. | ||
* Use of this source code is governed by the Apache 2.0 License that can be found in the LICENSE.txt file. | ||
*/ | ||
import org.jetbrains.kotlin.gradle.plugin.* | ||
plugins { | ||
id("com.android.library") | ||
id("kotlin-android") | ||
id("org.jetbrains.kotlinx.binary-compatibility-validator") | ||
} | ||
|
||
android { | ||
|
||
namespace = "org.jetbrains.kotlinx.android.kotlin.library" | ||
|
||
compileSdk = 32 | ||
|
||
defaultConfig { | ||
minSdk = 31 | ||
targetSdk = 32 | ||
|
||
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" | ||
consumerProguardFiles("consumer-rules.pro") | ||
} | ||
|
||
buildTypes { | ||
release { | ||
isMinifyEnabled = true | ||
proguardFiles( | ||
getDefaultProguardFile("proguard-android-optimize.txt"), | ||
"proguard-rules.pro" | ||
) | ||
} | ||
} | ||
|
||
flavorDimensions += "brand" | ||
productFlavors { | ||
create("green") { | ||
dimension = "brand" | ||
} | ||
create("red") { | ||
dimension = "brand" | ||
} | ||
} | ||
} | ||
|
||
apiValidation { | ||
testedFlavourName = "green" | ||
additionalSourceSets.add("green") | ||
} | ||
dependencies { | ||
// no dependencies required | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,4 +64,10 @@ open class ApiValidationExtension { | |
* By default, only the `main` source set is checked. | ||
*/ | ||
public var additionalSourceSets: MutableSet<String> = HashSet() | ||
|
||
/** | ||
* In Android projects with multiple flavour, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. typo: |
||
* it specifies the flavour you want to test (assuming projects have same API) | ||
*/ | ||
public var testedFlavourName: String? = null | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: Should it follow the same rules as in other changed files for explicit imports? Or vice versa?