move gant to community, first try for community tests build
authorMaxim Shafirov <max@jetbrains.com>
Thu, 3 Sep 2009 14:14:04 +0000 (18:14 +0400)
committerMaxim Shafirov <max@jetbrains.com>
Thu, 3 Sep 2009 14:14:04 +0000 (18:14 +0400)
28 files changed:
.idea/libraries/Gant.xml [new file with mode: 0644]
.idea/misc.xml
.idea/modules.xml
.idea/runConfigurations/IDEA.xml
build/build.iml [new file with mode: 0644]
build/gant.xml [new file with mode: 0644]
build/lib/gant/README_Install.txt [moved from build/lib/gant-1.7.0/README_Install.txt with 100% similarity]
build/lib/gant/README_Tests.txt [moved from build/lib/gant-1.7.0/README_Tests.txt with 100% similarity]
build/lib/gant/bin/gant [moved from build/lib/gant-1.7.0/bin/gant with 100% similarity]
build/lib/gant/bin/gant.bat [moved from build/lib/gant-1.7.0/bin/gant.bat with 100% similarity]
build/lib/gant/bin/startGroovy [moved from build/lib/gant-1.7.0/bin/startGroovy with 100% similarity]
build/lib/gant/bin/startGroovy.bat [moved from build/lib/gant-1.7.0/bin/startGroovy.bat with 100% similarity]
build/lib/gant/conf/gant-starter.conf [moved from build/lib/gant-1.7.0/conf/gant-starter.conf with 100% similarity]
build/lib/gant/lib/ant-1.7.1.jar [moved from build/lib/gant-1.7.0/lib/ant-1.7.1.jar with 100% similarity]
build/lib/gant/lib/ant-junit-1.7.1.jar [moved from build/lib/gant-1.7.0/lib/ant-junit-1.7.1.jar with 100% similarity]
build/lib/gant/lib/ant-launcher-1.7.1.jar [moved from build/lib/gant-1.7.0/lib/ant-launcher-1.7.1.jar with 100% similarity]
build/lib/gant/lib/commons-cli-1.2.jar [moved from build/lib/gant-1.7.0/lib/commons-cli-1.2.jar with 100% similarity]
build/lib/gant/lib/gant-1.7.0_groovy-1.6.4.jar [moved from build/lib/gant-1.7.0/lib/gant-1.7.0_groovy-1.6.4.jar with 100% similarity]
build/lib/gant/lib/groovy-all-1.6.4.jar [moved from build/lib/gant-1.7.0/lib/groovy-all-1.6.4.jar with 100% similarity]
build/lib/gant/lib/ivy-2.1.0-rc2.jar [moved from build/lib/gant-1.7.0/lib/ivy-2.1.0-rc2.jar with 100% similarity]
build/lib/gant/lib/jline-0.9.94.jar [moved from build/lib/gant-1.7.0/lib/jline-0.9.94.jar with 100% similarity]
build/lib/gant/lib/jps.jar [moved from build/lib/gant-1.7.0/lib/jps.jar with 100% similarity]
build/lib/gant/lib/junit-4.6.jar [moved from build/lib/gant-1.7.0/lib/junit-4.6.jar with 100% similarity]
build/lib/gant/lib/maven-ant-tasks-2.0.10.jar [moved from build/lib/gant-1.7.0/lib/maven-ant-tasks-2.0.10.jar with 100% similarity]
build/lib/gant/src.zip [new file with mode: 0644]
build/scripts/common_tests.gant [new file with mode: 0644]
build/scripts/tests.gant [new file with mode: 0644]
build/scripts/utils.gant [new file with mode: 0644]

