mirror of
https://github.com/angryip/ipscan.git
synced 2025-10-26 11:18:17 +00:00
build number is now gone forever from git version
This commit is contained in:
parent
43e2f77a38
commit
adcfa669c6
240
build.xml
240
build.xml
@ -1,11 +1,11 @@
|
||||
<project basedir="." name="ipscan" default="info">
|
||||
|
||||
<property name="bin" value="ant-bin"/>
|
||||
<property name="bin" value="ant-bin"/>
|
||||
<property name="testbin" value="ant-tests"/>
|
||||
<property name="dist" value="dist"/>
|
||||
<property name="ext" value="ext"/>
|
||||
<property name="src" value="src"/>
|
||||
<property name="test" value="test"/>
|
||||
<property name="test" value="test"/>
|
||||
<property name="resources" value="resources"/>
|
||||
<property name="testresults" value="test-results"/>
|
||||
|
||||
@ -33,65 +33,65 @@
|
||||
<exclude name="**/icon?*.png"/>
|
||||
</patternset>
|
||||
|
||||
<!-- detect current platform -->
|
||||
<condition property="platform" value="linux">
|
||||
<os name="Linux" arch="i386"/>
|
||||
</condition>
|
||||
<condition property="platform" value="linux64">
|
||||
<or>
|
||||
<os name="Linux" arch="amd64"/>
|
||||
<os name="Linux" arch="ia64"/>
|
||||
<os name="Linux" arch="x86_64"/>
|
||||
</or>
|
||||
</condition>
|
||||
<condition property="platform" value="mac">
|
||||
<os family="mac"/>
|
||||
</condition>
|
||||
<condition property="platform" value="win32">
|
||||
<os family="windows"/>
|
||||
</condition>
|
||||
<condition property="platform" value="unknown">
|
||||
<not>
|
||||
<isset property="platform"/>
|
||||
</not>
|
||||
</condition>
|
||||
|
||||
<target name="all" depends="clean,compile,compile-tests,test,package,clean_end"/>
|
||||
<target name="linux" depends="clean,compile-linux,package-linux,clean_end"/>
|
||||
<target name="linux64" depends="clean,compile-linux64,package-linux64,clean_end"/>
|
||||
<target name="mac" depends="clean,compile-mac,package-mac,clean_end"/>
|
||||
<target name="win32" depends="clean,compile-win32,package-win32,clean_end"/>
|
||||
<target name="current">
|
||||
<antcall target="${platform}"/>
|
||||
</target>
|
||||
|
||||
<!-- this is run by cruise control continous integration -->
|
||||
<target name="cruise" depends="clean,compile,compile-tests,package,clean_end"/>
|
||||
|
||||
<!-- detect current platform -->
|
||||
<condition property="platform" value="linux">
|
||||
<os name="Linux" arch="i386"/>
|
||||
</condition>
|
||||
<condition property="platform" value="linux64">
|
||||
<or>
|
||||
<os name="Linux" arch="amd64"/>
|
||||
<os name="Linux" arch="ia64"/>
|
||||
<os name="Linux" arch="x86_64"/>
|
||||
</or>
|
||||
</condition>
|
||||
<condition property="platform" value="mac">
|
||||
<os family="mac"/>
|
||||
</condition>
|
||||
<condition property="platform" value="win32">
|
||||
<os family="windows"/>
|
||||
</condition>
|
||||
<condition property="platform" value="unknown">
|
||||
<not>
|
||||
<isset property="platform"/>
|
||||
</not>
|
||||
</condition>
|
||||
|
||||
<target name="all" depends="clean,compile,compile-tests,test,package,clean_end"/>
|
||||
<target name="linux" depends="clean,compile-linux,package-linux,clean_end"/>
|
||||
<target name="linux64" depends="clean,compile-linux64,package-linux64,clean_end"/>
|
||||
<target name="mac" depends="clean,compile-mac,package-mac,clean_end"/>
|
||||
<target name="win32" depends="clean,compile-win32,package-win32,clean_end"/>
|
||||
<target name="current">
|
||||
<antcall target="${platform}"/>
|
||||
</target>
|
||||
|
||||
<!-- this is run by cruise control continous integration -->
|
||||
<target name="cruise" depends="clean,compile,compile-tests,package,clean_end"/>
|
||||
|
||||
<target name="info">
|
||||
<echo message="This script will build ${name} ${version}"/>
|
||||
<echo message="This script will build ${name} ${version}"/>
|
||||
<echo message="Targets (some may work only on Linux):"/>
|
||||
<echo message=" all - runs tests and builds binaries for all OSs"/>
|
||||
<echo message=" linux - builds only Linux 32-bit binary"/>
|
||||
<echo message=" linux - builds only Linux 32-bit binary"/>
|
||||
<echo message=" linux64 - builds only Linux 64-bit binary"/>
|
||||
<echo message=" mac - builds only Mac binary"/>
|
||||
<echo message=" win32 - builds only Windows binary"/>
|
||||
<echo message=" win32 - builds only Windows binary"/>
|
||||
<echo message=" current = ${platform}"/>
|
||||
</target>
|
||||
|
||||
<target name="clean">
|
||||
|
||||
<target name="clean">
|
||||
<delete dir="${dist}"/>
|
||||
<antcall target="clean_end"/>
|
||||
<antcall target="clean_end"/>
|
||||
</target>
|
||||
|
||||
<target name="clean_end">
|
||||
<delete dir="${bin}"/>
|
||||
<delete dir="${testbin}"/>
|
||||
<delete dir="${bin}.linux"/>
|
||||
<delete dir="${bin}.linux64"/>
|
||||
<delete dir="${bin}.win32"/>
|
||||
<delete dir="${bin}.mac"/>
|
||||
<delete dir="${testresults}"/>
|
||||
|
||||
<target name="clean_end">
|
||||
<delete dir="${bin}"/>
|
||||
<delete dir="${testbin}"/>
|
||||
<delete dir="${bin}.linux"/>
|
||||
<delete dir="${bin}.linux64"/>
|
||||
<delete dir="${bin}.win32"/>
|
||||
<delete dir="${bin}.mac"/>
|
||||
<delete dir="${testresults}"/>
|
||||
</target>
|
||||
|
||||
<macrodef name="compile">
|
||||
@ -147,17 +147,17 @@
|
||||
</target>
|
||||
|
||||
<target name="compile-tests">
|
||||
<compile path="${src}" extpath="${test}:${ext.src}" dest="${testbin}" debug="true" optimize="false"/>
|
||||
<!-- coverage is currently broken
|
||||
<compile path="${src}" extpath="${test}:${ext.src}" dest="${testbin}" debug="true" optimize="false"/>
|
||||
<!-- coverage is currently broken
|
||||
<emma>
|
||||
<instr instrpath="${testbin}" destdir="${testbin}.instr" metadatafile="${testresults}/metadata.emma" merge="false" filter="net.azib.ipscan.*"/>
|
||||
</emma>
|
||||
<copy todir="${testbin}" overwrite="true">
|
||||
<fileset dir="${testbin}.instr" includes="**/*.class"/>
|
||||
</copy>
|
||||
<delete dir="${testbin}.instr"/>
|
||||
<delete dir="${testbin}.instr"/>
|
||||
-->
|
||||
</target>
|
||||
</target>
|
||||
|
||||
<target name="test">
|
||||
<delete dir="${testresults}"/>
|
||||
@ -167,18 +167,18 @@
|
||||
<classpath>
|
||||
<path location="${testbin}"/>
|
||||
<fileset dir="${swt}" includes="swt-${platform}.jar"/>
|
||||
<fileset dir="${ext}/junit" includes="*.jar"/>
|
||||
<fileset dir="${ext}/junit" includes="*.jar"/>
|
||||
<fileset dir="${ext}/easymock" includes="*.jar"/>
|
||||
<fileset dir="${ext}/picocontainer" includes="*.jar"/>
|
||||
<fileset dir="${ext}/picocontainer" includes="*.jar"/>
|
||||
<path refid="emma.lib"/>
|
||||
</classpath>
|
||||
<formatter type="xml"/>
|
||||
<batchtest todir="${testresults}">
|
||||
<fileset dir="${testbin}" includes="**/*Test.class"/>
|
||||
</batchtest>
|
||||
</junit>
|
||||
<!--
|
||||
report: no valid input data files have been specified
|
||||
</junit>
|
||||
<!--
|
||||
report: no valid input data files have been specified
|
||||
<emma>
|
||||
<report sourcepath="${src}" encoding="UTF-8">
|
||||
<fileset dir="${basedir}" includes="coverage.ec"/>
|
||||
@ -186,16 +186,16 @@
|
||||
<txt outfile="${testresults}/coverage.txt"/>
|
||||
<html outfile="${testresults}/coverage.html"/>
|
||||
</report>
|
||||
</emma>
|
||||
-->
|
||||
</emma>
|
||||
-->
|
||||
</target>
|
||||
|
||||
<condition property="isRunningOnLinux">
|
||||
<os name="Linux"/>
|
||||
</condition>
|
||||
|
||||
<target name="package" depends="package-linux,package-linux64,package-win32,package-mac">
|
||||
<echo message="Packaged jars are in the ${dist} directory"/>
|
||||
<target name="package" depends="package-linux,package-linux64,package-win32,package-mac">
|
||||
<echo message="Packaged jars are in the ${dist} directory"/>
|
||||
</target>
|
||||
|
||||
<target name="build-info">
|
||||
@ -206,11 +206,11 @@
|
||||
<macrodef name="package-for">
|
||||
<attribute name="platform"/>
|
||||
<attribute name="librocksaw"/>
|
||||
<sequential>
|
||||
<sequential>
|
||||
<mkdir dir="${dist}"/>
|
||||
<unzip src="${ext}/picocontainer/picocontainer-1.0.jar" dest="${bin}.@{platform}"/>
|
||||
<unzip src="${swt}/swt-@{platform}.jar" dest="${bin}.@{platform}"/>
|
||||
<copy file="${ext}/rocksaw/lib/@{librocksaw}" todir="${bin}.@{platform}"/>
|
||||
<copy file="${ext}/rocksaw/lib/@{librocksaw}" todir="${bin}.@{platform}"/>
|
||||
<copy file="${ext}/winping/lib/winping.dll" todir="${bin}.win32"/>
|
||||
<delete includeemptydirs="true" failonerror="false">
|
||||
<fileset dir="${bin}.@{platform}/images" includes="**/*.svg"/>
|
||||
@ -224,18 +224,18 @@
|
||||
<include name="libswt-mozilla-*.so"/>
|
||||
<include name="libswt-gnome-*.so"/>
|
||||
<include name="libswt-cairo-*.so"/>
|
||||
<include name="libswt-xpcominit-gtk-*.so"/>
|
||||
<include name="libswt-xulrunner-gtk-*.so"/>
|
||||
<include name="libswt-xpcominit-gtk-*.so"/>
|
||||
<include name="libswt-xulrunner-gtk-*.so"/>
|
||||
<!-- Win32 stuff -->
|
||||
<include name="swt-awt-*.dll"/>
|
||||
<include name="swt-wgl-*.dll"/>
|
||||
<include name="swt-gdip-*.dll"/>
|
||||
<include name="swt-xpcominit-*.dll"/>
|
||||
<include name="swt-xulrunner-*.dll"/>
|
||||
<include name="swt-xpcominit-*.dll"/>
|
||||
<include name="swt-xulrunner-*.dll"/>
|
||||
<!-- Mac stuff -->
|
||||
<include name="libswt-agl-*.jnilib"/>
|
||||
<include name="libswt-xpcominit-*.jnilib"/>
|
||||
<include name="libswt-xulrunner-*.jnilib"/>
|
||||
<include name="libswt-xpcominit-*.jnilib"/>
|
||||
<include name="libswt-xulrunner-*.jnilib"/>
|
||||
</fileset>
|
||||
<fileset dir="${bin}.@{platform}/org/eclipse/swt/dnd">
|
||||
<include name="D*"/>
|
||||
@ -277,14 +277,14 @@
|
||||
<include name="Color*"/>
|
||||
<include name="Link*"/>
|
||||
<include name="Tracker*"/>
|
||||
<include name="Date*"/>
|
||||
<include name="Date*"/>
|
||||
<include name="Tray*"/>
|
||||
<include name="Tree*"/>
|
||||
<include name="DateTime*"/>
|
||||
<include name="Sash*"/>
|
||||
</fileset>
|
||||
<fileset dir="${bin}.@{platform}/org/eclipse/swt/awt"/>
|
||||
</delete>
|
||||
</delete>
|
||||
<jar destfile="${dist}/${ant.project.name}-@{platform}-orig.jar" >
|
||||
<manifest>
|
||||
<attribute name="Main-Class" value="${main.class}"/>
|
||||
@ -292,10 +292,10 @@
|
||||
<attribute name="Version" value="${version}"/>
|
||||
<!-- TODO: add git sha1 here -->
|
||||
<!--<attribute name="Git-SHA1" value="${build.number}"/>-->
|
||||
<attribute name="Build-Date" value="${build.date}"/>
|
||||
<attribute name="Build-Date" value="${build.date}"/>
|
||||
<attribute name="Platform" value="@{platform}"/>
|
||||
<attribute name="Built-By" value="${user.name}"/>
|
||||
<attribute name="URL" value="http://www.azib.net/ipscan/"/>
|
||||
<attribute name="URL" value="http://www.angryip.org/"/>
|
||||
</manifest>
|
||||
<fileset dir="${bin}.@{platform}" includes="**/*"/>
|
||||
</jar>
|
||||
@ -322,9 +322,9 @@
|
||||
}
|
||||
-keep class org.eclipse.swt.internal.ole.win32.COMObject {
|
||||
<methods>;
|
||||
}
|
||||
-keep class org.eclipse.swt.dnd.ClipboardProxy {
|
||||
<methods>;
|
||||
}
|
||||
-keep class org.eclipse.swt.dnd.ClipboardProxy {
|
||||
<methods>;
|
||||
}
|
||||
-keep class org.eclipse.swt.internal.image.*FileFormat
|
||||
-keep class * {
|
||||
@ -336,49 +336,49 @@
|
||||
-keep class * {
|
||||
% *Proc(int, int, int);
|
||||
}
|
||||
</proguard>
|
||||
|
||||
</proguard>
|
||||
|
||||
<delete file="${dist}/${ant.project.name}-@{platform}-orig.jar"/>
|
||||
</sequential>
|
||||
</macrodef>
|
||||
|
||||
<target name="package-linux" depends="build-info">
|
||||
<package-for platform="linux" librocksaw="librocksaw.so"/>
|
||||
|
||||
<!-- now create deb package for Ubuntu and such -->
|
||||
<package-for platform="linux" librocksaw="librocksaw.so"/>
|
||||
|
||||
<!-- now create deb package for Ubuntu and such -->
|
||||
<antcall target="package-linux-deb-rpm"/>
|
||||
</target>
|
||||
|
||||
<target name="package-linux64" depends="build-info">
|
||||
<package-for platform="linux64" librocksaw="librocksaw.so"/>
|
||||
</target>
|
||||
|
||||
<target name="package-linux-deb-rpm" if="isRunningOnLinux">
|
||||
<mkdir dir="${dist}/deb"/>
|
||||
<copy todir="${dist}/deb">
|
||||
<fileset dir="${ext}/deb-bundle"/>
|
||||
</copy>
|
||||
|
||||
<copy file="${dist}/${ant.project.name}-linux-${version}.jar" todir="${dist}/deb/usr/lib/ipscan"/>
|
||||
<copy file="resources/images/icon.png" tofile="${dist}/deb/usr/share/pixmaps/ipscan.png"/>
|
||||
|
||||
<replace file="${dist}/deb/DEBIAN/control">
|
||||
<replacefilter token="VERSION" value="${version}"/>
|
||||
</replace>
|
||||
|
||||
<exec executable="chmod" dir="${dist}">
|
||||
<arg line="a+x deb/usr/bin/ipscan deb/usr/lib/ipscan/${ant.project.name}-linux-${version}.jar"/>
|
||||
</exec>
|
||||
<echo message="Trying to build .deb package using dpkg..."/>
|
||||
<exec executable="dpkg" dir="${dist}">
|
||||
<arg line="-b deb ${ant.project.name}_${version}_i386.deb"/>
|
||||
</exec>
|
||||
<echo message="Trying to build .rpm package using alien..."/>
|
||||
<exec executable="alien" dir="${dist}">
|
||||
<arg line="--to-rpm ${ant.project.name}_${version}_i386.deb"/>
|
||||
</exec>
|
||||
|
||||
<delete dir="${dist}/deb"/>
|
||||
</target>
|
||||
|
||||
<target name="package-linux64" depends="build-info">
|
||||
<package-for platform="linux64" librocksaw="librocksaw.so"/>
|
||||
</target>
|
||||
|
||||
<target name="package-linux-deb-rpm" if="isRunningOnLinux">
|
||||
<mkdir dir="${dist}/deb"/>
|
||||
<copy todir="${dist}/deb">
|
||||
<fileset dir="${ext}/deb-bundle"/>
|
||||
</copy>
|
||||
|
||||
<copy file="${dist}/${ant.project.name}-linux-${version}.jar" todir="${dist}/deb/usr/lib/ipscan"/>
|
||||
<copy file="resources/images/icon.png" tofile="${dist}/deb/usr/share/pixmaps/ipscan.png"/>
|
||||
|
||||
<replace file="${dist}/deb/DEBIAN/control">
|
||||
<replacefilter token="VERSION" value="${version}"/>
|
||||
</replace>
|
||||
|
||||
<exec executable="chmod" dir="${dist}">
|
||||
<arg line="a+x deb/usr/bin/ipscan deb/usr/lib/ipscan/${ant.project.name}-linux-${version}.jar"/>
|
||||
</exec>
|
||||
<echo message="Trying to build .deb package using dpkg..."/>
|
||||
<exec executable="dpkg" dir="${dist}">
|
||||
<arg line="-b deb ${ant.project.name}_${version}_i386.deb"/>
|
||||
</exec>
|
||||
<echo message="Trying to build .rpm package using alien..."/>
|
||||
<exec executable="alien" dir="${dist}">
|
||||
<arg line="--to-rpm ${ant.project.name}_${version}_i386.deb"/>
|
||||
</exec>
|
||||
|
||||
<delete dir="${dist}/deb"/>
|
||||
</target>
|
||||
|
||||
<target name="package-win32" depends="build-info">
|
||||
@ -387,11 +387,11 @@
|
||||
</target>
|
||||
|
||||
<target name="package-win32-exe">
|
||||
<copy file="${ext}/launch4j/ipscan.xml" todir="${dist}"/>
|
||||
<copy file="${ext}/launch4j/ipscan.xml" todir="${dist}"/>
|
||||
<replace file="${dist}/ipscan.xml">
|
||||
<replacefilter token="FILENAME_IN" value="${ant.project.name}-win32-${version}.jar"/>
|
||||
<replacefilter token="FILENAME_OUT" value="${ant.project.name}-${version}.exe"/>
|
||||
<replacefilter token="VERSION" value="${version}"/>
|
||||
<replacefilter token="FILENAME_OUT" value="${ant.project.name}-${version}.exe"/>
|
||||
<replacefilter token="VERSION" value="${version}"/>
|
||||
</replace>
|
||||
<launch4j configFile="${dist}/ipscan.xml"/>
|
||||
<delete file="${dist}/ipscan.xml"/>
|
||||
|
||||
@ -130,7 +130,7 @@ text.fetchers.preferences=Preferences of the selected fetcher
|
||||
text.fetcher.portText.send=Text to send (\\n, \\r, \\t and \\xXX are permitted)
|
||||
text.fetcher.portText.match=Regexp to match in the response
|
||||
text.fetcher.portText.replace=Regexp replacement string ($0 .. $9 are substituted for matched groups)
|
||||
text.about=%NAME\n\nVersion: %VERSION\nBuild: %BUILD\nBuild date: %DATE\n\n%COPYLEFT
|
||||
text.about=%NAME\n\nVersion: %VERSION\nBuild date: %DATE\n\n%COPYLEFT
|
||||
text.about.system=Java: %JAVA\nOS: %OS
|
||||
button.OK=&OK
|
||||
button.cancel=&Cancel
|
||||
|
||||
@ -16,7 +16,7 @@ import java.util.logging.Level;
|
||||
public class Version {
|
||||
public static final String NAME = "Angry IP Scanner";
|
||||
|
||||
public static final String COPYLEFT = "© 2008 Anton Keks";
|
||||
public static final String COPYLEFT = "© 2009 Anton Keks";
|
||||
|
||||
public static final String WEBSITE = "http://www.angryip.org/";
|
||||
|
||||
@ -35,7 +35,6 @@ public class Version {
|
||||
public static final String LATEST_VERSION_URL = "http://www.angryip.org/ipscan/IPSCAN.VERSION";
|
||||
|
||||
private static String version;
|
||||
private static String build;
|
||||
private static String buildDate;
|
||||
|
||||
/**
|
||||
@ -48,16 +47,6 @@ public class Version {
|
||||
return version;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return build number of currently running Angry IP Scanner (retrieved from the jar file)
|
||||
*/
|
||||
public static String getBuildNumber() {
|
||||
if (build == null) {
|
||||
loadVersionFromJar();
|
||||
}
|
||||
return build;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return build date of currently running Angry IP Scanner (retrieved from the jar file)
|
||||
*/
|
||||
@ -76,7 +65,6 @@ public class Version {
|
||||
JarFile jarFile = new JarFile(new URI(path).getPath());
|
||||
Attributes attrs = jarFile.getManifest().getMainAttributes();
|
||||
version = attrs.getValue("Version");
|
||||
build = attrs.getValue("Build");
|
||||
buildDate = attrs.getValue("Build-Date");
|
||||
return;
|
||||
}
|
||||
@ -85,7 +73,6 @@ public class Version {
|
||||
}
|
||||
}
|
||||
version = "current";
|
||||
build = "unknown";
|
||||
buildDate = "today";
|
||||
}
|
||||
|
||||
|
||||
@ -39,7 +39,6 @@ public class AboutDialog extends AbstractModalDialog {
|
||||
String aboutText = Labels.getLabel("text.about");
|
||||
aboutText = aboutText.replaceAll("%NAME", Version.NAME);
|
||||
aboutText = aboutText.replaceAll("%VERSION", Version.getVersion());
|
||||
aboutText = aboutText.replaceAll("%BUILD", Version.getBuildNumber());
|
||||
aboutText = aboutText.replaceAll("%DATE", Version.getBuildDate());
|
||||
aboutText = aboutText.replaceAll("%COPYLEFT", Version.COPYLEFT);
|
||||
Label aboutLabel = new Label(shell, SWT.NONE);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user