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

Last change on this file since 31811 was 31806, checked in by floscher, 9 years ago

[mapillary] Add changing=true attribute for gradle dependencies that change over time while their filenames don't change

File size: 3.7 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
73/** FindBugs configuration */
74findbugs {
75 toolVersion = "3.0.1"
76 ignoreFailures = true
77 effort = "min"
78 reportLevel = "high"
79}
80tasks.withType(FindBugs) {
81 reports {
82 xml.enabled = false
83 html.enabled = true
84 }
85}
86
87/** JaCoCo configuration */
88jacoco {
89 toolVersion = "0.7.5.201505241946"
90}
91jacocoTestReport {
92 reports {
93 xml.enabled true
94 html.destination "$buildDir/reports/jacoco"
95 }
96}
97
98test {
99 testLogging {
100 exceptionFormat "full"
101 events "started", "passed", "skipped", "failed", "standardOut", "standardError"
102 }
103}
104
105jar {
106 manifest {
107 attributes("Plugin-Mainversion": project.property('plugin.main.version'),
108 "Plugin-Version": "31802",
109 "Plugin-Class": project.property('plugin.class'),
110 "Plugin-Description": project.property('plugin.description'),
111 "Plugin-Date": String.format("%1\$tY-%1\$tm-%1\$tdT%1\$tH:%1\$tM:%1\$tS%1\$tz", new GregorianCalendar()),
112 "Author": project.property('plugin.author'),
113 "Plugin-Link": project.property('plugin.link'),
114 "Plugin-Icon": project.property("plugin.icon"),
115 "Plugin-Requires": project.property("plugin.requires"),
116 "Plugin-Canloadatruntime": project.property('plugin.canloadatruntime'))
117 }
118}
119
120task activatePlugin(type: Copy) {
121 from "gradle/josm-preferences.xml"
122 into "$buildDir/.josm"
123 rename 'josm-preferences.xml', 'preferences.xml'
124}
125
126task installPlugin(type: Copy) {
127 from "$buildDir/libs/${project.name}.jar"
128 from configurations.runtime
129 into "$buildDir/.josm/plugins"
130 include 'apache*.jar'
131 include "${project.name}.jar"
132 rename "${project.name}.jar", 'Mapillary.jar'
133 rename 'apache-(.*)-.*.jar', 'apache-$1.jar'
134}
135installPlugin.dependsOn jar
136installPlugin.dependsOn activatePlugin
137
138/**
139 * This runs the JOSM-version specified in the dependency configuration above.
140 * The home-directory of this JOSM is located in $buildDir/.josm, so it doesn't interfere with any other JOSM-installations.
141 */
142task runJosm(type: JavaExec) {
143 classpath = sourceSets.main.runtimeClasspath
144 main = 'JOSM'
145 args '--offline=josm_website'
146 jvmArgs "-Djosm.home=$buildDir/.josm"
147}
148runJosm.dependsOn installPlugin
Note: See TracBrowser for help on using the repository browser.