Skip to content

Commit

Permalink
build: disable automatic component creation
Browse files Browse the repository at this point in the history
  • Loading branch information
tynn committed May 26, 2022
1 parent 1551817 commit c5c246b
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 20 deletions.
4 changes: 2 additions & 2 deletions android.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
android {
compileSdkVersion 31
compileSdkVersion 32

defaultConfig {
minSdkVersion 19
targetSdkVersion 31
targetSdkVersion 32
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
}
8 changes: 0 additions & 8 deletions bom/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,3 @@ dependencies {
}
}
}

publishing {
publications {
release(MavenPublication) {
from components.javaPlatform
}
}
}
9 changes: 4 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ plugins {
id 'com.android.library' version '7.2.0' apply false
id 'org.jetbrains.kotlin.android' version '1.6.21' apply false
id 'io.github.gradle-nexus.publish-plugin' version '1.1.0'
id 'xyz.tynn.android.maven' version '0.2.1' apply false
id 'com.github.ben-manes.versions' version '0.42.0'
}

Expand All @@ -13,14 +12,14 @@ allprojects {
}

subprojects {
pluginManager.withPlugin('com.android.library') {
apply plugin: 'org.jetbrains.kotlin.android'
pluginManager.withPlugin('com.android.application') {
apply from: "$rootDir/android.gradle"
apply from: "$rootDir/library.gradle"
}

pluginManager.withPlugin('com.android.application') {
pluginManager.withPlugin('com.android.library') {
apply plugin: 'org.jetbrains.kotlin.android'
apply from: "$rootDir/android.gradle"
apply from: "$rootDir/library.gradle"
}

pluginManager.withPlugin('maven-publish') {
Expand Down
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
android.disableAutomaticComponentCreation=true
android.useAndroidX=true
kotlin.code.style=official
org.gradle.jvmargs=-Xmx2048m
10 changes: 7 additions & 3 deletions library.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
android {
libraryVariants.all {
it.generateBuildConfigProvider.configure {
enabled = false
buildFeatures {
buildConfig false
}

publishing {
singleVariant('release') {
withSourcesJar()
}
}
}
Expand Down
13 changes: 11 additions & 2 deletions publishing.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
if (project != rootProject) publishing {
apply plugin: 'xyz.tynn.android.maven'
apply plugin: 'xyz.tynn.android.sources'
apply plugin: 'signing'

publishing {
publications {
release(MavenPublication) {
afterEvaluate {
from components.findByName('javaPlatform')
?: components.findByName('release')
}
}
}
}

signing {
final signingKey = System.env.SIGNING_KEY
final signingPassword = System.env.SIGNING_PASSWORD
Expand Down

0 comments on commit c5c246b

Please sign in to comment.