forked from jphp-group/jphp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
157 lines (128 loc) · 4.22 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
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
148
149
150
151
152
153
154
155
156
157
def javaVersion = '1.7';
def projectVersion = '0.9.0';
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.6'
}
}
allprojects {
apply plugin: 'idea'
apply plugin: 'signing'
apply plugin: 'java'
apply plugin: 'maven'
project.group = 'org.develnext.jphp'
project.version = projectVersion
project.ext.isSnapshot = !Boolean.getBoolean("release");
if (project.ext.isSnapshot) {
version += '-SNAPSHOT'
}
repositories {
mavenLocal()
mavenCentral()
}
task sourcesJar(type: Jar, dependsOn: 'classes') {
classifier = 'sources'
from sourceSets.main.allSource
}
}
task wrapper(type: Wrapper) {
gradleVersion = 2.12;
}
configure(subprojects) {
apply plugin: 'maven'
apply plugin: 'java'
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
sourceSets {
main.java.srcDirs = ['src/main/java']
main.resources.srcDirs = ['src/main/resources']
test.java.srcDirs = ["src/main/tests"]
test.resources.srcDirs = ["src/main/tests"]
}
[compileJava, compileTestJava, javadoc]*.options*.encoding = 'UTF-8'
}
// for deploy
configure([
project(':jphp-runtime'),
project(':jphp-core'),
project(':jphp-swing-ext'),
project(':jphp-zend-ext'),
project(':jphp-json-ext'),
project(':jphp-jsoup-ext'),
project(':jphp-xml-ext'),
project(':jphp-mail-ext'),
project(':jphp-sql-ext'),
project(':jphp-webserver-ext'),
project(':jphp-compress-ext'),
project(':jphp-orientdb-ext'),
project(':jphp-debugger'),
project(':jphp-scripting'),
project(':jphp-gen-api'),
]) {
apply plugin: 'com.jfrog.bintray'
if (!project.ext.isSnapshot) {
javadoc.failOnError = false
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
jar.dependsOn += [sourcesJar, javadocJar]
artifacts {
archives sourcesJar
archives javadocJar
}
signing {
sign configurations.archives
}
} else {
jar.dependsOn += [sourcesJar]
artifacts {
archives sourcesJar
}
}
bintray {
user = rootProject.hasProperty('bintray.user') ? rootProject.getProperty("bintray.user") : "";
key = rootProject.hasProperty('bintray.apikey') ? rootProject.getProperty("bintray.apikey") : "";
configurations = ['archives']
pkg {
repo = "maven"
name = "jphp-compiler"
websiteUrl = 'http://github.com/jphp-compiler'
vcsUrl = 'http://github.com/jphp-compiler'
licenses = ["Apache-2.0"]
publish = true
}
}
task deploy << {
rootProject.ext {
if (rootProject.hasProperty('deployUserName')) {
username = rootProject.deployUserName
} else {
username = rootProject.hasProperty('username') ? rootProject.username : System.console().readLine("\nusername: ")
}
if (rootProject.hasProperty('deployPassword')) {
password = rootProject.deployPassword
} else {
password = rootProject.hasProperty('password') ? rootProject.password : System.console().readPassword("password: ").toString()
}
}
uploadArchives {
repositories {
mavenDeployer {
beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
repository(url: 'http://repo.develnext.org/repository/internal') {
authentication(userName: rootProject.username, password: rootProject.password);
}
snapshotRepository(url: 'http://repo.develnext.org/repository/snapshots') {
authentication(userName: rootProject.username, password: rootProject.password);
}
}
}
}
uploadArchives.execute();
}
deploy.dependsOn += jar
}