-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbuild.xml
46 lines (45 loc) · 2.04 KB
/
build.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?xml version="1.0" encoding="UTF-8" ?>
<project name="Optimus" default="build">
<target name="update_version">
<property file="build.properties" />
<xmlproperty file="${source_file}" keepRoot="false" />
<echo message="Current version is ${version}" />
<input message="What is your release type?" propertyName="release.type" defaultValue="thesame" validargs="thesame,major,minor,bugfix" />
<echo message="Release type: ${release.type}" />
<if>
<equals arg1="${release.type}" arg2="thesame" />
<then>
<property name="release.version" value="${version}" />
</then>
<else>
<version releasetype="${release.type}" startingVersion="${version}" property="release.version" />
<delete file="build.version" quiet="true" />
<echo message="${release.version}" />
<replaceregexp file="${source_file}" match="${version_search_pattern}" replace="${version_replace_pattern}" />
<replaceregexp file="${integration_file}" match="'OP_VERSION',\s*'(\d+\.\d+(?:.\d+)?)'" replace="'OP_VERSION', '${release.version}'"/>
</else>
</if>
</target>
<target name="build" depends="update_version">
<delete file="optimus_${release.version}.zip" quiet="true" />
<zip destfile="optimus_${release.version}.zip">
<fileset dir=".">
<include name="LICENSE" />
</fileset>
<fileset dir="./src">
<include name="Themes/**" />
<exclude name="**/.idea/**" />
<include name="Sources/**" />
<exclude name="Sources/Optimus/Addons/ExtraSettings/**" />
<exclude name="Sources/Optimus/Addons/IndexNow/**" />
<exclude name="Sources/Optimus/Addons/ExampleAddon.php" />
<exclude name="Sources/Optimus/Addons/SafeLinks.php" />
<exclude name="Sources/Optimus/Addons/StructuredData.php" />
<exclude name="Sources/Optimus/composer.json" />
<exclude name="Sources/Optimus/composer.lock" />
<include name="package-info.xml" />
<include name="*.php" />
</fileset>
</zip>
</target>
</project>