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

Last change on this file since 31420 was 31420, checked in by nokutu, 9 years ago

Fix build.gradle

File size: 4.0 KB
Line 
1apply plugin: 'eclipse'
2apply plugin: 'findbugs'
3apply plugin: 'jacoco'
4apply plugin: 'java'
5apply plugin: 'project-report'
6
7sourceCompatibility = '1.7'
8
9configurations {
10 packIntoJar
11 compile.extendsFrom packIntoJar
12}
13repositories {
14 // for JUnit
15 mavenCentral()
16 // for commons-imaging
17 maven {
18 url "https://repository.apache.org/content/repositories/snapshots/"
19 }
20 // for scribe-java
21 maven {
22 url "https://raw.github.com/fernandezpablo85/scribe-java/mvn-repo/"
23 }
24 //for josm-(latest|tested).jar
25 ivy {
26 url "https://josm.openstreetmap.de/download/"
27 layout "pattern", {
28 artifact "[artifact]-[revision].jar"
29 }
30 }
31}
32dependencies {
33 // The JOSM-version can be specified as "latest", "tested" or "snapshot-1234" (replace 1234 by the desired version numbers).
34 // For revisions older than the last ~60 versions, also append "Archiv" to the repository URL above
35 packIntoJar 'org.scribe:scribe:1.3.7'
36
37 compile 'org.openstreetmap.josm:josm:latest'
38 compile 'org.apache.commons:commons-imaging:1.0-SNAPSHOT'
39
40 testCompile 'junit:junit:4.12'
41}
42
43sourceSets {
44 main {
45 java {
46 srcDirs = ['src']
47 }
48 resources {
49 srcDirs = ["$projectDir"]
50 include 'data/**'
51 include 'images/**'
52 include 'README'
53 include 'GPL-v*.txt'
54 }
55 }
56 test {
57 java {
58 srcDirs = ['test/unit']
59 }
60 resources{
61 srcDirs = ['test/data']
62 }
63 }
64}
65
66build.dependsOn jacocoTestReport
67build.dependsOn projectReport
68
69/** Eclipse configuration */
70eclipse {
71 classpath {
72 downloadSources=true
73 downloadJavadoc=true
74 }
75}
76
77/** FindBugs configuration */
78findbugs {
79 toolVersion = "3.0.1"
80 ignoreFailures = true
81 effort = "min"
82 reportLevel = "high"
83}
84tasks.withType(FindBugs) {
85 reports {
86 xml.enabled = false
87 html.enabled = true
88 }
89}
90
91/** JaCoCo configuration */
92jacoco {
93 toolVersion = "0.7.5.201505241946"
94}
95jacocoTestReport {
96 reports {
97 xml.enabled true
98 html.destination "$buildDir/reports/jacoco"
99 }
100}
101
102test {
103 testLogging {
104 exceptionFormat "full"
105 events "started", "passed", "skipped", "failed", "standardOut", "standardError"
106 }
107}
108
109jar {
110 from zipTree(configurations.packIntoJar.singleFile)
111 manifest {
112 attributes("Plugin-Mainversion": "8433",
113 "Plugin-Version": "31395",
114 "Plugin-Class": "org.openstreetmap.josm.plugins.mapillary.MapillaryPlugin",
115 "Plugin-Description": "Enables user to work with pictures hosted at mapillary.com",
116 "Plugin-Date": String.format("%1\$tY-%1\$tm-%1\$tdT%1\$tH:%1\$tM:%1\$tS%1\$tz", new GregorianCalendar()),
117 "Author": "nokutu <nokutu@openmailbox.org>",
118 "Plugin-Link": "https://wiki.openstreetmap.org/wiki/JOSM/Plugins/Mapillary",
119 "Plugin-Icon": "images/icon24.png",
120 "Plugin-Requires": "commons-imaging",
121 "Plugin-Canloadatruntime": "true")
122 }
123}
124
125/**
126 * The following are tasks to directly run JOSM with the freshly-built
127 * Mapillary-plugin already installed.
128 * Only prerequisite is to have JOSM (or JOSM-latest) installed on your machine.
129 * Previously installed versions of the plugin are overridden by executions of these tasks.
130 **/
131
132task installPluginToJosm(type: Copy) {
133 from "$buildDir/libs/josm-mapillary-plugin.jar"
134 into "$System.env.HOME/.josm/plugins"
135 rename '.*', 'Mapillary.jar'
136}
137installPluginToJosm.dependsOn jar
138
139task runJosm(type: Exec) {
140 commandLine 'josm'
141}
142runJosm.dependsOn installPluginToJosm
143
144task installPluginToJosmLatest(type: Copy) {
145 from "$buildDir/libs/josm-mapillary-plugin.jar"
146 into "$System.env.HOME/.josm-latest/plugins"
147 rename '.*', 'Mapillary.jar'
148}
149installPluginToJosmLatest.dependsOn jar
150
151task runJosmLatest(type: Exec) {
152 commandLine 'josm-latest'
153}
154runJosmLatest.dependsOn installPluginToJosmLatest
155
156/** Wrapper task:
157 * This only needs to be run once when the Gradle version changes.
158 * The changed files (probably in the gradle/-folder) should then be commited to CVS.
159 */
160task wrapper(type: Wrapper) {
161 gradleVersion = '2.5'
162}
Note: See TracBrowser for help on using the repository browser.