diff --git a/.idea/libraries/Gant.xml b/.idea/libraries/Gant.xml
new file mode 100644 (file)
index 0000000..9a9b53f
--- /dev/null
@@ -0,0 +1,12 @@
+<component name="libraryTable">
+  <library name="Gant">
+    <CLASSES>
+      <root url="file://$PROJECT_DIR$/build/lib/gant/lib" />
+    </CLASSES>
+    <JAVADOC />
+    <SOURCES>
+      <root url="jar://$PROJECT_DIR$/build/lib/gant/src.zip!/main/groovy" />
+    </SOURCES>
+    <jarDirectory url="file://$PROJECT_DIR$/build/lib/gant/lib" recursive="false" />
+  </library>
+</component>
\ No newline at end of file
index 799d1bde29603de3bbc05ba9964acf7f9347d466..a202b06df5dd4c599a45952039374cc154afee5b 100644 (file)
@@ -1,34 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project relativePaths="false" version="4">
-  <component name="BuildServerSettings">
-    <option name="HISTORY" value="" />
-    <option name="LOGIN" value="" />
-    <option name="SERVER_URL" value="http://buildserver" />
-    <option name="PASSWORD" />
-    <option name="REMEMBER_ME" value="true" />
-    <option name="USE_IDEA_PROXY_SETTINGS" value="true" />
-    <option name="INSPECTIONS_BUILD_TYPE_NAME" />
-    <option name="INSPECTIONS_PROJECT_ID" />
-    <option name="INSPECTIONS_BUILD_TYPE_ID" />
-    <option name="DUPLICATES_BUILD_TYPE_NAME" />
-    <option name="DUPLICATES_PROJECT_ID" />
-    <option name="DUPLICATES_BUILD_TYPE_ID" />
-    <option name="PERFORM_COMMIT_IF_SUCCESSFUL" value="true" />
-    <option name="PERFORM_COMMIT_IF_NO_NEW_FAILED_TESTS" value="false" />
-    <option name="REQUEST_CONFIRMATON" value="false" />
-    <option name="PRE_TESTED_COMMIT" value="true" />
-    <option name="STATUS_DIALOG_SPLITTER_PROPORTION" value="0.8" />
-    <option name="FILTER_BY_USER" value="true" />
-    <option name="FILTER_REMOTE_RUN_TREE" value="false" />
-    <option name="FILTER_BY_STATUS" value="false" />
-    <option name="SHOW_CLOSE_PROMPT" value="true" />
-  </component>
   <component name="DependencyValidationManager">
     <option name="SKIP_IMPORT_STATEMENTS" value="false" />
   </component>
-  <component name="InspectionPassRegistrar">
-    <option name="LOAD_NEW_PROBLEMS" value="true" />
-  </component>
   <component name="JavadocGenerationManager">
     <option name="OUTPUT_DIRECTORY" />
     <option name="OPTION_SCOPE" value="protected" />
@@ -49,6 +23,9 @@
   <component name="ProjectDetails">
     <option name="projectName" value="idea-community" />
   </component>
+  <component name="ProjectKey">
+    <option name="state" value="$PROJECT_DIR$/.idea/misc.xml" />
+  </component>
   <component name="ProjectRootManager" version="2" languageLevel="JDK_1_5" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/out" />
   </component>
index 07e4f0d9a54a76036563f14ec01f3440c80f1f1c..7c2d48af58ab4b900ae8cad4025785511a7cd6a3 100644 (file)
@@ -6,6 +6,7 @@
       <module fileurl="file://$PROJECT_DIR$/plugins/ant/ant.iml" filepath="$PROJECT_DIR$/plugins/ant/ant.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/platform/boot/boot.iml" filepath="$PROJECT_DIR$/platform/boot/boot.iml" group="platform" />
       <module fileurl="file://$PROJECT_DIR$/platform/bootstrap/bootstrap.iml" filepath="$PROJECT_DIR$/platform/bootstrap/bootstrap.iml" group="platform" />
