-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle
164 lines (146 loc) · 4.6 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
158
159
160
161
162
163
164
['java', 'eclipse', 'maven', 'application', 'signing'].each {
apply plugin : it
}
set("myGradleVersion", GradleVersion.current().getVersion().substring(0,3))
println ("Using Gradle version: " + myGradleVersion)
if (Double.parseDouble(myGradleVersion) >= 1.6) {
apply plugin : 'maven-publish'
}
else {
println "Note: you need Gradle version >= 1.6 to publish to a Maven repo"
}
//Main class for 'gradle run'
mainClassName = 'org.metacsp.examples.multi.TestTimelinePlotting'
//JDK version
sourceCompatibility = 1.6
targetCompatibility = 1.6
def getSvnRevision() {
new ByteArrayOutputStream().withStream { os ->
def result = exec {
executable = 'svn'
args = ['info']
standardOutput = os
}
def outputAsString = os.toString()
def matchLastChangedRev = outputAsString =~ /Last Changed Rev: (\d+)/
ext.svnRev = "${matchLastChangedRev[0][1]}".toInteger()
}
return svnRev
}
//MetaCSP version
version = '1.0.' + getSvnRevision()
//version = '0.0.0-SNAPSHOT'
group = 'org.metacsp'
//Repos for dependencies
repositories {
mavenCentral()
}
dependencies {
//It's all in Maven Central
compile 'org.ow2.sat4j:org.ow2.sat4j.sat:2.3.4'
compile 'net.sf.jung:jung2:2.0.1'
compile 'net.sf.jung:jung-graph-impl:2.0.1'
compile 'net.sf.jung:jung-algorithms:2.0.1'
compile 'net.sf.jung:jung-visualization:2.0.1'
compile 'org.prefuse:prefuse:beta-20071021'
compile 'jfree:jfreechart:1.0.13'
compile 'junit:junit:4.8.1'
compile 'com.googlecode.aima-java:aima-core:0.10.5'
}
javadoc {
//destinationDir = file(projectDir.toString() + "/../javadoc")
options.header = "Meta-CSP Framework API"
options.author = 'true'
title = "<table><tr><td align=left><a href=\"http://metacsp.org\" target=_blank><img src=img/meta-csp-logo-small.png></a></td><td> </td><td align=left>The Meta-CSP Framework<br><small><i>A Java API for Meta-CSP based reasoning</i></small></td></tr></table>"
copy {
from(projectDir) {
include 'img/*.png'
}
into javadoc.destinationDir
}
}
//create javaDoc jar
task javadocJar (type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
from(projectDir) {
include 'license.txt'
}
}
//create sources jar
task sourceJar (type : Jar) {
classifier = 'sources'
from sourceSets.main.allSource
from(projectDir) {
include 'license.txt'
}
}
//create extra lib jar (Orbital)
//task libJar (type : Jar) {
// def lib = file("lib")
// classifier = 'libs'
// from lib
//}
//publish bin, source and javaDoc to repo
if (Double.parseDouble(GradleVersion.current().getVersion().substring(0,3)) >= 1.6) {
publishing {
publications {
metaCSPFramework(MavenPublication) {
from components.java
//================
//== Modify POM ==
//================
pom.withXml {
asNode().children().last() + {
resolveStrategy = Closure.DELEGATE_FIRST
name 'The MetaCSP Framework'
description 'A Java API for Meta-CSP based reasoning'
url 'http://metacsp.org'
parent {
groupId 'org.sonatype.oss'
artifactId 'oss-parent'
version '7'
}
scm {
url 'http://metacsp.org'
connection 'scm:svn:http://meta-csp-framework.googlecode.com/svn/trunk'
developerConnection 'scm:svn:https://meta-csp-framework.googlecode.com/svn/trunk'
}
licenses {
license {
name 'The MIT License'
url 'http://opensource.org/licenses/mit-license.php'
distribution 'repo'
}
}
developers {
developer {
id 'federico.pecora'
name 'Federico Pecora'
email 'federico.pecora@gmail.com'
}
}
}
}
//====================
//== end Modify POM ==
//====================
artifact (javadocJar) {
classifier = 'javadoc'
}
artifact (sourceJar) {
classifier = 'sources'
}
//artifact (libJar) {
// classifier = 'libs'
//}
}
}
repositories {
maven {
url "file:/${project.projectDir}/artifacts"
}
}
}
}
defaultTasks 'install'