forked from kamiiiel/asm-intellij-plugin
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle
122 lines (100 loc) · 3.08 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
plugins {
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'java'
id "org.jetbrains.intellij" version "1.16.1"
}
group 'org.objectweb.asm.idea.action'
if(System.env.VERSION != null) {
version "${System.env.VERSION}"
} else {
version 'dev'
}
var asm_version = '9.6'
sourceCompatibility='17'
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
implementation "org.ow2.asm:asm:${asm_version}"
implementation "org.ow2.asm:asm-commons:${asm_version}"
implementation "org.ow2.asm:asm-util:${asm_version}"
}
shadowJar {
archiveClassifier = null
relocate('org.objectweb', 'reloc.org.objectweb')
}
tasks.withType(JavaCompile) {
options.compilerArgs += ['-Xlint:deprecation']
}
intellij {
pluginName = 'ASM Viewer'
version = "IC-233.11799.300"
downloadSources = false
updateSinceUntilBuild = false
sandboxDir = '.sandbox'
plugins = ['com.intellij.java']
}
jar.enabled = false
jar.dependsOn shadowJar
var ideaSince = 233
var ideaUntil = 233
// this is the list of the IDES we want to support
// IIC - IntelliJ Community
// IIU - IntelliJ Ultimate
var supportPlatforms = ["IIC", "IIU"]
patchPluginXml {
version = project.version
sinceBuild = "${ideaSince}"
untilBuild = "${ideaUntil}.*"
// changeNotes = file('changeNotes.txt').text
// pluginDescription = file('description.txt').text
}
publishPlugin {
token = "${System.env.JETBRAINS_TOKEN}"
}
/**
* Process the current versions of the IDEs and find the versions we want to verify.
*/
def findVersion = () -> {
def parser = new groovy.json.JsonSlurper()
def json = parser.parseText(new URI("https://data.services.jetbrains.com/products?code=" + supportPlatforms.join('%2C')
+ "&fields=code%2Cname%2Creleases.version%2Creleases.build%2Creleases.type").toURL().text)
def releases = []
json.each { item ->
def rels = [:]
item.releases.each { rel ->
if (rel.type == "release") {
def parts = rel.build.split("\\.")
def major = parts[0] as int
if (major >= ideaSince && major <= ideaUntil) {
def existing = rels[major]
if (existing == null) {
rels[major] = rel
} else {
def extParts = existing.build.split("\\.")
if (extParts[1] == parts[1]) {
if (extParts[2] < parts[2]) {
rels[major] = rel
}
} else if (extParts[1] < parts[1]) {
rels[major] = rel
}
}
}
}
}
rels.values().each { rel ->
releases.add(item.code + "-" + rel.build)
}
}
releases
}
tasks.register('findVersion') {
new File(projectDir, "version.json").text = findVersion()
}
// https://github.com/JetBrains/gradle-intellij-plugin#plugin-verifier-dsl
runPluginVerifier {
// Example config:
ideVersions = [verifyVersion]
}