-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.gradle
95 lines (76 loc) · 2.25 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
import java.time.Instant
import java.time.ZoneOffset
import java.time.format.DateTimeFormatter
plugins {
id "org.jetbrains.intellij" version "1.17.4"
}
allprojects {
apply plugin: 'idea'
apply plugin: 'org.jetbrains.intellij'
apply plugin: 'java'
def String DEVELOP = "Develop"
def branch = gitBranch()
def ijPluginRepoChannel = branch.startsWith("release/") ? "" : DEVELOP
if (ijPluginRepoChannel.equalsIgnoreCase(DEVELOP)) {
version = DateTimeFormatter.ofPattern("yyyyMMdd.HHmmss").withZone(ZoneOffset.UTC).format(Instant.now())
} else {
// format is: release/{plugin_version}
def branchParts = branch.split("/")
version = branchParts[1]
}
configurations {
gen
}
repositories {
// mavenLocal()
mavenCentral()
maven {
url 'https://oss.sonatype.org/content/repositories/snapshots'
}
maven {
url "https://repository.mulesoft.org/releases/"
}
maven {
url "https://repository.mulesoft.org/snapshots/"
}
maven {
url "https://repository.mulesoft.org/nexus/content/repositories/releases"
}
maven {
name "jitpack"
url "https://jitpack.io"
}
}
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
tasks.withType(JavaCompile) { options.encoding = 'UTF-8' }
group = 'org.mule.tooling.intellij'
task jarSources(type: Jar) {
from sourceSets.main.allSource
classifier = 'sources'
}
intellij {
version = ideaVersion
updateSinceUntilBuild = true
downloadSources = true
}
publishPlugin {
token = System.getenv('IJ_TOKEN')
channels = [ijPluginRepoChannel]
}
assemble.dependsOn jarSources
}
def gitBranch() {
def ciBranch = System.getenv("BRANCH_NAME")
if (ciBranch != null) {
ciBranch
} else {
def workingDir = new File("${project.projectDir}/")
def branch = ""
def proc = "git rev-parse --abbrev-ref HEAD".execute(null, workingDir)
proc.in.eachLine { line -> branch = line }
proc.err.eachLine { line -> println line }
proc.waitFor()
branch
}
}