Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Auto-Manifest plugin #260

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ buildscript {

plugins {
id("com.osacky.doctor")
id("com.gradleup.auto.manifest") apply false
tasomaniac marked this conversation as resolved.
Show resolved Hide resolved
}

// Top-level build file where you can add configuration options common to all sub-projects/modules.
Expand Down
9 changes: 5 additions & 4 deletions buildSrc/src/main/kotlin/config/AndroidLibraryConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

@file:Suppress("PackageDirectoryMismatch")

import org.gradle.api.Project
import com.android.build.gradle.LibraryExtension as AndroidLibraryExtension

fun AndroidLibraryExtension.setDefaults(generateBuildConfig: Boolean = false) {
fun AndroidLibraryExtension.setDefaults(project: Project, generateBuildConfig: Boolean = false) {
compileSdkVersion(ProjectVersions.androidSdk)
buildToolsVersion(ProjectVersions.androidBuildTools)
defaultConfig {
Expand All @@ -24,15 +25,15 @@ fun AndroidLibraryExtension.setDefaults(generateBuildConfig: Boolean = false) {
this.buildConfig = generateBuildConfig
}
sourceSets.getByName("main") {
manifest.srcFile("src/androidMain/AndroidManifest.xml")
if (project.file("src/androidMain/AndroidManifest.xml").exists()) {
manifest.srcFile("src/androidMain/AndroidManifest.xml")
}
tasomaniac marked this conversation as resolved.
Show resolved Hide resolved
res.srcDir("src/androidMain/res")
}
sourceSets.getByName("debug") {
manifest.srcFile("src/androidDebug/AndroidManifest.xml")
res.srcDir("src/androidDebug/res")
}
sourceSets.getByName("release") {
manifest.srcFile("src/androidRelease/AndroidManifest.xml")
tasomaniac marked this conversation as resolved.
Show resolved Hide resolved
res.srcDir("src/androidRelease/res")
}
sourceSets.getByName("androidTest") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
tasomaniac marked this conversation as resolved.
Show resolved Hide resolved
}

kotlin {
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion fun-packs/android-appcompat/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
}

kotlin {
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion fun-packs/android-base-with-views-dsl/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
}

kotlin {
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion fun-packs/android-base/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
}

kotlin {
Expand Down
4 changes: 0 additions & 4 deletions fun-packs/android-base/src/androidMain/AndroidManifest.xml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
}

kotlin {
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion fun-packs/android-material-components/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
}

kotlin {
Expand Down

This file was deleted.

12 changes: 12 additions & 0 deletions fun-packs/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright 2020 Louis Cognault Ayeva Derman. Use of this source code is governed by the Apache 2.0 license.
*/

plugins {
id("com.gradleup.auto.manifest")
}

autoManifest {
packageName.set("splitties.fun.pack")
replaceDashesWithDot.set(true)
}
2 changes: 1 addition & 1 deletion modules/activities/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
}

kotlin {
Expand Down
4 changes: 0 additions & 4 deletions modules/activities/src/androidMain/AndroidManifest.xml

This file was deleted.

2 changes: 1 addition & 1 deletion modules/alertdialog-appcompat-coroutines/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
}

kotlin {
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion modules/alertdialog-appcompat/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
}

kotlin {
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion modules/alertdialog-material/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
}

kotlin {
Expand Down

This file was deleted.

2 changes: 1 addition & 1 deletion modules/alertdialog/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
}

kotlin {
Expand Down
6 changes: 0 additions & 6 deletions modules/alertdialog/src/androidMain/AndroidManifest.xml

This file was deleted.

2 changes: 1 addition & 1 deletion modules/appctx/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
}

kotlin {
Expand Down
2 changes: 1 addition & 1 deletion modules/arch-lifecycle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
}

kotlin {
Expand Down
5 changes: 0 additions & 5 deletions modules/arch-lifecycle/src/androidMain/AndroidManifest.xml

This file was deleted.

2 changes: 1 addition & 1 deletion modules/arch-room/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
}

kotlin {
Expand Down
5 changes: 0 additions & 5 deletions modules/arch-room/src/androidMain/AndroidManifest.xml

This file was deleted.

12 changes: 12 additions & 0 deletions modules/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
* Copyright 2020 Louis Cognault Ayeva Derman. Use of this source code is governed by the Apache 2.0 license.
*/

plugins {
id("com.gradleup.auto.manifest")
}

autoManifest {
packageName.set("splitties")
replaceDashesWithDot.set(true)
}
2 changes: 1 addition & 1 deletion modules/bundle/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
}

kotlin {
Expand Down
5 changes: 0 additions & 5 deletions modules/bundle/src/androidMain/AndroidManifest.xml

This file was deleted.

2 changes: 1 addition & 1 deletion modules/checkedlazy/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
}

kotlin {
Expand Down
9 changes: 0 additions & 9 deletions modules/checkedlazy/src/androidMain/AndroidManifest.xml

This file was deleted.

2 changes: 1 addition & 1 deletion modules/dimensions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
}

kotlin {
Expand Down
6 changes: 0 additions & 6 deletions modules/dimensions/src/androidMain/AndroidManifest.xml

This file was deleted.

2 changes: 1 addition & 1 deletion modules/exceptions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
}

kotlin {
Expand Down
5 changes: 0 additions & 5 deletions modules/exceptions/src/androidMain/AndroidManifest.xml

This file was deleted.

2 changes: 1 addition & 1 deletion modules/fragmentargs/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
}

kotlin {
Expand Down
5 changes: 0 additions & 5 deletions modules/fragmentargs/src/androidMain/AndroidManifest.xml

This file was deleted.

2 changes: 1 addition & 1 deletion modules/fragments/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
}

kotlin {
Expand Down
4 changes: 0 additions & 4 deletions modules/fragments/src/androidMain/AndroidManifest.xml

This file was deleted.

2 changes: 1 addition & 1 deletion modules/initprovider/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
}

kotlin {
Expand Down
5 changes: 0 additions & 5 deletions modules/initprovider/src/androidMain/AndroidManifest.xml

This file was deleted.

2 changes: 1 addition & 1 deletion modules/intents/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
buildTypes.getByName("release").consumerProguardFiles("proguard-rules.pro")
}

Expand Down
4 changes: 0 additions & 4 deletions modules/intents/src/androidMain/AndroidManifest.xml

This file was deleted.

2 changes: 1 addition & 1 deletion modules/lifecycle-coroutines/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

android {
setDefaults()
setDefaults(project)
}

kotlin {
Expand Down
Loading