forked from iandees/josm-geojson
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathbuild.gradle
98 lines (85 loc) · 2.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
plugins {
id "de.undercouch.download" version "2.0.0"
}
apply from: 'dependencies.gradle'
apply plugin: 'java'
apply plugin: 'checkstyle'
checkstyle {
toolVersion = "6.0"
}
group = 'org.openstreetmap.josm.plugins'
version = '0.0.0-SNAPSHOT'
// Change JOSM version (if needed) before you build
project.ext.josm_version='10504'
project.ext.josm_location='download'
//project.ext.josm_location='download/Archiv'
sourceCompatibility=1.8
targetCompatibility=1.8
repositories
{ mavenCentral() }
dependencies
{
// Josm is not on Maven Central
compile files("lib/josm-snapshot-" + josm_version +".jar")
compile packages.geojsonjackson
compile packages.jackson.core
compile packages.jackson.databind
compile packages.jackson.annotations
testCompile packages.junit
}
jar
{
from{
configurations.compile.findAll
{
it.name != "josm-snapshot-${josm_version}.jar"
}.collect
{
it.isDirectory() ? it : zipTree(it).matching{
exclude
{
it.path.contains('META-INF') && (it.path.endsWith('.SF') || it.path.endsWith('.DSA') || it.path.endsWith('.RSA'))
}
}
}
}
manifest
{
attributes("Author": "Ian Dees and matthieun and Victor Ramirez",
"Plugin-Class": "org.openstreetmap.josm.plugins.geojson.GeoJsonPlugin",
"Plugin-Date": "2015-06-07T23:12:29.582966Z",
"Plugin-Description": "Allows you to view a GeoJSON file as a layer.",
"Plugin-Icon": "images/preferences/geojson.png",
"Plugin-Link": "http://wiki.openstreetmap.org/index.php/JOSM/Plugins/GeoJSON",
"Plugin-Mainversion": "7777",
"Plugin-Version": "31241",
"Plugin-Canloadatruntime": "true",
)
}
}
import de.undercouch.gradle.tasks.download.Download
task josm(type: Download) {
def folder = new File( 'lib' )
if( !folder.exists() ) {
folder.mkdirs()
}
src "http://josm.openstreetmap.de/${josm_location}/josm-snapshot-${josm_version}.jar"
dest folder
}
import org.gradle.internal.os.OperatingSystem
task installPlugin(type: Copy, dependsOn: jar) {
def destStr
if(OperatingSystem.current().isMacOsX()) {
destStr = "${System.getProperty('user.home')}/Library/JOSM/plugins"
} else if(OperatingSystem.current().isWindows()) {
destStr = "${System.getenv()['APPDATA']}/JOSM/plugins"
} else {
destStr = "${System.getProperty('user.home')}/.josm/plugins"
}
println(jar.archivePath)
from jar.archivePath
into destStr
rename {
'geojson.jar'
}
}