Folge dem Video um zu sehen, wie unsere Website als Web-App auf dem Startbildschirm installiert werden kann.
Anmerkung: Diese Funktion ist in einigen Browsern möglicherweise nicht verfügbar.
major.number=2
minor.number=0
build.number=5
<property name="src" location="src" />
<property name="version.file"
value="${basedir}/version.properties" />
<loadproperties srcFile="${version.file}" />
<property name="version.class" value="${src}/Version.java" />
<target name="incrementMajorVersion">
<propertyfile file="${version.file}">
<entry key="major.number" type="int" default="0"
operation="+" />
<entry key="minor.number" type="int" value="0" operation="=" />
<entry key="build.number" type="int" value="0" operation="=" />
</propertyfile>
<antcall target="setVersion" />
</target>
<target name="incrementMinorVersion">
<propertyfile file="${version.file}">
<entry key="minor.number" type="int" default="0"
operation="+" />
<entry key="build.number" type="int" value="0" operation="=" />
</propertyfile>
<antcall target="setVersion" />
</target>
<target name="incrementBuildLevel">
<propertyfile file="${version.file}">
<entry key="build.number" type="int" default="0"
operation="+" />
</propertyfile>
<antcall target="setVersion" />
</target>
<target name="setVersion"
depends="-setMajorVersion, -setMinorVersion, -setBuildLevel" />
<target name="-setMajorVersion">
<property file="${version.file}" />
<replaceregexp file="${version.class}"
match="MAJOR_VERSION = (.*);"
replace="MAJOR_VERSION = ${major.number};" byline="true" />
</target>
<target name="-setMinorVersion">
<property file="${version.file}" />
<replaceregexp file="${version.class}"
match="MINOR_VERSION = (.*);"
replace="MINOR_VERSION = ${minor.number};" byline="true" />
</target>
<target name="-setBuildLevel">
<property file="${version.file}" />
<replaceregexp file="${version.class}"
match="BUILD_LEVEL = (.*);"
replace="BUILD_LEVEL = ${build.number};" byline="true" />
</target>
public final class Version {
/**
* Major number of the current version
*/
public static final int MAJOR_VERSION = 2;
/**
* Minor number of the current version
*/
public static final int MINOR_VERSION = 0;
/**
* Number of the build level
*/
public static final int BUILD_LEVEL = 5;
}