-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from Banno/agp-7-beta
Update to AGP 7 and Gradle 7.1
- Loading branch information
Showing
13 changed files
with
206 additions
and
111 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
group=com.banno.gordon | ||
version=1.7.1 | ||
version=1.8.0 |
53 changes: 53 additions & 0 deletions
53
gordon-plugin/src/main/kotlin/com/banno/gordon/AndroidPlugin.kt
This file contains 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 @@ | ||
package com.banno.gordon | ||
|
||
import com.android.build.api.dsl.ApplicationExtension | ||
import com.android.build.api.dsl.CommonExtension | ||
import com.android.build.api.dsl.DynamicFeatureExtension | ||
import com.android.build.api.dsl.LibraryExtension | ||
import com.android.build.api.variant.AndroidComponentsExtension | ||
import com.android.build.api.variant.ApplicationAndroidComponentsExtension | ||
import com.android.build.api.variant.DynamicFeatureAndroidComponentsExtension | ||
import com.android.build.api.variant.LibraryAndroidComponentsExtension | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.getByName | ||
|
||
internal fun Project.androidPlugin(): AndroidPlugin<*, *>? = | ||
when (val androidExtension = extensions.findByName("android")) { | ||
is ApplicationExtension -> AndroidPlugin.App( | ||
androidExtension, | ||
extensions.getByName<ApplicationAndroidComponentsExtension>("androidComponents") | ||
) | ||
is LibraryExtension -> AndroidPlugin.Library( | ||
androidExtension, | ||
extensions.getByName<LibraryAndroidComponentsExtension>("androidComponents") | ||
) | ||
is DynamicFeatureExtension -> AndroidPlugin.DynamicFeature( | ||
androidExtension, | ||
extensions.getByName<DynamicFeatureAndroidComponentsExtension>("androidComponents") | ||
) | ||
else -> null | ||
} | ||
|
||
internal sealed class AndroidPlugin< | ||
out T : CommonExtension<*, *, *, *>, | ||
out U : AndroidComponentsExtension<out T, *, *> | ||
> { | ||
|
||
abstract val androidExtension: T | ||
abstract val componentsExtension: U | ||
|
||
class App( | ||
override val androidExtension: ApplicationExtension, | ||
override val componentsExtension: ApplicationAndroidComponentsExtension | ||
) : AndroidPlugin<ApplicationExtension, ApplicationAndroidComponentsExtension>() | ||
|
||
class Library( | ||
override val androidExtension: LibraryExtension, | ||
override val componentsExtension: LibraryAndroidComponentsExtension | ||
) : AndroidPlugin<LibraryExtension, LibraryAndroidComponentsExtension>() | ||
|
||
class DynamicFeature( | ||
override val androidExtension: DynamicFeatureExtension, | ||
override val componentsExtension: DynamicFeatureAndroidComponentsExtension | ||
) : AndroidPlugin<DynamicFeatureExtension, DynamicFeatureAndroidComponentsExtension>() | ||
} |
18 changes: 0 additions & 18 deletions
18
gordon-plugin/src/main/kotlin/com/banno/gordon/AndroidPluginType.kt
This file was deleted.
Oops, something went wrong.
This file contains 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 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 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 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
Oops, something went wrong.