source: osm/applications/editors/josm/plugins/mapillary/build.gradle@ 31799

Last change on this file since 31799 was 31799, checked in by floscher, 11 years ago

[mapillary] More sonar issues resolved, some tests added and v1.1.0 released

File size: 3.6 KB
Line 
1apply plugin: 'eclipse'
2apply plugin: 'findbugs'
3apply plugin: 'jacoco'
4apply plugin: 'java'
5apply plugin: 'project-report'
6
7sourceCompatibility = '1.7'
8
9repositories {
10 // for JUnit
11 mavenCentral()
12 //for josm-(latest|tested).jar
13 ivy {
14 url 'https://josm.openstreetmap.de/download'
15 layout 'pattern', {
16 artifact "[artifact]-[revision].jar"
17 artifact "[artifact]-snapshot-[revision].jar"
18 artifact "Archiv/[artifact]-snapshot-[revision].jar"
19 }
20 }
21 //for josm-plugins
22 ivy {
23 url "https://svn.openstreetmap.org/applications/editors/josm/dist/"
24 layout "pattern", {
25 artifact "[artifact].jar"
26 }
27 }
28}
29dependencies {
30 // The JOSM-version can be specified as "latest", "tested" or the numeric version number.
31 compile ':josm:latest'
32 // For plugins it's irrelevant, which version is specified, always the latest version is used.
33 compile ':apache-commons:latest'
34 compile ':apache-http:latest'
35
36 testCompile 'junit:junit:4.12'
37}
38
39sourceSets {
40 main {
41 java {
42 srcDirs = ['src']
43 }
44 resources {
45 srcDirs = ["$projectDir"]
46 include 'data/**'
47 include 'images/**'
48 include 'README'
49 include 'GPL-v*.txt'
50 }
51 }
52 test {
53 java {
54 srcDirs = ['test/unit']
55 }
56 resources{
57 srcDirs = ['test/data']
58 }
59 }
60}
61
62eclipse {
63 project {
64 name = 'JOSM-Mapillary'
65 natures 'org.sonarlint.eclipse.core.sonarlintNature'
66 }
67}
68
69build.dependsOn jacocoTestReport
70build.dependsOn projectReport
71
72/** FindBugs configuration */
73findbugs {
74 toolVersion = "3.0.1"
75 ignoreFailures = true
76 effort = "min"
77 reportLevel = "high"
78}
79tasks.withType(FindBugs) {
80 reports {
81 xml.enabled = false
82 html.enabled = true
83 }
84}
85
86/** JaCoCo configuration */
87jacoco {
88 toolVersion = "0.7.5.201505241946"
89}
90jacocoTestReport {
91 reports {
92 xml.enabled true
93 html.destination "$buildDir/reports/jacoco"
94 }
95}
96
97test {
98 testLogging {
99 exceptionFormat "full"
100 events "started", "passed", "skipped", "failed", "standardOut", "standardError"
101 }
102}
103
104jar {
105 manifest {
106 attributes("Plugin-Mainversion": project.property('plugin.main.version'),
107 "Plugin-Version": "31799",
108 "Plugin-Class": project.property('plugin.class'),
109 "Plugin-Description": project.property('plugin.description'),
110 "Plugin-Date": String.format("%1\$tY-%1\$tm-%1\$tdT%1\$tH:%1\$tM:%1\$tS%1\$tz", new GregorianCalendar()),
111 "Author": project.property('plugin.author'),
112 "Plugin-Link": project.property('plugin.link'),
113 "Plugin-Icon": project.property("plugin.icon"),
114 "Plugin-Requires": project.property("plugin.requires"),
115 "Plugin-Canloadatruntime": project.property('plugin.canloadatruntime'))
116 }
117}
118
119task activatePlugin(type: Copy) {
120 from "gradle/josm-preferences.xml"
121 into "$buildDir/.josm"
122 rename 'josm-preferences.xml', 'preferences.xml'
123}
124
125task installPlugin(type: Copy) {
126 from "$buildDir/libs/${project.name}.jar"
127 from configurations.runtime
128 into "$buildDir/.josm/plugins"
129 include 'apache*.jar'
130 include "${project.name}.jar"
131 rename "${project.name}.jar", 'Mapillary.jar'
132 rename 'apache-(.*)-.*.jar', 'apache-$1.jar'
133}
134installPlugin.dependsOn jar
135installPlugin.dependsOn activatePlugin
136
137/**
138 * This runs the JOSM-version specified in the dependency configuration above.
139 * The home-directory of this JOSM is located in $buildDir/.josm, so it doesn't interfere with any other JOSM-installations.
140 */
141task runJosm(type: JavaExec) {
142 classpath = sourceSets.main.runtimeClasspath
143 main = 'JOSM'
144 args '--offline=josm_website'
145 jvmArgs "-Djosm.home=$buildDir/.josm"
146}
147runJosm.dependsOn installPlugin
Note: See TracBrowser for help on using the repository browser.