-
Notifications
You must be signed in to change notification settings - Fork 8
/
build.gradle
91 lines (74 loc) · 2.32 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
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.+'
}
}
plugins {
id 'java'
id 'maven-publish'
id 'com.palantir.git-version' version '0.12.2'
}
// This is weird, but I can't seem to get at the plugin the other way
apply plugin: 'com.jfrog.bintray'
group 'info.journeymap'
if (project.hasProperty("production")) {
version release
} else {
def details = versionDetails()
version "${release}-${details.gitHash}"
}
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
task webpack(type: Exec) {
inputs.file("package.json")
inputs.file("yarn.lock")
inputs.file("webpack.config.js")
inputs.dir("$projectDir/src/main/js")
inputs.dir("$projectDir/src/main/css")
inputs.dir("$projectDir/src/main/images")
inputs.dir("$projectDir/src/main/resources")
outputs.dir("$projectDir/src/main/resources/assets/journeymap/web/bundled")
if (org.gradle.internal.os.OperatingSystem.current().isWindows()) {
commandLine "cmd", "/c", "yarn", "run", "build"
} else {
commandLine "yarn", "run", "build"
}
}
tasks.processResources.dependsOn webpack
jar {
manifest {
attributes = ["Manifest-Version" : "1.0",
"Implementation-Title" : "JourneyMap Web-Client",
"Implementation-Version": project.release
]
}
}
clean.doFirst {
// Remove the Webpack bundled assets as part of the clean task
delete "$projectDir/src/main/resources/assets/journeymap/web/bundled"
}
def bintrayUser = project.findProperty("bintray.user") ?: System.getenv("BINTRAY_USER")
def bintrayKey = project.findProperty("bintray.password") ?: System.getenv("BINTRAY_PASSWORD")
publishing {
repositories {
maven {
name = "JourneyMap"
url = uri("https://jm.gserv.me/repository/maven-snapshots/")
credentials {
username = project.findProperty("journeymap.user") ?: System.getenv("JOURNEYMAP_USER")
password = project.findProperty("journeymap.password") ?: System.getenv("JOURNEYMAP_PASSWORD")
}
version = project.release
}
}
publications {
maven(MavenPublication) {
from(components.java)
}
}
}