+      <module fileurl="file://$PROJECT_DIR$/build/build.iml" filepath="$PROJECT_DIR$/build/build.iml" />
       <module fileurl="file://$PROJECT_DIR$/plugins/commander/commander.iml" filepath="$PROJECT_DIR$/plugins/commander/commander.iml" group="plugins" />
       <module fileurl="file://$PROJECT_DIR$/community-main.iml" filepath="$PROJECT_DIR$/community-main.iml" />
       <module fileurl="file://$PROJECT_DIR$/community-resources/community-resources.iml" filepath="$PROJECT_DIR$/community-resources/community-resources.iml" />
index 7ad71bb1b0ace82b483c7f34bea57fc00b765669..1a2b8c7c9901551ade3dfdde2f915d448bb8ad28 100644 (file)
@@ -26,7 +26,6 @@
       <option name="AntTarget" enabled="false" />
       <option name="BuildArtifacts" enabled="false" />
       <option name="Make" enabled="true" />
-      <option name="Maven.BeforeRunTask" enabled="false" />
     </method>
   </configuration>
 </component>
\ No newline at end of file
diff --git a/build/build.iml b/build/build.iml
new file mode 100644 (file)
index 0000000..7460b6c
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+  <component name="NewModuleRootManager" inherit-compiler-output="true">
+    <exclude-output />
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="library" name="Gant" level="project" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>
+
diff --git a/build/gant.xml b/build/gant.xml
new file mode 100644 (file)
index 0000000..01c3701
--- /dev/null
@@ -0,0 +1,20 @@
+<project name="Test gant invocation from Ant script" default="doGant">
+  <dirname property="build.dir" file="${ant.file}"/>
+  <property name="project.home" value="${build.dir}/.."/>
+  <property name="gant.home" value="${project.home}/build/lib/gant"/>
+
+  <path id="gant.classpath">
+    <pathelement location="${project.home}/build/lib/gant_patches.jar"/>
+    <fileset dir="${gant.home}/lib">
+      <include name="*.jar"/>
+    </fileset>
+  </path>
+
+  <taskdef name="gant" classname="org.codehaus.gant.ant.Gant">
+    <classpath refid="gant.classpath"/>
+  </taskdef>
+
+  <target name="doGant">
+    <gant file="${gant.script}"/>
+  </target>
+</project>
diff --git a/build/lib/gant/src.zip b/build/lib/gant/src.zip
new file mode 100644 (file)
index 0000000..5186626
Binary files /dev/null and b/build/lib/gant/src.zip differ
diff --git a/build/scripts/common_tests.gant b/build/scripts/common_tests.gant
new file mode 100644 (file)
index 0000000..1bed811
--- /dev/null
@@ -0,0 +1,56 @@
+def guessHome() {
+  // Current file is supposed to be at build/scripts/release.gant path
+  new File(this["gant.file"].substring("file:".length())).getParentFile().getParentFile().getParent()
+}
+
+includeTargets << new File("${guessHome()}/build/scripts/utils.gant")
+
+requireProperty("out", "$home/out/classes")
+
+target(compile: "Compile project") {
+  loadProject()
+  project["javac"] = "$jdk/bin/javac"
+  project.targetFolder = out
+  project.clean()
+  project.makeAll()
+}
+
+def pass(String prop) {
+  if (isDefined(prop)) {
+    ant.jvmarg(value: "-D$prop=${p(prop)}")
+  }
+}
+
+target('default': 'The default target') {
+  depends(compile)
+
+  ant.junit(fork: "yes", showoutput: "true") {
+    jvmarg (value: "-ea")
+    jvmarg (value: "-Didea.home.path=$home")
+    pass("idea.test.group")
+    pass("teamcity.tests.recentlyFailedTests.file")
+    jvmarg (value: "-Didea.home.path=$home")
+    jvmarg (value: "-Xbootclasspath/p:${boot.output}")
+    jvmarg (value: "-Djava.system.class.loader=com.intellij.util.lang.UrlClassLoader")
+    jvmarg (value: "-XX:+HeapDumpOnOutOfMemoryError")
+    jvmarg (value: "-Didea.system.path=${p("teamcity.build.tempDir")}/system")
+    jvmarg (value: "-Didea.config.path=${p("teamcity.build.tempDir")}/config")
+    jvmarg (value: "-agentlib:yjpagent=disablej2ee,disablealloc,sessionname=MainTests")
+    jvmarg (value: "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005")
+
+    if (isDefined("jvm_args")) {
+      jvm_args.each { jvmarg(value: it) }
+    }
+
+    classpath {
+      main.testRuntimeClasspath().each {
+        pathelement(location: it)
+      }
+      pathelement(location: "${jdk}/lib/tools.jar")
+    }
+
+    testcases.each {
+      test (name: it)
+    }
+  }
+}
diff --git a/build/scripts/tests.gant b/build/scripts/tests.gant
new file mode 100644 (file)
index 0000000..8d95c43
--- /dev/null
@@ -0,0 +1,13 @@
+def guessHome() {
+  // Current file is supposed to be at build/scripts/release.gant path
+  new File(this["gant.file"].substring("file:".length())).getParentFile().getParentFile().getParent()
+}
+
+includeTargets << new File("${guessHome()}/build/scripts/common_tests.gant")
+
+setProperty("testcases", ["com.intellij.AllTests"])
+
+setProperty("jvm_args", [
+            "-Xmx350m",
+            "-XX:MaxPermSize=320m",
+            ])
diff --git a/build/scripts/utils.gant b/build/scripts/utils.gant
new file mode 100644 (file)
index 0000000..f05aeb1
--- /dev/null
@@ -0,0 +1,92 @@
+import org.jetbrains.jps.Jps
+import org.jetbrains.jps.idea.IdeaProjectLoader
+
+includeTool << Jps
+
+binding.setVariable("p", {String key ->
+  return getProperty(key) as String
+})
+
+binding.setVariable("guessJdk", {
+  String javaHome = p("java.home")
+
+  if (new File(javaHome).getName() == "jre") {
+    javaHome = new File(javaHome).getParent()
+  }
+
+  return javaHome
+})
+
+binding.setVariable("isMac", {
+  return System.getProperty("os.name").toLowerCase().startsWith("mac")
+})
+
+binding.setVariable("isDefined", {String key ->
+  try {
+    this[key]
+    return true
+  }
+  catch (MissingPropertyException mpe) {
+    return false
+  }
+})
+
+private String require(String key) {
+  try {
+    this[key]
+  }
+  catch (MissingPropertyException mpe) {
+    project.error("Property $key is required")
+  }
+}
+
+private String require(String key, String defaultValue) {
+  try {
+    this[key]
+  }
+  catch (MissingPropertyException mpe) {
+    project.info("$key is not defined. Defaulting to $defaultValue")
+    this[key] = defaultValue
+  }
+}
+
+binding.setVariable("requireProperty", {String key, String defaultValue = null ->
+  if (defaultValue == null) {
+    require(key)
+  }
+  else {
+    require(key, defaultValue)
+  }
+})
+
+binding.setVariable("guessHome", {
+  // Current file is supposed to be at build/scripts/release.gant path
+  new File(requireProperty("gant.file").substring("file:".length())).getParentFile().getParentFile().getParent()
+})
+
+binding.setVariable("loadProject", {
+  requireProperty("jdk", requireProperty("jdk15.home", guessJdk()))
+  new IdeaProjectLoader().loadFromPath(project, "${home}")
+
+  binding.ant.patternset(id: "idea.compiler.resources") {
+    exclude(name: "**/*.java")
+    exclude(name: "**/*.form")
+    exclude(name: "**/*.class")
+    exclude(name: "**/*.scala")
+    exclude(name: "**/*.groovy")
+  }
+
+  project["compiler.resources.id"] = "idea.compiler.resources"
+
+  if (!isMac()) {
+    project.modules.values().each {
+      it.classpath << project.resolve("$jdk/lib/tools.jar")
+    }
+  }
+})
+
+requireProperty("home", guessHome())
+
+project.stagePrinter = { String message ->
+  println "##teamcity[progressMessage '$message']"
+}