-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Expand file tree
/
Copy pathbuild.gradle
More file actions
84 lines (75 loc) · 3.66 KB
/
Copy pathbuild.gradle
File metadata and controls
84 lines (75 loc) · 3.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
buildscript {
apply from: "gradle/dependencies.gradle"
repositories {
google()
gradlePluginPortal()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.6.1'
classpath 'io.github.gradle-nexus:publish-plugin:2.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
classpath "org.jetbrains.kotlin:compose-compiler-gradle-plugin:${kotlinVersion}"
}
}
apply plugin: 'io.github.gradle-nexus.publish-plugin'
nexusPublishing {
packageGroup = project.findProperty("PROJ_GROUP_MAVEN_CENTRAL") ?: "io.github.carguo"
repositories {
sonatype {
nexusUrl.set(uri("https://ossrh-staging-api.central.sonatype.com/service/local/"))
snapshotRepositoryUrl.set(uri("https://central.sonatype.com/repository/maven-snapshots/"))
username = System.getenv("MAVEN_CENTRAL_USERNAME") ?: project.findProperty("ossrhUsername")
password = System.getenv("MAVEN_CENTRAL_PASSWORD") ?: project.findProperty("ossrhPassword")
}
}
}
allprojects {
repositories {
mavenCentral()
google()
maven { url "https://maven.aliyun.com/repository/public" }
maven { url "https://jitpack.io" }
maven {
url 'https://maven.pkg.github.com/CarGuo/GSYVideoPlayer'
credentials {
username = project.findProperty('githubReadUser') ?: System.getenv('GITHUB_READ_USER') ?: 'carsmallguo'
password = project.findProperty('githubReadToken') ?: System.getenv('GITHUB_READ_TOKEN') ?: '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'
}
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
// 13.2.1: Publishing regression guard. Default artifacts must remain free of
// optional jUPnP/Jetty dependencies, while the cast artifact must publish them.
def verifiedPublication = (project.findProperty("PUBLISH_TARGET") ?: "github") == "mavenCentral"
? [taskSuffix: "MavenCentral", directory: "mavenCentral"]
: [taskSuffix: "Release", directory: "release"]
tasks.register("verifyCastDependencyIsolation") {
dependsOn(
":gsyVideoPlayer-java:generatePomFileFor${verifiedPublication.taskSuffix}Publication",
":gsyVideoPlayer:generatePomFileFor${verifiedPublication.taskSuffix}Publication",
":gsyVideoPlayer-cast:generatePomFileFor${verifiedPublication.taskSuffix}Publication")
doLast {
def javaPom = project(":gsyVideoPlayer-java").layout.buildDirectory
.file("publications/${verifiedPublication.directory}/pom-default.xml").get().asFile.text
def aggregatePom = project(":gsyVideoPlayer").layout.buildDirectory
.file("publications/${verifiedPublication.directory}/pom-default.xml").get().asFile.text
def castPom = project(":gsyVideoPlayer-cast").layout.buildDirectory
.file("publications/${verifiedPublication.directory}/pom-default.xml").get().asFile.text
[javaPom, aggregatePom].each { pom ->
if (pom.contains("<groupId>org.jupnp</groupId>")
|| pom.contains("<groupId>org.eclipse.jetty</groupId>")) {
throw new GradleException("Default GSY artifacts must not publish jUPnP/Jetty")
}
}
if (!castPom.contains("<artifactId>gsyvideoplayer-java</artifactId>")
|| !castPom.contains("<groupId>org.jupnp</groupId>")
|| !castPom.contains("<groupId>org.eclipse.jetty</groupId>")) {
throw new GradleException("Cast POM is missing its core, jUPnP, or Jetty dependency")
}
}
}
// 引入权限分析脚本
apply from: "gradle/permissions.gradle"