Skip to content

Commit 8473ba0

Browse files
authored
Merge pull request #1042 from mikepenz/feature/convention_plugin
Migrate project to use a shared convention plugin
2 parents 77a0791 + d2e8d4a commit 8473ba0

File tree

93 files changed

+2150
-2399
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+2150
-2399
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

Dangerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ fail("PR specifies label DO NOT MERGE") if github.pr_labels.any? { |label| label
1414
# Warn when there is a big PR
1515
warn("Big PR") if git.lines_of_code > 5000
1616

17-
File.open("settings.gradle", "r") do |file_handle|
17+
File.open("settings.gradle.kts", "r") do |file_handle|
1818
file_handle.each_line do |setting|
1919
if setting.include? "include"
20-
gradleModule = setting[10, setting.length-12]
20+
gradleModule = setting[10, setting.length-13]
2121

2222
# AndroidLint
2323
androidLintFile = String.new(gradleModule + "/build/reports/lint-results.xml")

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ aboutLibraries {
113113
// See https://github.com/mikepenz/AboutLibraries#special-repository-support
114114
fetchRemoteFunding = true
115115
// (Optional) GitHub token to raise API request limit to allow fetching more licenses
116-
gitHubApiToken = getLocalOrGlobalProperty("github.pat")
116+
gitHubApiToken = property("github.pat")
117117
// Full license text for license IDs mentioned here will be included, even if no detected dependency uses them.
118118
additionalLicenses = ["mit", "mpl_2_0"]
119119
// Allows to exclude some fields from the generated meta data field.
Lines changed: 6 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,22 @@
1-
@file:OptIn(ExperimentalWasmDsl::class)
2-
3-
import com.vanniktech.maven.publish.SonatypeHost
4-
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
5-
61
plugins {
7-
kotlin("multiplatform")
8-
alias(libs.plugins.androidLibrary)
9-
alias(libs.plugins.jetbrainsCompose)
10-
alias(libs.plugins.composeCompiler)
11-
alias(libs.plugins.dokka)
12-
alias(libs.plugins.mavenPublish)
2+
id("com.mikepenz.convention.android-library")
3+
id("com.mikepenz.convention.kotlin-multiplatform")
4+
id("com.mikepenz.convention.compose")
5+
id("com.mikepenz.convention.publishing")
136
}
147

158
android {
16-
compileSdk = libs.versions.compileSdk.get().toInt()
179
namespace = "com.mikepenz.aboutlibraries.ui.compose"
1810

19-
defaultConfig {
20-
minSdk = libs.versions.minSdk.get().toInt()
21-
}
22-
23-
buildTypes {
24-
named("release") {
25-
isMinifyEnabled = false
26-
proguardFiles(
27-
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
28-
)
29-
}
30-
}
31-
32-
compileOptions {
33-
sourceCompatibility = JavaVersion.VERSION_11
34-
targetCompatibility = JavaVersion.VERSION_11
35-
}
36-
3711
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
38-
kotlinOptions {
39-
jvmTarget = "11"
40-
41-
if (project.findProperty("composeCompilerReports") == "true") {
42-
freeCompilerArgs += listOf(
43-
"-P",
44-
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=${project.layout.buildDirectory.asFile.get().absolutePath}/compose_compiler"
45-
)
46-
}
47-
if (project.findProperty("composeCompilerMetrics") == "true") {
48-
freeCompilerArgs += listOf(
49-
"-P",
50-
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=${project.layout.buildDirectory.asFile.get().absolutePath}/compose_compiler"
51-
)
52-
}
53-
12+
compilerOptions {
5413
val outputDir = rootDir.resolve("aboutlibraries-core/compose_compiler_config.conf").path
55-
compilerOptions.freeCompilerArgs.addAll(
56-
"-P",
57-
"plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=${outputDir}"
58-
)
14+
freeCompilerArgs.addAll("-P", "plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=${outputDir}")
5915
}
6016
}
61-
62-
buildFeatures {
63-
compose = true
64-
}
65-
66-
lint {
67-
abortOnError = false
68-
}
6917
}
7018

7119
kotlin {
72-
applyDefaultHierarchyTemplate()
73-
74-
jvm()
75-
76-
androidTarget {
77-
publishLibraryVariants("release")
78-
}
79-
80-
js(IR) {
81-
browser()
82-
}
83-
84-
iosX64()
85-
iosArm64()
86-
iosSimulatorArm64()
87-
macosX64()
88-
macosArm64()
89-
wasmJs {
90-
nodejs()
91-
}
92-
9320
sourceSets {
9421
val commonMain by getting {
9522
dependencies {
@@ -108,7 +35,6 @@ dependencies {
10835

10936
debugImplementation(compose.uiTooling)
11037
"androidMainImplementation"(compose.preview)
111-
11238
"androidMainImplementation"(libs.androidx.core.ktx)
11339
}
11440

@@ -117,23 +43,4 @@ configurations.configureEach {
11743
// https://github.com/chrisbanes/tivi/blob/5e7586465337d326a1f1e40e0b412ecd2779bb5c/build.gradle#L72
11844
exclude(group = "androidx.appcompat")
11945
exclude(group = "com.google.android.material", module = "material")
120-
121-
122-
}
123-
124-
tasks.dokkaHtml.configure {
125-
dokkaSourceSets {
126-
configureEach {
127-
noAndroidSdkLink.set(false)
128-
}
129-
}
130-
}
131-
132-
133-
134-
if (project.hasProperty("pushall") || project.hasProperty("library_compose_only")) {
135-
mavenPublishing {
136-
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true)
137-
signAllPublications()
138-
}
13946
}
Lines changed: 7 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -1,94 +1,22 @@
1-
@file:OptIn(ExperimentalWasmDsl::class)
2-
3-
import com.vanniktech.maven.publish.SonatypeHost
4-
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
5-
61
plugins {
7-
kotlin("multiplatform")
8-
alias(libs.plugins.androidLibrary)
9-
alias(libs.plugins.jetbrainsCompose)
10-
alias(libs.plugins.composeCompiler)
11-
alias(libs.plugins.dokka)
12-
alias(libs.plugins.mavenPublish)
2+
id("com.mikepenz.convention.android-library")
3+
id("com.mikepenz.convention.kotlin-multiplatform")
4+
id("com.mikepenz.convention.compose")
5+
id("com.mikepenz.convention.publishing")
136
}
147

158
android {
16-
compileSdk = libs.versions.compileSdk.get().toInt()
179
namespace = "com.mikepenz.aboutlibraries.ui.compose.m3"
1810

19-
defaultConfig {
20-
minSdk = libs.versions.minSdk.get().toInt()
21-
}
22-
23-
buildTypes {
24-
named("release") {
25-
isMinifyEnabled = false
26-
proguardFiles(
27-
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
28-
)
29-
}
30-
}
31-
32-
compileOptions {
33-
sourceCompatibility = JavaVersion.VERSION_11
34-
targetCompatibility = JavaVersion.VERSION_11
35-
}
36-
3711
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
38-
kotlinOptions {
39-
jvmTarget = "11"
40-
if (project.findProperty("composeCompilerReports") == "true") {
41-
freeCompilerArgs += listOf(
42-
"-P",
43-
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=${project.layout.buildDirectory.asFile.get().absolutePath}/compose_compiler"
44-
)
45-
}
46-
if (project.findProperty("composeCompilerMetrics") == "true") {
47-
freeCompilerArgs += listOf(
48-
"-P",
49-
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=${project.layout.buildDirectory.asFile.get().absolutePath}/compose_compiler"
50-
)
51-
}
12+
compilerOptions {
13+
val outputDir = rootDir.resolve("aboutlibraries-core/compose_compiler_config.conf").path
14+
freeCompilerArgs.addAll("-P", "plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=${outputDir}")
5215
}
53-
54-
val outputDir = rootDir.resolve("aboutlibraries-core/compose_compiler_config.conf").path
55-
compilerOptions.freeCompilerArgs.addAll(
56-
"-P",
57-
"plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=${outputDir}"
58-
)
59-
}
60-
61-
buildFeatures {
62-
compose = true
63-
}
64-
65-
lint {
66-
abortOnError = false
6716
}
6817
}
6918

7019
kotlin {
71-
applyDefaultHierarchyTemplate()
72-
73-
jvm()
74-
75-
androidTarget {
76-
publishLibraryVariants("release")
77-
}
78-
79-
js(IR) {
80-
browser()
81-
}
82-
83-
iosX64()
84-
iosArm64()
85-
iosSimulatorArm64()
86-
macosX64()
87-
macosArm64()
88-
wasmJs {
89-
nodejs()
90-
}
91-
9220
sourceSets {
9321
val commonMain by getting {
9422
dependencies {
@@ -107,7 +35,6 @@ dependencies {
10735

10836
debugImplementation(compose.uiTooling)
10937
"androidMainImplementation"(compose.preview)
110-
11138
"androidMainImplementation"(libs.androidx.core.ktx)
11239
}
11340

@@ -117,21 +44,4 @@ configurations.configureEach {
11744
exclude(group = "androidx.appcompat")
11845
exclude(group = "com.google.android.material", module = "material")
11946
exclude(group = "com.google.android.material", module = "material3")
120-
}
121-
122-
tasks.dokkaHtml.configure {
123-
dokkaSourceSets {
124-
configureEach {
125-
noAndroidSdkLink.set(false)
126-
}
127-
}
128-
}
129-
130-
131-
132-
if (project.hasProperty("pushall") || project.hasProperty("library_compose_m3_only")) {
133-
mavenPublishing {
134-
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true)
135-
signAllPublications()
136-
}
13747
}

0 commit comments

Comments
 (0)