forked from hernandazevedo/gradle-secretkey-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
72 lines (66 loc) · 2.08 KB
/
build.gradle
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
buildscript {
ext {
localProp = new Properties()
if(rootProject.file("local.properties").exists())
localProp.load(new FileInputStream(rootProject.file("local.properties")))
groupName = "com.hernandazevedo"
pkgVersion = System.env.BITRISE_GIT_TAG != null ? System.env.BITRISE_GIT_TAG.replace("v", "") : "1.0.0"
packageCloudToken = System.env.PACKAGECLOUD_TOKEN != null ? System.env.PACKAGECLOUD_TOKEN : localProp["packageCloudToken"]
}
repositories {
maven {
url 'https://maven.google.com/'
name 'Google'
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
allprojects {
repositories {
mavenCentral()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
configurations {
deployerJars
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
subprojects {
dependencies {
deployerJars "io.packagecloud.maven.wagon:maven-packagecloud-wagon:0.0.6"
}
}
ext.uploadArtifacts = { artifactId, repo, config ->
println("Artifact " + artifactId)
println("Package Version " + pkgVersion)
repo.mavenDeployer {
configuration = config.deployerJars
repository(url: "packagecloud+https://packagecloud.io/hernandazevedo/gradle-secretkey") {
authentication(password: packageCloudToken)
}
pom.version = pkgVersion
pom.artifactId = artifactId
pom.groupId = groupName
pom.whenConfigured { pom ->
println("Current Dependencies ${pom.dependencies}")
pom.dependencies.each { dep ->
println("Processing ${dep}")
if (dep.getVersion() == "unspecified" && dep.getGroupId() == rootProject.name) {
println("Updating Dependencies")
dep.setGroupId(groupName)
dep.setVersion(pkgVersion)
println("Updated ${dep}")
}
}
}
}
}