-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
56 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
source_file=src/package-info.xml | ||
integration_file=src/Sources/Optimus/app.php | ||
version_search_pattern=(<version>)(.*?)(<\/version>) | ||
version_replace_pattern=<version>${release.version}</version> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters