Skip to content

Commit

Permalink
- move to kts gradle build files for plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepenz committed Jan 3, 2025
1 parent 1169587 commit 3766749
Show file tree
Hide file tree
Showing 11 changed files with 112 additions and 143 deletions.
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GROUP=com.mikepenz

VERSION_NAME=11.3.0-rc02
VERSION_CODE=110300
VERSION_NAME=11.4.0-b02
VERSION_CODE=110400

POM_URL=https://github.com/mikepenz/AboutLibraries
POM_SCM_URL=https://github.com/mikepenz/AboutLibraries
Expand Down
30 changes: 0 additions & 30 deletions plugin-build/build.gradle

This file was deleted.

39 changes: 39 additions & 0 deletions plugin-build/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import java.io.FileInputStream
import java.util.*

plugins {
alias(libs.plugins.conventionPlugin)
alias(baseLibs.plugins.dokka)
alias(baseLibs.plugins.mavenPublish)
id("com.gradle.plugin-publish") version "1.3.0" apply false
}

buildscript {
repositories {
google()
mavenCentral()
mavenLocal()
}

dependencies {
classpath(baseLibs.kotlin.gradlePlugin.get())
classpath(baseLibs.android.lint.gradlePlugin.get())
}
}

allprojects {
repositories {
google()
mavenCentral()
mavenLocal()
}

val props = Properties()
val propFile = project.layout.files("../gradle.properties").singleFile
if (propFile.exists()) {
props.load(FileInputStream(propFile))
setProperty("version", props["VERSION_NAME"])
} else {
throw IllegalStateException("The parent project's gradle.properties file is missing")
}
}
2 changes: 1 addition & 1 deletion plugin-build/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
106 changes: 0 additions & 106 deletions plugin-build/plugin/build.gradle

This file was deleted.

62 changes: 62 additions & 0 deletions plugin-build/plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import com.vanniktech.maven.publish.GradlePublishPlugin

plugins {
id("com.android.lint")
kotlin("jvm")
id("com.gradle.plugin-publish")
id("java-gradle-plugin")
id("org.jetbrains.dokka")
id("com.vanniktech.maven.publish")
}


group = "com.mikepenz.aboutlibraries.plugin"
version = rootProject.properties["version"]!!

gradlePlugin {
website = "https://github.com/mikepenz/AboutLibraries"
vcsUrl = "https://github.com/mikepenz/AboutLibraries"

plugins {
create("aboutlibsPlugin") {
id = "${project.group}"
implementationClass = "${project.group}.AboutLibrariesPlugin"
description = "Resolve all dependencies used in a gradle module, with associated license and further information."
displayName = "AboutLibraries Library Gradle Plugin"
tags = listOf("libraries", "licenses", "android")
}
}
}

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

kotlin {
jvmToolchain(11)
}

dependencies {
implementation(gradleApi())
implementation(localGroovy())
implementation(libs.kotlin.stdlib)

// parser the pom.xml files
implementation(libs.ivy.core)

// add better android support
compileOnly(libs.gradle.build)

// lint rules
lintChecks(libs.android.lint.gradle)
}

mavenPublishing {
configure(GradlePublishPlugin())
}

dokka {
dokkaSourceSets {
}
}
4 changes: 4 additions & 0 deletions plugin-build/plugin/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
POM_NAME=AboutLibraries Library Gradle Plugin
POM_DESCRIPTION=Resolve all dependencies used in a gradle module, with associated license and further information.
POM_ARTIFACT_ID=aboutlibraries-plugin
GROUP=com.mikepenz.aboutlibraries.plugin
1 change: 0 additions & 1 deletion plugin-build/plugin/settings.gradle

This file was deleted.

1 change: 1 addition & 0 deletions plugin-build/plugin/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rootProject.name = "aboutlibraries-plugin"
3 changes: 2 additions & 1 deletion plugin-build/settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ dependencyResolutionManagement {
mavenCentral()
google()
gradlePluginPortal()
mavenLocal()
}

versionCatalogs {
create("libs") {
from(files("../gradle/libs.versions.toml"))
}
create("baseLibs") {
from("com.mikepenz:version-catalog:0.0.1")
from("com.mikepenz:version-catalog:0.0.4")
}
}
}
3 changes: 1 addition & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,11 @@ dependencyResolutionManagement {

versionCatalogs {
create("baseLibs") {
from("com.mikepenz:version-catalog:0.0.2")
from("com.mikepenz:version-catalog:0.0.4")
}
}
}


include(":aboutlibraries-core")
include(":aboutlibraries")
include(":aboutlibraries-compose-m2")
Expand Down

0 comments on commit 3766749

Please sign in to comment.