mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-10-06 06:21:16 +07:00
224 lines
6.7 KiB
Plaintext
224 lines
6.7 KiB
Plaintext
import org.jetbrains.jps.Jps
|
|
import static org.jetbrains.jps.idea.IdeaProjectLoader.guessHome
|
|
|
|
includeTargets << new File("${guessHome(this as Script)}/community/build/scripts/utils.gant")
|
|
includeTargets << new File("${guessHome(this)}/python/build/python_common.gant")
|
|
includeTool << Jps
|
|
|
|
setProperty("basedir", "${ant.project.properties.basedir}/../python/build")
|
|
|
|
setProperty("projectHome", "${basedir}/../..")
|
|
setProperty("outDir", "${projectHome}/out/python")
|
|
setProperty("ideaDir", "${outDir}/idea")
|
|
setProperty("ideaHome", "${ideaDir}/jdk16")
|
|
|
|
setProperty("pluginHelp", "${outDir}/help")
|
|
|
|
setProperty("buildNumber", requireProperty("build.number", snapshot))
|
|
|
|
setProperty("pluginHome", "${basedir}/..")
|
|
setProperty("pluginRevision", "${buildNumber}")
|
|
|
|
setProperty("ideaLib", "${ideaHome}/lib")
|
|
setProperty("ideaPlugins", "${ideaHome}/plugins")
|
|
|
|
|
|
setProperty("output", "${basedir}/../dist")
|
|
|
|
setProperty("zipdir", "${output}/zip")
|
|
setProperty("plugindir", "${zipdir}/python")
|
|
setProperty("zipname", "python-${pluginRevision}.zip")
|
|
|
|
setProperty("srcDir", "${pluginHome}/src")
|
|
setProperty("resourcesDir", "${pluginHome}/resources")
|
|
setProperty("pluginResourcesDir", "${pluginHome}/pluginResources")
|
|
setProperty("testSrcDir", "${pluginHome}/testSrc")
|
|
setProperty("artifactsDir", "${output}/artifacts")
|
|
|
|
setProperty("classesDir", "${basedir}/dist/classes")
|
|
setProperty("testClassesDir", "${basedir}/dist/test-classes")
|
|
|
|
target(name: "clean", description: "Cleanup output") {
|
|
ant.delete(dir: "${output}", failonerror: "false")
|
|
ant.delete(dir: "${classesDir}", failonerror: "false")
|
|
ant.delete(dir: "${outDir}/classes", failonerror: "false")
|
|
ant.delete(dir: "${outDir}/dist", failonerror: "false")
|
|
ant.delete(dir: "${outDir}/artifacts", failonerror: "false")
|
|
ant.delete(dir: "${outDir}/jar", failonerror: "false")
|
|
ant.delete(dir: "${outDir}/deploy", failonerror: "false")
|
|
ant.delete(dir: "${ideaDir}/jdk16", failonerror: "false")
|
|
}
|
|
|
|
target(name: "unzip") {
|
|
ant.mkdir(dir: "${ideaDir}")
|
|
ant.unzip(dest: "${ideaDir}/jdk16") {
|
|
fileset(dir: "${ideaDir}", includes: "ideaIU*.zip")
|
|
}
|
|
}
|
|
|
|
target(name: "compile", description: "Compile module python") {
|
|
depends("unzip")
|
|
ant.path(id: "classpath.lib") {
|
|
fileset(dir: "${ideaLib}") {
|
|
include(name: "?*.jar")
|
|
}
|
|
fileset(dir: "${ideaPlugins}/yaml/lib") {
|
|
include(name: "yaml.jar")
|
|
}
|
|
fileset(dir: "${ideaPlugins}/coverage/lib") {
|
|
include(name: "coverage.jar")
|
|
include(name: "coverage-agent.jar")
|
|
}
|
|
}
|
|
|
|
ant.path(id: "sourcepath") {
|
|
dirset(dir: "${pluginHome}") {
|
|
include(name: "resources")
|
|
include(name: "src")
|
|
include(name: "pluginSrc")
|
|
include(name: "pydevSrc")
|
|
}
|
|
dirset(dir: "${pluginHome}/../ultimate/ultimate-verifier") {
|
|
include(name: "src")
|
|
}
|
|
}
|
|
//The task requires the following libraries from IntelliJ IDEA distribution:
|
|
//javac2.jar; jdom.jar; asm.jar; asm-commons.jar
|
|
ant.taskdef(name: "javac2", classname: "com.intellij.ant.Javac2") {
|
|
classpath(refid: "classpath.lib")
|
|
}
|
|
|
|
//Compiler options
|
|
setProperty("compilerDebug", "on")
|
|
setProperty("compilerGenerateNoWarnings", "off")
|
|
setProperty("compilerArgs", "")
|
|
setProperty("compilerMaxMemory", "256m")
|
|
|
|
ant.patternset(id: "sources.pt") {
|
|
exclude(name: "**/.svn/**")
|
|
}
|
|
|
|
ant.patternset(id: "resources.pt") {
|
|
include(name: "**/?*.properties")
|
|
include(name: "**/?*.template")
|
|
include(name: "**/?*.xml")
|
|
include(name: "**/?*.gif")
|
|
include(name: "**/?*.png")
|
|
include(name: "**/?*.txt")
|
|
include(name: "**/?*.jpeg")
|
|
include(name: "**/?*.jpg")
|
|
include(name: "**/?*.html")
|
|
include(name: "**/?*.dtd")
|
|
include(name: "**/?*.tld")
|
|
include(name: "**/?*.py")
|
|
include(name: "**/?*.ft")
|
|
}
|
|
|
|
ant.loadfile(srcfile: "${ideaHome}/build.txt", property: "ideaBuildNumber") {
|
|
filterchain() {
|
|
deletecharacters(chars: "IU-")
|
|
}
|
|
}
|
|
|
|
ant.mkdir(dir: "${classesDir}")
|
|
|
|
//compile
|
|
ant.javac2(destdir: "${classesDir}",
|
|
debug: "${compilerDebug}",
|
|
nowarn: "${compilerGenerateNoWarnings}",
|
|
memorymaximumsize: "${compilerMaxMemory}",
|
|
fork: "true") {
|
|
compilerarg(line: "${compilerArgs}")
|
|
classpath(refid: "classpath.lib")
|
|
src(refid: "sourcepath")
|
|
patternset(refid: "sources.pt")
|
|
}
|
|
|
|
//copy resources
|
|
ant.copy(todir: "${classesDir}") {
|
|
fileset(dir: "${resourcesDir}") {
|
|
patternset(refid: "resources.pt")
|
|
type(type: "file")
|
|
}
|
|
fileset(dir: "${pluginResourcesDir}") {
|
|
patternset(refid: "resources.pt")
|
|
type(type: "file")
|
|
}
|
|
fileset(dir: "${pluginHome}/src") {
|
|
patternset(refid: "resources.pt")
|
|
type(type: "file")
|
|
}
|
|
fileset(dir: "${pluginHome}/../community/colorSchemes/src")
|
|
}
|
|
|
|
//copy plugin.xml
|
|
ant.mkdir(dir: "${classesDir}/META-INF")
|
|
ant.copy(todir: "${classesDir}/META-INF") {
|
|
fileset(dir: "${pluginHome}/pluginSrc/META-INF")
|
|
}
|
|
|
|
ant.replaceregexp(file: "${classesDir}/META-INF/plugin.xml",
|
|
match: "since-build=\"\\d+\\.\\d+\"",
|
|
replace: "since-build=\"${ideaBuildNumber}\"")
|
|
}
|
|
|
|
target(name: "jar", description: "Generate jar file") {
|
|
depends("compile")
|
|
ant.mkdir(dir: "${output}")
|
|
ant.jar(destfile: "${output}/python.jar", basedir: "${classesDir}") {
|
|
manifest() {
|
|
attribute(name: "Revision", value: "${pluginRevision}")
|
|
//<!--<attribute name="Build" value="${plugin.version}"/>-->
|
|
}
|
|
}
|
|
}
|
|
|
|
target(name: "zip", description: "Generate zip plugin file") {
|
|
depends("jar")
|
|
|
|
ant.mkdir(dir: "${zipdir}")
|
|
|
|
// copy plugin jar
|
|
ant.mkdir(dir: "${plugindir}/lib")
|
|
ant.move(file: "${output}/python.jar", todir: "${plugindir}/lib")
|
|
|
|
ant.mkdir(dir: "${plugindir}/helpers")
|
|
ant.copy(todir: "${plugindir}/helpers") {
|
|
fileset(dir: "${pluginHome}/helpers") {
|
|
include(name: "**/*.py")
|
|
include(name: "**/*.xml")
|
|
}
|
|
}
|
|
|
|
ant.mkdir(dir: "${plugindir}/help")
|
|
ant.copy(file: "${pluginHelp}/pytonpluginhelp.jar", tofile: "${plugindir}/help/pythonpluginhelp.jar")
|
|
ant.copy(file: "${pluginHelp}/pytonpluginhelp_mac.jar", tofile: "${plugindir}/help/pythonpluginhelp_mac.jar")
|
|
|
|
ant.move(file: "${debugEgg}", todir: "${plugindir}")
|
|
|
|
ant.zip(basedir: "${zipdir}", destfile: "${output}/${zipname}")
|
|
}
|
|
|
|
target(name: "build") {
|
|
depends("clean")
|
|
depends("unzip")
|
|
depends("compile")
|
|
egg = buildDebuggerEgg(outDir, pluginHome, "PythonPlugin-${buildNumber}")
|
|
setProperty("debugEgg", "$egg")
|
|
}
|
|
|
|
target(name: "dist", description: "main target") {
|
|
depends("build")
|
|
depends("zip")
|
|
}
|
|
|
|
target(name: "artifacts") {
|
|
depends("dist")
|
|
ant.mkdir(dir: "${artifactsDir}")
|
|
ant.move(file: "${output}/${zipname}", todir: "${artifactsDir}")
|
|
}
|
|
|
|
target('default': "Build artifacts") {
|
|
depends("dist")
|
|
}
|