Files
openide/build/scripts/unpackJdks.gant
Alexander Zolotov 65f055aadd Manage external dependencies of IntellIJ project sources via Gradle (IDEA-162511)
- add dependencies module
- download and unpack JBSDK
- download and unpack Java 1.6
- download and unpack Kotlin
- download and unpack JetSign
- download JBREX and creating JBRE
- use Gradle dependencies while building IDE and while developer's
  updating
2017-04-04 20:34:38 +03:00

37 lines
1.5 KiB
Plaintext

import static org.jetbrains.jps.idea.IdeaProjectLoader.guessHome
/*
* Copyright 2000-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
includeTargets << new File("${guessHome(this)}/build/scripts/utils.gant")
target(default: "Unpack JDKs") {
def workingDirectory = getDependenciesProjectDir()
def gradleScript = System.getProperty('os.name').toLowerCase().contains('windows') ? "gradlew.bat" : "gradlew"
def process = new ProcessBuilder("${workingDirectory.absolutePath}/$gradleScript", 'setupJdks', '--stacktrace', '--info')
.directory(workingDirectory)
.start()
process.consumeProcessOutputStream((OutputStream)System.out)
process.consumeProcessErrorStream((OutputStream)System.err)
process.waitFor()
if (process.exitValue() != 0) {
projectBuilder.error("Cannot unpack JDK")
}
}
private File getDependenciesProjectDir() {
return new File(home, new File(home).name == "community" ? "build/dependencies" : "community/build/dependencies")
}