Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(core.gradle-plugin): Maven发布添加Plugin Marker构件 #1320

Merged
merged 1 commit into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions buildScripts/gradle/maven.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,22 @@ publishing {
setScm(scm)
}
}
// Plugin Marker Artifacts
// https://docs.gradle.org/current/userguide/plugins.html#sec:plugin_markers
pluginMarker(MavenPublication) {
def pluginId = 'com.tencent.shadow.plugin'
groupId pluginId
artifactId pluginId + '.gradle.plugin'
version publicationVersion

pom.withXml {
def root = asNode()
def dependencies = root.appendNode('dependencies')
dependencies.append(getDependencyNode('compile', coreGroupId, 'gradle-plugin', publicationVersion))
def scm = root.appendNode('scm')
setScm(scm)
}
}
manifestParser(MavenPublication) {
groupId coreGroupId
artifactId 'manifest-parser'
Expand Down
11 changes: 11 additions & 0 deletions projects/test/gradle-plugin-agp-compat-test/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
pluginManagement {
repositories {
if (!System.getenv().containsKey("DISABLE_TENCENT_MAVEN_MIRROR")) {
maven { url 'https://mirrors.tencent.com/nexus/repository/maven-public/' }
} else {
google()
mavenCentral()
}
mavenLocal()
}
}
rootProject.name = 'gradle-plugin-agp-compat-test'
if (SetGradleVersion != 'true') {
include 'stub-project'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,15 @@ buildscript {
classpath "com.tencent.shadow.core:gradle-plugin:$ShadowVersion"
}
}

apply plugin: 'com.android.application'
apply plugin: 'com.tencent.shadow.plugin'
try {
plugins {
id 'com.android.application' version "$TestAGPVersion" apply true
id 'com.tencent.shadow.plugin' version "$ShadowVersion" apply true
}
} catch (Exception ignored) {
apply plugin: 'com.android.application'
apply plugin: 'com.tencent.shadow.plugin'
}

allprojects {
repositories {
Expand Down
Loading