Skip to content

Commit

Permalink
- transition the whole project to use a shared convention plugin inst…
Browse files Browse the repository at this point in the history
…ead of custom setup

- remove obsolete code
- transition and reorganize some logic
  • Loading branch information
mikepenz committed Jan 3, 2025
1 parent 77a0791 commit de9e8cc
Show file tree
Hide file tree
Showing 86 changed files with 2,043 additions and 2,261 deletions.
6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ aboutLibraries {
// See https://github.com/mikepenz/AboutLibraries#special-repository-support
fetchRemoteFunding = true
// (Optional) GitHub token to raise API request limit to allow fetching more licenses
gitHubApiToken = getLocalOrGlobalProperty("github.pat")
gitHubApiToken = property("github.pat")
// Full license text for license IDs mentioned here will be included, even if no detected dependency uses them.
additionalLicenses = ["mit", "mpl_2_0"]
// Allows to exclude some fields from the generated meta data field.
Expand Down
105 changes: 6 additions & 99 deletions aboutlibraries-compose-m2/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,95 +1,22 @@
@file:OptIn(ExperimentalWasmDsl::class)

import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

plugins {
kotlin("multiplatform")
alias(libs.plugins.androidLibrary)
alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.composeCompiler)
alias(libs.plugins.dokka)
alias(libs.plugins.mavenPublish)
id("com.mikepenz.convention.android-library")
id("com.mikepenz.convention.kotlin-multiplatform")
id("com.mikepenz.convention.compose")
id("com.mikepenz.convention.publishing")
}

android {
compileSdk = libs.versions.compileSdk.get().toInt()
namespace = "com.mikepenz.aboutlibraries.ui.compose"

defaultConfig {
minSdk = libs.versions.minSdk.get().toInt()
}

buildTypes {
named("release") {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "11"

if (project.findProperty("composeCompilerReports") == "true") {
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=${project.layout.buildDirectory.asFile.get().absolutePath}/compose_compiler"
)
}
if (project.findProperty("composeCompilerMetrics") == "true") {
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=${project.layout.buildDirectory.asFile.get().absolutePath}/compose_compiler"
)
}

compilerOptions {
val outputDir = rootDir.resolve("aboutlibraries-core/compose_compiler_config.conf").path
compilerOptions.freeCompilerArgs.addAll(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=${outputDir}"
)
freeCompilerArgs.addAll("-P", "plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=${outputDir}")
}
}

buildFeatures {
compose = true
}

lint {
abortOnError = false
}
}

kotlin {
applyDefaultHierarchyTemplate()

jvm()

androidTarget {
publishLibraryVariants("release")
}

js(IR) {
browser()
}

iosX64()
iosArm64()
iosSimulatorArm64()
macosX64()
macosArm64()
wasmJs {
nodejs()
}

sourceSets {
val commonMain by getting {
dependencies {
Expand All @@ -108,7 +35,6 @@ dependencies {

debugImplementation(compose.uiTooling)
"androidMainImplementation"(compose.preview)

"androidMainImplementation"(libs.androidx.core.ktx)
}

Expand All @@ -117,23 +43,4 @@ configurations.configureEach {
// https://github.com/chrisbanes/tivi/blob/5e7586465337d326a1f1e40e0b412ecd2779bb5c/build.gradle#L72
exclude(group = "androidx.appcompat")
exclude(group = "com.google.android.material", module = "material")


}

tasks.dokkaHtml.configure {
dokkaSourceSets {
configureEach {
noAndroidSdkLink.set(false)
}
}
}



if (project.hasProperty("pushall") || project.hasProperty("library_compose_only")) {
mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true)
signAllPublications()
}
}
104 changes: 7 additions & 97 deletions aboutlibraries-compose-m3/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,94 +1,22 @@
@file:OptIn(ExperimentalWasmDsl::class)

import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl

plugins {
kotlin("multiplatform")
alias(libs.plugins.androidLibrary)
alias(libs.plugins.jetbrainsCompose)
alias(libs.plugins.composeCompiler)
alias(libs.plugins.dokka)
alias(libs.plugins.mavenPublish)
id("com.mikepenz.convention.android-library")
id("com.mikepenz.convention.kotlin-multiplatform")
id("com.mikepenz.convention.compose")
id("com.mikepenz.convention.publishing")
}

android {
compileSdk = libs.versions.compileSdk.get().toInt()
namespace = "com.mikepenz.aboutlibraries.ui.compose.m3"

defaultConfig {
minSdk = libs.versions.minSdk.get().toInt()
}

buildTypes {
named("release") {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro"
)
}
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "11"
if (project.findProperty("composeCompilerReports") == "true") {
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=${project.layout.buildDirectory.asFile.get().absolutePath}/compose_compiler"
)
}
if (project.findProperty("composeCompilerMetrics") == "true") {
freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=${project.layout.buildDirectory.asFile.get().absolutePath}/compose_compiler"
)
}
compilerOptions {
val outputDir = rootDir.resolve("aboutlibraries-core/compose_compiler_config.conf").path
freeCompilerArgs.addAll("-P", "plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=${outputDir}")
}

val outputDir = rootDir.resolve("aboutlibraries-core/compose_compiler_config.conf").path
compilerOptions.freeCompilerArgs.addAll(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:stabilityConfigurationPath=${outputDir}"
)
}

buildFeatures {
compose = true
}

lint {
abortOnError = false
}
}

kotlin {
applyDefaultHierarchyTemplate()

jvm()

androidTarget {
publishLibraryVariants("release")
}

js(IR) {
browser()
}

iosX64()
iosArm64()
iosSimulatorArm64()
macosX64()
macosArm64()
wasmJs {
nodejs()
}

sourceSets {
val commonMain by getting {
dependencies {
Expand All @@ -107,7 +35,6 @@ dependencies {

debugImplementation(compose.uiTooling)
"androidMainImplementation"(compose.preview)

"androidMainImplementation"(libs.androidx.core.ktx)
}

Expand All @@ -117,21 +44,4 @@ configurations.configureEach {
exclude(group = "androidx.appcompat")
exclude(group = "com.google.android.material", module = "material")
exclude(group = "com.google.android.material", module = "material3")
}

tasks.dokkaHtml.configure {
dokkaSourceSets {
configureEach {
noAndroidSdkLink.set(false)
}
}
}



if (project.hasProperty("pushall") || project.hasProperty("library_compose_m3_only")) {
mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL, true)
signAllPublications()
}
}
Loading

0 comments on commit de9e8cc

Please sign in to comment.