forked from JetBrains/intellij-community
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetupToolboxLiteGen.gradle
59 lines (48 loc) · 2.12 KB
/
setupToolboxLiteGen.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
// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
buildscript {
repositories {
maven { url "https://cache-redirector.jetbrains.com/plugins.gradle.org" }
}
dependencies {
classpath "de.undercouch:gradle-download-task:3.2.0"
}
}
apply plugin: "de.undercouch.download"
import de.undercouch.gradle.tasks.download.Download
//see https://buildserver.labs.intellij.net/viewType.html?buildTypeId=JetBrainsToolbox_Feed_PublishLiteGen&branch_JetBrainsToolbox_Feed=%3Cdefault%3E&tab=buildTypeStatusDiv
String liteGenVersion = project.findProperty('intellij.build.toolbox.litegen.version') ?: '___LITEGEN_VERSION_IS_NOT_SET_IN_PARAMETERS___'
File liteGenZipFile = new File(buildDir, "toolbox-lite-gen/lite-gen-${liteGenVersion}.zip")
File liteGenDir = new File(buildDir, "toolbox-lite-gen/lite-gen-${liteGenVersion}")
File liteGenApp = new File(buildDir, "toolbox-lite-gen/lite-gen-${liteGenVersion}/jetbrains-toolbox-litegen/bin/lite")
task downloadToolboxLiteGen(type: Download) {
src "https://repo.labs.intellij.net/toolbox/lite-gen/lite-gen-${liteGenVersion}.zip"
dest liteGenZipFile
onlyIfNewer true
doFirst {
liteGenZipFile.parentFile.mkdirs()
}
}
task setupToolboxLiteGen(dependsOn: [downloadToolboxLiteGen], type: Sync) {
inputs.file liteGenZipFile
from zipTree(liteGenZipFile)
into liteGenDir
}
//the task is executed from {@link BuildTaskImpl}, not intended to run explicitly
task runToolboxLiteGen(dependsOn:[setupToolboxLiteGen], type: Exec) {
String outputDir = project.findProperty('intellij.build.output')
String artifactsDir = project.findProperty('intellij.build.artifacts')
String productCode = project.findProperty('intellij.build.productCode')
String isEAP = project.findProperty('intellij.build.isEAP')
String[] actualArgs = [
"/artifacts-dir=$artifactsDir",
"/product-code=$productCode",
"/isEAP=$isEAP",
"/output-dir=$outputDir"
]
doFirst {
println "Running Toolbox LiteGen: $liteGenApp with ${actualArgs.join(' ')}"
}
workingDir buildDir
executable "$liteGenApp"
args actualArgs
}