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

Last change on this file since 32039 was 31977, checked in by floscher, 9 years ago

[mapillary] Release version 1.1.4

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
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 // When using a numeric version number you can leave out {changing=true}.
32 compile(':josm:latest'){changing=true}
33 // For plugins it's irrelevant, which version is specified, always the latest version is used.
34 compile (':apache-commons:latest'){changing=true}
35 compile (':apache-http:latest'){changing=true}
36
37 testCompile 'junit:junit:4.12'
38}
39
40sourceSets {
41 main {
42 java {
43 srcDirs = ['src']
44 }
45 resources {
46 srcDirs = ["$projectDir"]
47 include 'data/**'
48 include 'images/**'
49 include 'README'
50 include 'GPL-v*.txt'
51 }
52 }
53 test {
54 java {
55 srcDirs = ['test/unit']
56 }
57 resources{
58 srcDirs = ['test/data']
59 }
60 }
61}
62
63eclipse {
64 project {
65 name = 'JOSM-Mapillary'
66 natures 'org.sonarlint.eclipse.core.sonarlintNature'
67 }
68}
69
70build.dependsOn jacocoTestReport
71build.dependsOn projectReport
72
73tasks.withType(Javadoc) {
74 failOnError false
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 manifest {
111 attributes(
112 "Gradle-Version": project.getGradle().getGradleVersion(),
113 "Created-By": System.getProperty("java.version")+" ("+System.getProperty("java.vendor")+")",
114 "Plugin-Mainversion": project.property('plugin.main.version'),
115 "Plugin-Version": project.property('plugin.svnrevision'),
116 "Plugin-SemVersion": project.property('plugin.version'),
117 "Plugin-Class": project.property('plugin.class'),
118 "Plugin-Description": project.property('plugin.description'),
119 "Plugin-Date": String.format("%1\$tY-%1\$tm-%1\$tdT%1\$tH:%1\$tM:%1\$tS%1\$tz", new GregorianCalendar()),
120 "Author": project.property('plugin.author'),
121 "Plugin-Link": project.property('plugin.link'),
122 "Plugin-Icon": project.property("plugin.icon"),
123 "Plugin-Requires": project.property("plugin.requires"),
124 "Plugin-Canloadatruntime": project.property('plugin.canloadatruntime')
125 )
126 }
127}
128
129task activatePlugin(type: Copy) {
130 from "gradle/josm-preferences.xml"
131 into "$buildDir/.josm"
132 rename 'josm-preferences.xml', 'preferences.xml'
133}
134
135task installPlugin(type: Copy) {
136 from "$buildDir/libs/${project.name}.jar"
137 from configurations.runtime
138 into "$buildDir/.josm/plugins"
139 include 'apache*.jar'
140 include "${project.name}.jar"
141 rename "${project.name}.jar", 'Mapillary.jar'
142 rename 'apache-(.*)-.*.jar', 'apache-$1.jar'
143}
144installPlugin.dependsOn jar
145installPlugin.dependsOn activatePlugin
146
147/**
148 * This runs the JOSM-version specified in the dependency configuration above.
149 * The home-directory of this JOSM is located in $buildDir/.josm, so it doesn't interfere with any other JOSM-installations.
150 */
151task runJosm(type: JavaExec) {
152 classpath = sourceSets.main.runtimeClasspath
153 main = 'JOSM'
154 args '--offline=josm_website'
155 jvmArgs "-Djosm.home=$buildDir/.josm"
156}
157runJosm.dependsOn installPlugin
Note: See TracBrowser for help on using the repository browser.