forked from gybin02/Jet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mvn.gradle
47 lines (41 loc) · 1.2 KB
/
mvn.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
apply plugin: 'maven'
//apply plugin: 'com.github.dcendents.android-maven'
repositories {
mavenCentral()
}
//for project dependency
project.group = GROUP_ID
project.version = COMPONENT_VERSION
task deploy <<{
}
deploy.dependsOn uploadArchives
uploadArchives {
def typePattern = ~"[0-9]\\.[0-9]\\.[0-9]\$"
def depolyTypeUrl
if(typePattern.matcher(COMPONENT_VERSION)){
println "warn ! find release version! will deploy release aar! version is $COMPONENT_VERSION "
depolyTypeUrl= deployUrl.replace("snapshots","releases")
}else {
depolyTypeUrl = deployUrl
}
// depolyTypeUrl= deployUrl.replace("snapshots","releases")
//println "depolyTypeUrl " + depolyTypeUrl
repositories.mavenDeployer {
repository(url: depolyTypeUrl) {
authentication(userName: deployUserName, password: deployPassword)
}
pom.project {
groupId GROUP_ID
artifactId POM_ARTIFACT_ID
packaging PACKAGE_FORMAT
version COMPONENT_VERSION
}
}
}
task androidSourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.sourceFiles
}
artifacts {
archives androidSourcesJar
}