-
Notifications
You must be signed in to change notification settings - Fork 0
/
publish.gradle
123 lines (100 loc) · 3.98 KB
/
publish.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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
apply plugin: 'maven-publish'
apply plugin: 'signing'
File secretPropsFile = project.rootProject.file('local.properties')
Properties p = new Properties()
new FileInputStream(secretPropsFile).withCloseable { is ->
p.load(is)
}
p.each { name, value ->
ext[name] = value
}
task prepareGoogleCloudDistDirs {
mkdir "$buildDir/tmp/dist/Prodege Android AdMob Adapter-${rootProject.adapterVersionName}"
}
task packageGoogleCloudDistribution(type: Zip) {
archiveFileName = "Prodege Android AdMob Adapter-${rootProject.adapterVersionName}.zip"
destinationDirectory = file("$buildDir/dist/public")
from "$buildDir/tmp/dist/"
}
task copyDistToTempDirectory(type: Copy) {
from "$buildDir/outputs/aar/prodege-admob-${rootProject.adapterVersionName}.aar"
into "$buildDir/tmp/dist/Prodege Android AdMob Adapter-${rootProject.adapterVersionName}"
}
task deleteDistTempDirectories(type: Delete) {
delete "$buildDir/tmp/dist"
}
task packageDistributions {
dependsOn 'prepareGoogleCloudDistDirs'
dependsOn 'copyDistToTempDirectory'
dependsOn 'packageGoogleCloudDistribution'
dependsOn 'deleteDistTempDirectories'
tasks.findByName('copyDistToTempDirectory').mustRunAfter 'prepareGoogleCloudDistDirs'
tasks.findByName('packageGoogleCloudDistribution').mustRunAfter 'copyDistToTempDirectory'
tasks.findByName('deleteDistTempDirectories').mustRunAfter 'packageGoogleCloudDistribution'
}
publishing {
publications {
release(MavenPublication) {
groupId "com.prodege.mediation"
artifactId "prodege-admob"
version rootProject.adapterVersionName
def filename = "prodege-admob-${rootProject.adapterVersionName}"
artifact("$buildDir/outputs/aar/${filename}.aar")
pom {
name = "prodege-admob"
description = "Adapter for showing Prodege Ads within mobile apps through AdMob mediation"
url = "https://github.com/pollfish/android-admob-adapter"
packaging = "aar"
licenses {
license {
name = "The Apache Software License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "prodege"
name = "Prodege, LLC"
email = "support@pollfish.com"
}
}
scm {
connection = "https://github.com/pollfish/android-admob-adapter.git"
developerConnection = "https://github.com/pollfish/android-admob-adapter.git"
url = "https://github.com/pollfish/android-admob-adapter"
}
withXml {
def dependenciesNode = asNode().appendNode('dependencies')
project.configurations.implementation.allDependencies.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
if (it.artifacts.size() > 0) {
dependencyNode.appendNode('type', it.artifacts[0].type)
}
}
}
}
}
}
repositories {
maven {
name = "sonatype"
url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/"
credentials {
username ossrhUsername
password ossrhPassword
}
}
}
}
signing {
sign publishing.publications
}
nexusStaging {
packageGroup "com.prodege.mediation"
stagingProfileId = nexusStagingProfileId
username = ossrhUsername
password = ossrhPassword
}