This repository has been archived by the owner on Dec 10, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 34
/
build.gradle
executable file
·153 lines (130 loc) · 4.04 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
import java.text.SimpleDateFormat;
apply plugin: 'com.jfrog.bintray'
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'org.sonarqube'
/////////////////git version logic///////////////
def cmd = "git show -s --pretty=format:%ct_%h"//"git rev-parse --short HEAD"
def proc = cmd.execute()
String[] gitInfos = proc.text.trim().split('_')
//allow build with no cmd git installed
if( gitInfos.length < 2 ) {
gitInfos = [(new Date()).getTime().toString(), "2" ]
}
String gitRevision = gitInfos[1]
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd_HHmmss")
String gitTimestamp = format.format(new Date(Long.parseLong(gitInfos[0])*1000));
def env = System.getenv()
def mainBuildVersion = "2";
//jenkins part
def buildVersion = (env.BUILD_NUMBER) ?
mainBuildVersion+"."+env.BUILD_NUMBER+"."+gitTimestamp+"-"+gitRevision
: mainBuildVersion+".dev."+gitTimestamp+"-"+gitRevision
;
print("Build is based on " + buildVersion);
/////////////////git version logic///////////////
sourceCompatibility=JavaVersion.VERSION_1_8
compileJava.options.encoding = 'UTF-8'
if(snapshot.equals("true")){
version = "2.0.0-Snapshot";
}else{
version = buildVersion;
}
group = "com.jme3x"
repositories {
jcenter()
}
configurations { provided }
sourceSets {
main { compileClasspath += configurations.provided }
test { compileClasspath += configurations.provided }
}
sourceSets.main.resources.srcDir 'src/main/java'
def v_slf4j = '1.7.7'
def v_jme3 = '3.1.0-beta1'
dependencies {
compile "org.slf4j:slf4j-api:${v_slf4j}"
provided "org.lwjgl.lwjgl:lwjgl:2.9.0"
provided "org.jmonkeyengine:jme3-core:${v_jme3}"
provided "org.jmonkeyengine:jme3-desktop:${v_jme3}"
provided "org.jmonkeyengine:jme3-lwjgl:${v_jme3}"
provided "org.jmonkeyengine:jme3-jogl:${v_jme3}"
testRuntime "org.slf4j:slf4j-jdk14:${v_slf4j}"
}
task packageSources(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
artifacts {
archives(packageSources) { type = 'jar' }
}
eclipse {
classpath {
plusConfigurations += [configurations.provided]
// * What went wrong:
// A problem occurred evaluating root project 'jfx'.
// > Could not get unknown property 'noExportConfigurations' for object of type org.gradle.plugins.ide.eclipse.model.EclipseClasspath.
// noExportConfigurations += [configurations.provided]
}
}
idea {
module {
scopes.PROVIDED.plus += [configurations.provided]
}
}
buildscript {
repositories {
jcenter()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:0.5'
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:2.0.1'
}
}
jar {
manifest { attributes("Implementation-Version": buildVersion) }
}
sonarqube {
properties {
property "sonar.host.url", sonarUrl
property "sonar.jdbc.url", sonarDBUrl
property "sonar.jdbc.driverClassName", sonarDBDriver
property "sonar.jdbc.username", sonarDBUser
property "sonar.jdbc.password", sonarDBPw
property "sonar.login",sonarUser
property "sonar.password",sonarPw
property "sonar.sourceEncoding", "UTF-8"
property "sonar.projectName", "JME-JFX"
}
}
uploadArchives {
repositories {
mavenDeployer {
repository(url: "$targetRepository/releases") {
authentication(userName: targetRepository_user, password: targetRepository_password)
}
}
}
}
bintray {
user = targetRepository_user
key = targetRepository_password
configurations = ['archives']
//publications = ['maven'] //When uploading Maven-based publication files
dryRun = false //Whether to run this as dry-run, without deploying
publish = true //If version should be auto published after an upload
pkg {
repo = 'VGS-OSS-Releases'
name = project.name
desc = "JFX Gui bridge for JME with usefull utilities for common usecases."
websiteUrl = "https://github.com/empirephoenix/JME3-JFX"
issueTrackerUrl = "https://github.com/empirephoenix/JME3-JFX/issues"
vcsUrl = "https://github.com/empirephoenix/JME3-JFX.git"
licenses = ['BSD 3-Clause']
labels = ['jmonkeyengine', 'gui']
publicDownloadNumbers = true
}
}