Skip to content

Instantly share code, notes, and snippets.

@igb
Created November 21, 2021 17:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save igb/9226a88440454ba11dd6ceb6b6351143 to your computer and use it in GitHub Desktop.
Save igb/9226a88440454ba11dd6ceb6b6351143 to your computer and use it in GitHub Desktop.
touch README
mkdir -p src/java
mkdir -p testsrc/java
mkdir -p lib/java
mkdir -p libext/java
touch project.properties
echo "src.dir=src/java" >> project.properties
echo "testsrc.dir=testsrc/java" >> project.properties
echo "lib.dir=lib/java" >> project.properties
echo "libext.dir=libext/java" >> project.properties
echo "dist.dir=dist" >> project.properties
echo -n '<?xml version="1.0" encoding="UTF-8" ?>
<project name="' > build.xml
echo -n ${PWD##*/} >> build.xml
echo -n '" default="build" basedir=".">
<description>
simple example build file
</description>
<!-- set global properties for this build -->
<target name="init">
<property file="project.properties"/>
</target>
<target name="clean" depends="init">
<delete dir="${dist.dir}"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="build" depends="clean">
<javac srcdir="${src.dir}" destdir="${dist.dir}">
<classpath>
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
</classpath>
</javac>
</target>
<target name="dist" depends="build">
<zip file="' >> build.xml
echo -n ${PWD##*/} >> build.xml
echo -n '.zip">
<fileset dir="${lib.dir}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${dist.dir}">
<include name="**/*.class"/>
<include name="**/*.sh"/>
</fileset>
</zip>
</target>
</project>' >> build.xml
git init .
git add project.properties
git add build.xml
git add README
git commit -m "initial commit for ${PWD##*/} project"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment