Skip to content

Commit

Permalink
feat: plugin publish
Browse files Browse the repository at this point in the history
  • Loading branch information
aleyn97 committed Apr 11, 2024
1 parent ab9af91 commit 6d71b13
Show file tree
Hide file tree
Showing 25 changed files with 32 additions and 55 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@
.externalNativeBuild
.cxx
local.properties
.idea/deploymentTargetDropDown
.idea/deploymentTargetDropDown
build-logic
15 changes: 1 addition & 14 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion build-logic/plugin/.gitignore

This file was deleted.

25 changes: 0 additions & 25 deletions build-logic/settings.gradle

This file was deleted.

7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
dependencies {
if (!useLocal) classpath libs.routerPluginLib
if (Boolean.valueOf(useLocal)) {
classpath files("plugins/plugin.jar")
} else {
classpath libs.routerPluginLib
}
}
}

Expand All @@ -11,7 +15,6 @@ plugins {
alias libs.plugins.kotlin.android apply false
alias libs.plugins.google.ksp apply false
alias libs.plugins.kotlin.jvm apply false
alias libs.plugins.routerPlug apply false //useLocal=false remove
}

subprojects.forEach {
Expand Down
3 changes: 1 addition & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ kotlinpoetVersion = "1.14.2"
lifecycleRuntimeKtxVersion = "2.6.1"
materialVersion = "1.9.0"
symbolProcessingGradlePluginVersion = "1.8.20-1.0.11"
agp = "7.4.0"
agp = "7.4.2"
kotlinVersion = "1.8.20"

[libraries]
Expand Down Expand Up @@ -45,7 +45,6 @@ android-library = { id = "com.android.library", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlinVersion" }
google-ksp = { id = "com.google.devtools.ksp", version.ref = "symbolProcessingGradlePluginVersion" }
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlinVersion" }
routerPlug = { id = "aleyn-router", version.ref = "lrouterVersion" }

[bundles]

4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Jul 17 20:40:54 CST 2023
#Thu Apr 11 09:52:26 CST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6.4-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
File renamed without changes.
19 changes: 18 additions & 1 deletion build-logic/plugin/build.gradle → plugin/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
plugins {
id 'kotlin'
id "java-gradle-plugin"
alias(libs.plugins.kotlin.jvm)
}
Expand All @@ -25,6 +26,17 @@ tasks.register('genVersion', Copy) {

compileKotlin.dependsOn('genVersion')

tasks.register('copyJar', Copy) {
from "${buildDir}/libs/plugin-${version}.jar"
into "../plugins"
filteringCharset = 'UTF-8'
rename { String name ->
name.replace("-${version}", '')
}
}

jar.finalizedBy('copyJar')

dependencies {
implementation gradleApi()
compileOnly libs.gradle
Expand All @@ -35,12 +47,17 @@ dependencies {
}

gradlePlugin {
website = 'https://github.com/aleyn97/router'
vcsUrl = 'https://github.com/aleyn97/router.git'
plugins {
create("routerPlugin") {
id = "aleyn-router"
implementationClass = "com.aleyn.router.plug.RouterPlugin"
displayName = "LRouter Plugin"
description = "LRouter code injection plugin"
tags.set(["android", "router"])
}
}
}

apply from: '../../publishing.gradle'
apply from: '../publishing.gradle'
Binary file added plugins/plugin.jar
Binary file not shown.
5 changes: 0 additions & 5 deletions router/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ dependencies {
compileOnly libs.appcompat
implementation libs.gson
api project(path: ':annotation')

/* registerTransform({
}, {
})*/
}

apply from: '../publishing.gradle'
5 changes: 3 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
pluginManagement {
if (useLocal) includeBuild("build-logic")
repositories {
google()
gradlePluginPortal()
mavenLocal()
maven { url "https://maven.aliyun.com/repository/public/" }
maven { url "https://maven.aliyun.com/repository/central/" }
maven { url 'https://jitpack.io' }
Expand All @@ -27,4 +27,5 @@ if (Boolean.valueOf(useLocal)) {
include ':module_first'
include ':lib_base'
include ':module_two'
include ':module_main'
include ':module_main'
include ':plugin'

0 comments on commit 6d71b13

Please sign in to comment.