forked from yxljl1314/NextInputs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
147 lines (119 loc) · 3.52 KB
/
build.gradle
File metadata and controls
147 lines (119 loc) · 3.52 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
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
buildscript {
repositories {
jcenter()
}
}
plugins {
id "com.jfrog.bintray" version "1.6"
}
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'maven-publish'
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
repositories {
jcenter()
mavenCentral()
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
}
ext{
projVersion = '1.8'
projName = 'NextInputs'
projDesc = 'NextInputs: A Text Validation Library for Java'
projURL = "https://github.com/yoojia/NextInputs"
projVCS = "https://github.com/yoojia/NextInputs.git"
}
group 'com.github.yoojia'
version projVersion
tasks.withType(JavaCompile) {
options.encoding = 'UTF-8'
}
def pomConfig = {
name projName
url projURL
inceptionYear '2016'
scm { url projVCS }
developers {
developer {
id 'yoojia'
name 'Yoojia Chen'
email 'yoojiachen@gmail.com'
url 'https://yoojia.github.io'
}
}
}
publishing {
publications {
MavenJava(MavenPublication) {
from components.java
groupId 'com.github.yoojia'
artifactId 'next-inputs'
version projVersion
artifact sourcesJar
artifact javadocJar
pom.withXml {
asNode().children().last() + pomConfig
asNode().appendNode("description", projDesc)
def licencesNode = asNode().appendNode('licenses')
def licenseNode = licencesNode.appendNode('license')
licenseNode.appendNode('name', 'The Apache Software License, Version 2.0')
licenseNode.appendNode('url', 'http://www.apache.org/licenses/LICENSE-2.0.txt')
licenseNode.appendNode('distribution', 'repo')
}
}
}
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
javadoc {
options{
encoding "UTF-8"
charSet 'UTF-8'
author true
version true
links "http://docs.oracle.com/javase/7/docs/api"
title project.name
}
}
artifacts {
archives sourcesJar, javadocJar
}
bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('bintrayUser')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('bintrayApiKey')
publications = ['MavenJava']
dryRun = false
publish = true // 是否自动发布
pkg {
repo = 'maven'
name = projName
userOrg = 'yoojia'
licenses = ['Apache-2.0']
vcsUrl = projVCS
labels = ['Java', 'Text Input', 'Validation']
publicDownloadNumbers = true
version {
name = projVersion
desc = projDesc
vcsTag = projVersion
attributes = ['gradle-plugin': 'com.use.less:com.use.less.gradle:gradle-useless-plugin']
gpg {
sign = true
}
mavenCentralSync {
sync = true
user = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER')
password = project.hasProperty('SONATYPE_PASS') ? project.property('SONATYPE_PASS') : System.getenv('SONATYPE_PASS')
close = '1'
}
}
}
}