Permalink
Browse files

deploy from ant script

  • Loading branch information...
1 parent f86deb5 commit bdf4fa61a371c3af348049bdde8d4dea3b328fc8 @albertlatacz committed Apr 22, 2013
Showing with 101 additions and 18 deletions.
  1. +1 −2 .travis.yml
  2. +48 −2 build.xml
  3. +25 −1 build/macros.xml
  4. +12 −0 build/packaged.dependencies
  5. +0 −12 build/runtime.dependencies
  6. +13 −0 java-repl.iml
  7. +2 −1 src/javarepl/rest/Main.java
View
@@ -9,5 +9,4 @@ install:
- sudo apt-get install -qq s3cmd
script:
- - ant
- - ./bin/push.sh
+ - ant -Ddeploy=true
View
@@ -3,7 +3,7 @@
<property environment="env"/>
<condition property="build.number" value="${env.JAVAREPL_BUILD_NUMBER}" else="dev.build">
- <isset property="env.JAVAREPL_BUILD_NUMBER" />
+ <isset property="env.JAVAREPL_BUILD_NUMBER"/>
</condition>
<property name="build" value="${basedir}/build"/>
@@ -30,6 +30,7 @@
<property name="build.dependencies.dir" value="lib/build"/>
<property name="runtime.dependencies.dir" value="lib/runtime"/>
+ <property name="packaged.dependencies.dir" value="lib/packaged"/>
<property name="optional.dependencies.dir" value="lib/optional"/>
<property name="manual.dependencies.dir" value="lib/manual"/>
@@ -39,6 +40,7 @@
<path id="all.dependancies">
<fileset dir="${build.dependencies.dir}" includes="**/*.jar"/>
<fileset dir="${runtime.dependencies.dir}" includes="**/*.jar"/>
+ <fileset dir="${packaged.dependencies.dir}" includes="**/*.jar"/>
<fileset dir="${optional.dependencies.dir}" includes="**/*.jar"/>
<fileset dir="${manual.dependencies.dir}" includes="**/*.jar"/>
</path>
@@ -56,6 +58,8 @@
directory="${build.dependencies.dir}"/>
<update dependencies="build/runtime.dependencies"
directory="${runtime.dependencies.dir}"/>
+ <update dependencies="build/packaged.dependencies"
+ directory="${packaged.dependencies.dir}"/>
<update dependencies="build/optional.dependencies"
directory="${optional.dependencies.dir}"/>
</parallel>
@@ -81,7 +85,8 @@
</target>
<target name="compile">
- <compile.and.jar src="${src}" jar="${release.jar.path}" classpathref="all.dependancies" version="${release.version}"/>
+ <compile.and.jar src="${src}" jar="${release.jar.path}" classpathref="all.dependancies"
+ version="${release.version}"/>
<compile.and.jar src="${test}" jar="${tests.jar.path}" classpathref="all.jars" version="${release.version}"/>
@@ -92,18 +97,58 @@
<test jar="${tests.jar.path}" classpathref="all.jars" reports="${reports}"/>
</target>
+
<target name="package">
<mkdir dir="${artifacts}"/>
<zip destfile="${artifacts}/${release.src}" basedir="src"/>
<zip destfile="${artifacts}/${tests.src}" basedir="test"/>
+
+ <exec executable="git" output="${artifacts}/git.properties">
+ <arg line="log -1 --pretty=format:summary:%s%nchangeset:%H%nuser:%cn"/>
+ </exec>
+ <property file="${artifacts}/git.properties" prefix="git"/>
+
+ <propertyfile file="${artifacts}/release.properties">
+ <entry key="release.version" value="${release.version}"/>
+ <entry key="project.name" value="${ant.project.name}"/>
+ <entry key="release.name" value="${release.name}"/>
+ <entry key="release.path" value="${ant.project.name}/${ant.project.name}/${release.version}/"/>
+ <entry key="release.files" value="${release.jar},${release.pom},${release.src},${tests.jar},${tests.src}"/>
+ <entry key="${release.jar}.description"
+ value="${git.summary} build:${build.number} changeset:${git.changeset} user:${git.user}"/>
+ <entry key="${release.jar}.labels" value="Jar"/>
+ <entry key="${release.pom}.description" value="Maven POM file build:${build.number}"/>
+ <entry key="${release.pom}.labels" value="POM"/>
+ <entry key="${release.src}.description" value="Source file build:${build.number}"/>
+ <entry key="${release.src}.labels" value="Source"/>
+ <entry key="${tests.jar}.description" value="Tests jar build:${build.number}"/>
+ <entry key="${tests.jar}.labels" value="Tests"/>
+
+ <entry key="${tests.src}.description" value="Test sources jar build:${build.number}"/>
+ <entry key="${tests.src}.labels" value="Test Sources"/>
+ </propertyfile>
+
+ <generate.pom artifact.uri="mvn:${ant.project.name}:${ant.project.name}:jar:${release.version}"
+ dependencies="build/runtime.dependencies"
+ directory="${artifacts}"/>
</target>
<target name="embed">
<embed.libs jar="${release.jar.path}"/>
</target>
+ <target name="deploy" if="${deploy}">
+ <deploy-s3 source="${release.plugin.zip.path}"
+ destination="s3://albertlatacz.published/javarepl/intellij-plugin/javarepl-intellij-${release.version}.zip"/>
+ <deploy-s3 source="${release.plugin.zip.path}"
+ destination="s3://albertlatacz.published/javarepl/intellij-plugin/javarepl-intellij.zip"/>
+
+ <deploy-s3 source="${release.jar.path}"
+ destination="s3://albertlatacz.published/javarepl/javarepl-${release.version}.jar"/>
+ <deploy-s3 source="${release.jar.path}" destination="s3://albertlatacz.published/javarepl/javarepl.jar"/>
+ </target>
<target name="build" description="build all">
@@ -119,6 +164,7 @@
<antcall target="embed"/>
<antcall target="plugin"/>
+ <antcall target="deploy"/>
</target>
</project>
View
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
+ <property environment="env"/>
<macrodef name="embed.libs">
<attribute name="jar"/>
<sequential>
@@ -8,7 +9,7 @@
<property name="release.no.libs.jar" value="${artifacts}/${release.name}-nolibs.jar"/>
<jarjar jarfile="${release.no.libs.jar}" manifest="@{jar}.mf">
<zipfileset src="${release.jar.path}"/>
- <zipgroupfileset dir="${runtime.dependencies.dir}"
+ <zipgroupfileset dir="${packaged.dependencies.dir}"
includes="totallylazy-*.jar, jline-*.jar, antlr-*.jar, cglib-*.jar, funclate-*.jar,
objenesis-*.jar, utterlyidle-*.jar, yadic-*.jar, stringtemplate-*.jar"/>
<rule pattern="com.googlecode.totallylazy.*" result="javarepl.internal.totallylazy.@1"/>
@@ -109,4 +110,27 @@
</sequential>
</macrodef>
+
+ <macrodef name="deploy-s3">
+ <attribute name="source"/>
+ <attribute name="destination"/>
+
+ <sequential>
+ <echo file="~/.s3cfg">[default]
+ access_key = ${env.AWS_KEY}
+ secret_key = ${env.AWS_SECRET}
+ </echo>
+
+ <exec executable="s3cmd">
+ <arg value="-c"/>
+ <arg value="~/.s3cfg"/>
+ <arg value="put"/>
+ <arg value="@{source}"/>
+ <arg value="@{destination}"/>
+ </exec>
+
+ <delete file="~/.s3cfg"/>
+ </sequential>
+ </macrodef>
+
</project>
@@ -0,0 +1,12 @@
+mvn:jline:jline:jar:2.10
+
+mvn:antlr:antlr:jar:2.7.7
+mvn:org.antlr:stringtemplate:jar:3.2.1
+
+mvn:cglib:cglib-nodep:jar:2.2
+mvn:org.objenesis:objenesis:jar:1.2
+
+s3://repo.bodar.com/com.googlecode.totallylazy:totallylazy:jar:1052
+s3://repo.bodar.com/com.googlecode.funclate:funclate:jar:102
+s3://repo.bodar.com/com.googlecode.utterlyidle:utterlyidle:jar:628
+s3://repo.bodar.com/com.googlecode.yadic:yadic:jar:153
View
@@ -1,12 +0,0 @@
-mvn:jline:jline:jar:2.10
-
-mvn:antlr:antlr:jar:2.7.7
-mvn:org.antlr:stringtemplate:jar:3.2.1
-
-mvn:cglib:cglib-nodep:jar:2.2
-mvn:org.objenesis:objenesis:jar:1.2
-
-s3://repo.bodar.com/com.googlecode.totallylazy:totallylazy:jar:1052
-s3://repo.bodar.com/com.googlecode.funclate:funclate:jar:102
-s3://repo.bodar.com/com.googlecode.utterlyidle:utterlyidle:jar:628
-s3://repo.bodar.com/com.googlecode.yadic:yadic:jar:153
View
@@ -8,6 +8,19 @@
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="module-library">
+ <library>
+ <CLASSES>
+ <root url="file://$MODULE_DIR$/lib/packaged" />
+ </CLASSES>
+ <JAVADOC />
+ <SOURCES>
+ <root url="file://$MODULE_DIR$/lib/packaged" />
+ </SOURCES>
+ <jarDirectory url="file://$MODULE_DIR$/lib/packaged" recursive="false" />
+ <jarDirectory url="file://$MODULE_DIR$/lib/packaged" recursive="false" type="SOURCES" />
+ </library>
+ </orderEntry>
<orderEntry type="module-library">
<library>
<CLASSES>
@@ -23,6 +23,7 @@ public Main(BasePath basePath) {
}
public static void main(String[] args) throws Exception {
- new RestServer(new Main(basePath("/")), defaultConfiguration().port(8001));
+ Main application = new Main(basePath("/"));
+ new RestServer(application, defaultConfiguration().port(8001));
}
}

0 comments on commit bdf4fa6

Please sign in to comment.