Revert recent changes in gradle build scripts because they cause problems with local compilation

The following commits are reverted:
1be957beb2
ea6df90993
ee588faed5
04648e550e
7aaf249e21
3895d5a1dd
This commit is contained in:
nik
2017-05-02 12:07:06 +03:00
parent 7b6bd863aa
commit 3e313db034
15 changed files with 100 additions and 184 deletions
-1
View File
@@ -8,7 +8,6 @@
<option name="modules">
<set>
<option value="$PROJECT_DIR$/build/dependencies" />
<option value="$PROJECT_DIR$/build/dependencies/buildSrc" />
</set>
</option>
<option name="resolveModulePerSourceSet" value="false" />
-1
View File
@@ -68,7 +68,6 @@
<module fileurl="file://$PROJECT_DIR$/java/debugger/impl/debugger-impl.iml" filepath="$PROJECT_DIR$/java/debugger/impl/debugger-impl.iml" group="java" />
<module fileurl="file://$PROJECT_DIR$/java/debugger/openapi/debugger-openapi.iml" filepath="$PROJECT_DIR$/java/debugger/openapi/debugger-openapi.iml" group="java" />
<module fileurl="file://$PROJECT_DIR$/build/dependencies/dependencies.iml" filepath="$PROJECT_DIR$/build/dependencies/dependencies.iml" />
<module fileurl="file://$PROJECT_DIR$/build/dependencies/buildSrc/buildSrc.iml" filepath="$PROJECT_DIR$/build/dependencies/buildSrc/buildSrc.iml" />
<module fileurl="file://$PROJECT_DIR$/android/designer/designer.iml" filepath="$PROJECT_DIR$/android/designer/designer.iml" group="android" />
<module fileurl="file://$PROJECT_DIR$/plugins/devkit/devkit.iml" filepath="$PROJECT_DIR$/plugins/devkit/devkit.iml" group="plugins" />
<module fileurl="file://$PROJECT_DIR$/plugins/devkit/jps-plugin/devkit-jps-plugin.iml" filepath="$PROJECT_DIR$/plugins/devkit/jps-plugin/devkit-jps-plugin.iml" group="plugins" />
+14
View File
@@ -36,6 +36,20 @@ apply plugin: 'base'
group 'com.intellij.build'
version '1.0'
try {
project.ext.inJetBrainsNetwork = InetAddress.getByName("repo.labs.intellij.net").isReachable(1000)
if (!project.ext.inJetBrainsNetwork && org.gradle.internal.os.OperatingSystem.current().isWindows()) {
project.ext.inJetBrainsNetwork = Runtime.getRuntime().exec("ping -n 1 repo.labs.intellij.net").waitFor() == 0
}
if (!project.ext.inJetBrainsNetwork) {
logger.info('repo.labs.intellij.net is not reachable')
}
}
catch (UnknownHostException e) {
logger.info('repo.labs.intellij.net is not reachable', e)
project.ext.inJetBrainsNetwork = false
}
apply from: 'setupJdk.gradle'
apply from: 'setupJbre.gradle'
apply from: 'setupKotlin.gradle'
-6
View File
@@ -1,6 +0,0 @@
apply plugin: 'idea'
idea {
module {
inheritOutputDirs true
}
}
-47
View File
@@ -1,47 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<module external.linked.project.id="buildSrc" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$/.." external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/groovy" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test/groovy" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<excludeFolder url="file://$MODULE_DIR$/.gradle" />
<excludeFolder url="file://$MODULE_DIR$/build" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="module-library">
<library name="Gradle: gradle-api-2.14">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/caches/2.14/generated-gradle-jars/gradle-api-2.14.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Gradle: groovy-all-2.4.4">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-2.14-all/t7wfomcrmv8dmyii9c9waem8/gradle-2.14/lib/groovy-all-2.4.4.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
<library name="Gradle: gradle-installation-beacon-2.14">
<CLASSES>
<root url="jar://$USER_HOME$/.gradle/wrapper/dists/gradle-2.14-all/t7wfomcrmv8dmyii9c9waem8/gradle-2.14/lib/gradle-installation-beacon-2.14.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$USER_HOME$/.gradle/wrapper/dists/gradle-2.14-all/t7wfomcrmv8dmyii9c9waem8/gradle-2.14/src/installation-beacon" />
</SOURCES>
</library>
</orderEntry>
</component>
</module>
@@ -1,44 +0,0 @@
package org.jetbrains.intellij.build
import groovy.transform.CompileStatic
import org.gradle.api.logging.Logger
import org.gradle.api.logging.Logging
import org.gradle.internal.os.OperatingSystem
@CompileStatic
class DependenciesBuildUtils {
private static final Logger LOG = Logging.getLogger('DependenciesBuild')
private static Boolean isInJetBrainsNetwork = null
static def getInJetBrainsNetwork() {
if (isInJetBrainsNetwork == null) {
try {
isInJetBrainsNetwork = InetAddress.getByName("repo.labs.intellij.net").isReachable(1000)
if (!isInJetBrainsNetwork && OperatingSystem.current().isWindows()) {
isInJetBrainsNetwork = Runtime.runtime.exec("ping -n 1 repo.labs.intellij.net").waitFor() == 0
}
if (!isInJetBrainsNetwork) {
LOG.info('repo.labs.intellij.net is not reachable')
}
}
catch (UnknownHostException e) {
LOG.info('repo.labs.intellij.net is not reachable', e)
isInJetBrainsNetwork = false
}
}
return isInJetBrainsNetwork
}
static def getJdkRepo() {
return inJetBrainsNetwork ? 'http://repo.labs.intellij.net/intellij-jdk' : 'https://dl.bintray.com/jetbrains/intellij-jdk'
}
static def intellijProjectDir(File gradleProjectDir) {
def communityDir = new File(gradleProjectDir, "../..").canonicalFile
return communityDir.name == 'community' ? communityDir.parent : communityDir
}
static def isInUltimateContext(File gradleProjectDir) {
return new File(gradleProjectDir, "../..").canonicalFile.name == 'community'
}
}
@@ -1 +0,0 @@
The java dir is needed for IdeaUltimateProjectStructureTest
@@ -1 +0,0 @@
The java dir is needed for IdeaUltimateProjectStructureTest
@@ -1 +0,0 @@
The java dir is needed for IdeaUltimateProjectStructureTest
@@ -1 +0,0 @@
The java dir is needed for IdeaUltimateProjectStructureTest
@@ -1 +0,0 @@
The java dir is needed for IdeaUltimateProjectStructureTest
+39 -42
View File
@@ -13,49 +13,46 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
buildscript {
repositories {
maven { url "http://repo.labs.intellij.net/plugins-gradle-org/" }
maven { url "https://plugins.gradle.org/m2/" }
task setupAndroidSdk {
if (!inJetBrainsNetwork) {
return
}
dependencies {
classpath "de.undercouch:gradle-download-task:3.2.0"
def zipFile = org.gradle.internal.os.OperatingSystem.current().familyName + ".zip"
def gradleFile = "gradle-3.3-bin.zip"
def archivePath = "$project.buildDir/android-sdk/" + zipFile
def gradlePath = "$project.buildDir/android-sdk/" + gradleFile
def outputDir ="$project.buildDir/android-sdk/prebuilts/studio/sdk"
def outputGradle ="$project.buildDir/android-sdk/tools/external/gradle"
outputs.dir(outputDir)
outputs.dir(outputGradle)
outputs.dir("$project.buildDir/android-sdk/prebuilts/tools/common");
outputs.file(archivePath)
outputs.file(gradlePath)
doFirst {
download {
src "http://repo.labs.intellij.net/thirdparty/android-sdk/" + zipFile
dest archivePath
onlyIfNewer true
}
download {
src "http://repo.labs.intellij.net/thirdparty/gradle/" + gradleFile
dest gradlePath
onlyIfNewer true
}
}
}
apply plugin: "de.undercouch.download"
import de.undercouch.gradle.tasks.download.Download
import org.jetbrains.intellij.build.DependenciesBuildUtils
def currentOs = org.gradle.internal.os.OperatingSystem.current()
task downloadGradleDistribution(type: Download) {
src "http://repo.labs.intellij.net/thirdparty/gradle/gradle-3.3-bin.zip"
dest "$buildDir/android-sdk/gradle-3.3-bin.zip"
onlyIfNewer true
onlyIf { DependenciesBuildUtils.inJetBrainsNetwork }
}
task setupGradleDistribution(dependsOn: downloadGradleDistribution, type: Copy) {
from zipTree(downloadGradleDistribution.outputs.files.singleFile)
into "$buildDir/android-sdk/tools/external/gradle"
}
task downloadAndroidSdk(type: Download) {
def osFamily = currentOs.familyName
src "http://repo.labs.intellij.net/thirdparty/android-sdk/${osFamily}.zip"
dest "$buildDir/android-sdk/${osFamily}.zip"
onlyIfNewer true
onlyIf { !currentOs.isMacOsX() && DependenciesBuildUtils.inJetBrainsNetwork }
}
task setupAndroidSdk(dependsOn: [downloadAndroidSdk, setupGradleDistribution], type: Copy) {
from zipTree(downloadAndroidSdk.outputs.files.singleFile)
into "$buildDir/android-sdk/prebuilts/studio/sdk"
onlyIf { !currentOs.isMacOsX() }
outputs.dir("$buildDir/android-sdk/prebuilts/tools/common")
doLast {
file("$buildDir/android-sdk/prebuilts/tools/common/m2/repository").mkdirs()
file("$buildDir/android-sdk/prebuilts/tools/common/offline-m2").mkdirs()
logger.info("Unpacking android sdk into " + archivePath)
copy {
from zipTree(file(archivePath))
into outputDir
}
copy {
from file(gradlePath)
into outputGradle
}
file("$project.buildDir/android-sdk/prebuilts/tools/common/m2/repository").mkdirs()
file("$project.buildDir/android-sdk/prebuilts/tools/common/offline-m2").mkdirs()
}
}
}
+22 -25
View File
@@ -1,34 +1,31 @@
buildscript {
repositories {
maven { url "http://repo.labs.intellij.net/plugins-gradle-org/" }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "de.undercouch:gradle-download-task:3.2.0"
}
}
apply plugin: "de.undercouch.download"
import de.undercouch.gradle.tasks.download.Download
import org.jetbrains.intellij.build.DependenciesBuildUtils
task setupJbre {}
def jdkRepo = inJetBrainsNetwork ? 'http://repo.labs.intellij.net/intellij-jdk' : 'https://dl.bintray.com/jetbrains/intellij-jdk'
jrePlatformsToDownload(targetOs).each { platform ->
archToDownload(platform).each { arch ->
def jbrexArtifactName = "jbrex8${jdkBuild}_${platform}_$arch"
def jbreArtifactName = "jbre8${jdkBuild}_${platform}_$arch"
task("downloadJbrex_${platform}_$arch", type: Download, group: 'jbre') {
task("downloadJbrex_${platform}_$arch") {
def outputDir = "$project.buildDir/jbre"
def outputFile = "$outputDir/${jbrexArtifactName}_origin.tar.gz"
inputs.property('build', jdkBuild)
src "$DependenciesBuildUtils.jdkRepo/${jbrexArtifactName}.tar.gz"
dest "$buildDir/jbre/${jbrexArtifactName}_origin.tar.gz"
onlyIfNewer true
outputs.file(outputFile)
doLast {
logger.info("Downloading $jbrexArtifactName to $outputFile")
download {
src "$jdkRepo/${jbrexArtifactName}.tar.gz"
dest outputFile
onlyIfNewer true
}
}
}
cleanSetupJbre.dependsOn("cleanDownloadJbrex_${platform}_$arch")
if (org.gradle.internal.os.OperatingSystem.current().isWindows()) {
task("untarJbrex_${platform}_$arch", type: Copy, dependsOn: "downloadJbrex_${platform}_$arch", group: 'jbre') {
task("untarJbrex_${platform}_$arch", type: Copy, dependsOn: "downloadJbrex_${platform}_$arch") {
def downloadOutputs = tasks["downloadJbrex_${platform}_$arch"].outputs.files
from tarTree(downloadOutputs.singleFile), {
exclude 'lib/tools.jar'
@@ -42,7 +39,7 @@ jrePlatformsToDownload(targetOs).each { platform ->
}
}
else {
task("untarJbrex_${platform}_$arch", type: Exec, dependsOn: "downloadJbrex_${platform}_$arch", group: 'jbre') {
task("untarJbrex_${platform}_$arch", type: Exec, dependsOn: "downloadJbrex_${platform}_$arch") {
def downloadOutputs = tasks["downloadJbrex_${platform}_$arch"].outputs.files
def outputDir = "${downloadOutputs.singleFile.absolutePath - '.tar.gz'}"
inputs.file(downloadOutputs.singleFile)
@@ -50,11 +47,11 @@ jrePlatformsToDownload(targetOs).each { platform ->
doFirst { exec { commandLine 'mkdir', '-p', outputDir } }
commandLine 'tar', '-xpf', "${downloadOutputs.singleFile.absolutePath}", '--directory', outputDir
if (platform != 'osx') {
doLast {
exec {
doLast {
exec {
commandLine 'mv', "$outputDir/lib/tools.jar", "$outputDir/jre/lib/"
ignoreExitValue = true
}
}
}
}
}
@@ -73,7 +70,7 @@ def createTarJbreTask(String taskName, String untarTaskName, String platform, St
def dirToTar = platform == 'osx' ? 'jdk' : 'jre'
if (org.gradle.internal.os.OperatingSystem.current().isWindows()) {
task(taskName, type: Tar, group: 'jbre') {
task(taskName, type: Tar) {
def untarOutputs = tasks[untarTaskName].outputs.files
inputs.file(untarOutputs)
from "$untarOutputs.singleFile/$dirToTar"
@@ -87,7 +84,7 @@ def createTarJbreTask(String taskName, String untarTaskName, String platform, St
}
}
else {
task(taskName, type: Exec, group: 'jbre') {
task(taskName, type: Exec) {
def untarOutputs = tasks[untarTaskName].outputs.files
def outputFile = "${untarOutputs.singleFile.parentFile}/${archiveName}.tar.gz"
inputs.files(untarOutputs)
+16 -6
View File
@@ -1,5 +1,3 @@
import org.jetbrains.intellij.build.DependenciesBuildUtils
/*
* Copyright 2000-2016 JetBrains s.r.o.
*
@@ -18,7 +16,9 @@ import org.jetbrains.intellij.build.DependenciesBuildUtils
task setupJdks(dependsOn: ['setupJdk18', 'setupJdk16'])
cleanSetupJdks.dependsOn('cleanSetupJdk18', 'cleanSetupJdk16', 'cleanDownloadJdk18')
def checkoutDir = DependenciesBuildUtils.intellijProjectDir(file('.'))
def jdkRepo = inJetBrainsNetwork ? 'http://repo.labs.intellij.net' : 'https://dl.bintray.com/jetbrains/'
def checkoutDir = intellijProjectDir()
def jdkDir = "$checkoutDir/build/jdk"
project.ext.jdk18OutputDir = "${System.getProperty("intellij.jdk18.output.dir", "$jdkDir/1.8")}"
@@ -35,9 +35,9 @@ task downloadJdk18 {
inputs.property('build', jdkBuild)
outputs.file(outputFile)
doLast {
logger.info("Downloading up JDK 1.8 to compile (using $DependenciesBuildUtils.jdkRepo repo)")
logger.info("Downloading up JDK 1.8 to compile (using $jdkRepo repo)")
download {
src "$DependenciesBuildUtils.jdkRepo/${artifactName}"
src "$jdkRepo/intellij-jdk/${artifactName}"
dest outputFile
onlyIfNewer true
}
@@ -108,7 +108,10 @@ dependencies {
}
task setupJdk16(dependsOn: configurations.jdk16) {
onlyIf { DependenciesBuildUtils.inJetBrainsNetwork }
if (!inJetBrainsNetwork) {
return
}
def jdkArchive = { configurations.jdk16.singleFile }
def outputDir = "$jdkDir/1.6"
inputs.file(jdkArchive)
@@ -131,6 +134,13 @@ private void deleteBrokenSymlink(def outputDir) {
}
}
setupJdk16.onlyIf { inJetBrainsNetwork }
def intellijProjectDir() {
def communityDir = project.file("../..")
communityDir.name == 'community' ? communityDir.parent : communityDir
}
static def jdk16Version() {
def os = org.gradle.internal.os.OperatingSystem.current()
if (os.isWindows()) {
+9 -7
View File
@@ -13,8 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.jetbrains.intellij.build.DependenciesBuildUtils
repositories {
maven {
url 'http://repo.labs.intellij.net/jet-sign'
@@ -30,18 +28,22 @@ dependencies {
}
task setupJetSign(dependsOn: configurations.jetSign) {
if (!inJetBrainsNetwork) {
return
}
def ultimateProjectDir = ultimateProjectDir()
onlyIf { DependenciesBuildUtils.inJetBrainsNetwork && ultimateProjectDir }
if (!ultimateProjectDir) {
return
}
if (!ultimateProjectDir) return
doFirst { logger.info("Setting up JetSign") }
def jetSignJar = { configurations.jetSign.singleFile }
def outputDir = "$ultimateProjectDir/build/lib/"
def outputDir = file("$ultimateProjectDir/build/lib/")
inputs.file(jetSignJar)
outputs.file("$outputDir/jet-sign.jar")
doLast {
logger.info("Setting up JetSign. Copying $jetSignJar to $outputDir")
logger.info("Copying $jetSignJar to $outputDir")
copy {
from file(jetSignJar)
into outputDir