-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from Bearsampp/newbuild
build.xml improvement
- Loading branch information
Showing
2 changed files
with
83 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
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,61 @@ | ||
<project name = "Sigcheck" default = "executeSigcheck"> | ||
|
||
<!-- Define properties --> | ||
<property name = "sigcheck" value = "sigcheck -q" /> | ||
<property name = "output.file" value = "sigcheck_output.txt" /> | ||
|
||
<!-- Define a property for the PHP extension DLL --> | ||
<property name = "phpext.dll" value = "${phpext.dll}" /> | ||
|
||
<target name = "executeSigcheck"> | ||
<!-- Execute sigcheck and save the output to a file --> | ||
<exec executable = "cmd" output = "${output.file}" failonerror = "false"> | ||
<arg value = "/c" /> | ||
<!-- Pass the value of ${phpext.dll} as an argument to sigcheck --> | ||
<arg value = "${sigcheck}" /> | ||
<arg value = "${phpext.dll}" /> | ||
</exec> | ||
|
||
<!-- Read the content of the output file and extract "MachineType" --> | ||
<loadfile property = "arch" srcfile = "${output.file}"> | ||
<filterchain> | ||
<linecontains> | ||
<contains value = "MachineType:" /> | ||
</linecontains> | ||
<tokenfilter> | ||
<replaceregex pattern = "^.*MachineType:\s*(\S+).*$" replace = "\1" /> | ||
</tokenfilter> | ||
</filterchain> | ||
</loadfile> | ||
|
||
<propertyregex property="filename" input="${phpext.dll}" regexp=".*/([^/]*)$" select="\1"/> | ||
|
||
<!-- Echo the "MachineType" --> | ||
<echo message = "MachineType: ${arch}" /> | ||
<echo message=".dll filename is: ${filename}"/> | ||
|
||
<condition property = "property.matches.64"> | ||
<matches string = "${arch}" pattern = "64-bit" /> | ||
</condition> | ||
|
||
<if> | ||
<not> | ||
<isset property = "property.matches.64" /> | ||
</not> | ||
<then> | ||
<echo message = "Your property does not match '64-bit'." /> | ||
<exec executable = "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" failonerror = "true"> | ||
<arg value = "-NoLogo" /> | ||
<arg value = "-NoProfile" /> | ||
<arg value = "-Command" /> | ||
<arg value = "(New-Object -ComObject SAPI.SpVoice).Speak('OH NO!, the dll file ${filename}, is not built for x64, Halting build.')" /> | ||
</exec> | ||
<fail message = " Architecture is not '64-bit'. Halting build." /> | ||
</then> | ||
</if> | ||
|
||
<!-- Delete sigchecks temp file --> | ||
<delete file="sigcheck_output.txt"/> | ||
|
||
</target> | ||
</project> |