Skip to content

Commit

Permalink
Retire the old BuildEnumerator system.
Browse files Browse the repository at this point in the history
It has not been used at all lately, and frankly it should not be used.
It has been causing problems with build number being updated downstream
causing the version check to fail. In the future we will update the
build number manually, incrementing it with some fixed number on each
release.
  • Loading branch information
unsound committed Aug 24, 2014
1 parent 4d4160d commit 01895d3
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 138 deletions.
4 changes: 3 additions & 1 deletion build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<property name="manifest.source.dir" value="src.META-INF"/>
<!--<property name="builddir" value=".build~"/>-->
<property name="builddir" value=".antbuild~"/>
<property name="java.build.library.dir" value="lib"/>
<!--<property name="java.build.library.dir" value="lib"/>-->
<property name="java.runtime.library.dir" value="dist/lib"/>
<!--<property name="manifest.filename" value="${manifest.source.dir}/MANIFEST.MF"/>-->
<!--<property name="outjar.filename" value="${libdir}/torrenttoolbox.jar"/>-->
Expand All @@ -33,9 +33,11 @@
<include name="**/*.jar"/>
<exclude name="**/${target.all.outjarname}"/>
</fileset>
<!--
<fileset dir="${java.build.library.dir}">
<include name="**/*.jar"/>
</fileset>
-->
</path>

<path id="javadoc.classpath">
Expand Down
28 changes: 1 addition & 27 deletions buildall.bat
Original file line number Diff line number Diff line change
@@ -1,27 +1 @@
@echo off

:begin
setlocal
pushd %~dp0

set SOURCES_DIR=%~dp0src
set BUILDENUM_CP="%~dp0lib\buildenumerator.jar"

echo Incrementing build number...
java -cp %BUILDENUM_CP% BuildEnumerator "%SOURCES_DIR%\org\catacombae\hfsexplorer\BuildNumber.java" 1

echo Building with ant...
call ant build-all
if not "%ERRORLEVEL%"=="0" goto error

goto end

:error
echo There were errors...
echo Decrementing build number...
java -cp %BUILDENUM_CP% BuildEnumerator "%SOURCES_DIR%\org\catacombae\hfsexplorer\BuildNumber.java" -1
goto end

:end
popd
endlocal
@ant build-all
46 changes: 1 addition & 45 deletions buildall.sh
Original file line number Diff line number Diff line change
@@ -1,47 +1,3 @@
#!/bin/sh

JAVAC_CMD="${JAVA_HOME:+${JAVA_HOME}/bin/}javac"
SOURCES_DIR=src
BUILDENUM_CP=lib/buildenumerator.jar

echo "javac command: ${JAVAC_CMD}"

error() {
decrement_buildnumber
echo "There were errors..."
}

jobCompleted() {
echo "Done!"
}

increment_buildnumber() {
echo "Incrementing build number..."
java -cp $BUILDENUM_CP BuildEnumerator $SOURCES_DIR/org/catacombae/hfsexplorer/BuildNumber.java 1
}

decrement_buildnumber() {
echo "Decrementing build number..."
java -cp $BUILDENUM_CP BuildEnumerator $SOURCES_DIR/org/catacombae/hfsexplorer/BuildNumber.java -1
}

antbuild() {
echo "Building with ant..."
ant build-all
return $?
}

main() {
increment_buildnumber
antbuild
if [ "$?" -eq 0 ]; then
jobCompleted
return 0
else
error
return -1
fi
}

#entry point
main
ant build-all
2 changes: 1 addition & 1 deletion buildjparted.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
@ant compilejparted
@ant build-jparted
65 changes: 1 addition & 64 deletions buildjparted.sh
Original file line number Diff line number Diff line change
@@ -1,66 +1,3 @@
#!/bin/sh

error() {
echo "There were errors..."
}

jobCompleted() {
echo "Done!"
}

JAVAC_CMD="${JAVA_HOME:+${JAVA_HOME}/bin/}javac"
JAVAC_DEFAULT_ARGS="-target 1.5 -source 1.5 -encoding utf-8"
CLASSPATH=build.~:dist/lib/catacombae_io.jar:dist/lib/swing-layout-1.0.3.jar:dist/lib/hfsx_dmglib.jar:lib/java_awt_Desktop.jar
SOURCES_DIR=src
BUILD_DIR=build.~
LIBRARY_PATH=lib
JARFILE_DIR=dist/lib
JARFILE=jparted.jar
RESOURCE_SRC_DIR=resource
RESOURCE_DST_DIR=$BUILD_DIR/res
BUILDENUM_CP=lib/buildenumerator.jar

removeclassfiles() {
echo "Removing all class files..."
rm -r $BUILD_DIR
mkdir $BUILD_DIR
return $?
}

buildjparted() {
echo "Building org.catacombae.jparted.app..."
"${JAVAC_CMD}" $JAVAC_DEFAULT_ARGS -cp $CLASSPATH -sourcepath $SOURCES_DIR -d $BUILD_DIR -Xlint:unchecked $SOURCES_DIR/org/catacombae/jparted/app/*.java
return $?
}

buildjar() {
echo "Building jar-file..."
if [ ! -d "$JARFILE_DIR" ]; then # if not exists $LIBRARY_PATH...
echo "Making library path"
mkdir $JARFILE_DIR
fi
jar cf $JARFILE_DIR/$JARFILE -C $BUILD_DIR .
return $?
}

main() {
removeclassfiles
if [ "$?" -eq 0 ]; then
buildjparted
if [ "$?" -eq 0 ]; then
buildjar
if [ "$?" -eq 0 ]; then
jobCompleted
else
error
fi
else
error
fi
else
error
fi
}

#entry point
main
ant build-jparted
Binary file removed lib/buildenumerator.jar
Binary file not shown.

0 comments on commit 01895d3

Please sign in to comment.