Skip to content

Commit 411197c

Browse files
committed
feat: add support for rubyinstaller-x64 directory structure
1 parent ebd8826 commit 411197c

File tree

1 file changed

+68
-55
lines changed

1 file changed

+68
-55
lines changed

build.xml

Lines changed: 68 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,97 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<project name = "module-ruby" basedir = ".">
2+
<project name="module-ruby" basedir=".">
33

4-
<dirname property = "project.basedir" file = "${ant.file.module-ruby}" />
5-
<property name = "root.dir" location = "${project.basedir}/.." />
6-
<property name = "build.properties" value = "${project.basedir}/build.properties" />
7-
<property file = "${build.properties}" />
4+
<dirname property="project.basedir" file="${ant.file.module-ruby}" />
5+
<property name="root.dir" location="${project.basedir}/.." />
6+
<property name="build.properties" value="${project.basedir}/build.properties" />
7+
<property file="${build.properties}" />
88

99
<!-- Bearsampp dev -->
10-
<property name = "dev.path" location = "${root.dir}/dev" />
11-
<fail unless = "dev.path" message = "Project 'dev' not found in ${dev.path}" />
12-
<echo message = "Bearsampp dev found in ${dev.path}" level = "debug" />
10+
<property name="dev.path" location="${root.dir}/dev" />
11+
<fail unless="dev.path" message="Project 'dev' not found in ${dev.path}" />
12+
<echo message="Bearsampp dev found in ${dev.path}" level="debug" />
1313

1414
<!-- Import build-commons.xml -->
15-
<import file = "${dev.path}/build/build-commons.xml" />
15+
<import file="${dev.path}/build/build-commons.xml" />
1616
<!-- Import build-bundle.xml -->
17-
<import file = "${dev.path}/build/build-bundle.xml" />
18-
19-
<target name = "release.build">
20-
<basename property = "bundle.folder" file = "${bundle.path}" />
21-
<replaceproperty src = "bundle.folder" dest = "bundle.version" replace = "${bundle.name}" with = "" />
22-
23-
<getmoduleuntouched name = "${bundle.name}" version = "${bundle.version}" propSrcDest = "bundle.srcdest" propSrcFilename = "bundle.srcfilename" />
24-
25-
<echo message = "=======" />
26-
<echo message = "Bundle.srcdest: ${bundle.srcdest}" />
27-
<echo message = "Bundle.name: ${bundle.name}" />
28-
<echo message = "Bundle.version: ${bundle.version}" />
29-
<echo message = "Bundle.folder: ${bundle.folder}" />
30-
<echo message = "Bundle.path: ${bundle.path}" />
31-
<echo message = "Bundle.srcfilename: ${bundle.srcfilename}" />
32-
<echo message = "Input.Bundle: ${input.bundle}" />
33-
<echo message = "Bundle.filename: ${bundle.filename}" />
17+
<import file="${dev.path}/build/build-bundle.xml" />
18+
19+
<target name="release.build">
20+
<basename property="bundle.folder" file="${bundle.path}" />
21+
<replaceproperty src="bundle.folder" dest="bundle.version" replace="${bundle.name}" with="" />
22+
23+
<getmoduleuntouched name="${bundle.name}" version="${bundle.version}" propSrcDest="bundle.srcdest" propSrcFilename="bundle.srcfilename" />
24+
25+
<!-- Check if ruby.exe exists in the rubyinstaller-x64 directory -->
26+
<available file="${bundle.srcdest}/rubyinstaller-${bundle.version}-x64/bin/ruby.exe" property="rubyinstaller.exists" />
27+
28+
<!-- Move files if ruby.exe exists -->
29+
<if>
30+
<isset property="rubyinstaller.exists" />
31+
<then>
32+
<echo message="Moving files from rubyinstaller-${bundle.version}-x64 to ${bundle.srcdest}" />
33+
<move todir="${bundle.srcdest}">
34+
<fileset dir="${bundle.srcdest}/rubyinstaller-${bundle.version}-x64" />
35+
</move>
36+
<delete dir="${bundle.srcdest}/rubyinstaller-${bundle.version}-x64" />
37+
</then>
38+
</if>
39+
40+
<echo message="=======" />
41+
<echo message="Bundle.srcdest: ${bundle.srcdest}" />
42+
<echo message="Bundle.name: ${bundle.name}" />
43+
<echo message="Bundle.version: ${bundle.version}" />
44+
<echo message="Bundle.folder: ${bundle.folder}" />
45+
<echo message="Bundle.path: ${bundle.path}" />
46+
<echo message="Bundle.srcfilename: ${bundle.srcfilename}" />
47+
<echo message="Input.Bundle: ${input.bundle}" />
48+
<echo message="Bundle.filename: ${bundle.filename}" />
3449
<echo message="idk: ${project.basedir}/bin/${bundle.name}${input.bundle}" />
35-
<echo message = "=======" />
50+
<echo message="=======" />
3651

37-
<assertfile file = "${bundle.srcdest}/bin/ruby.exe" />
52+
<assertfile file="${bundle.srcdest}/bin/ruby.exe" />
3853

3954
<!-- Temp copy -->
40-
<copy todir = "${bundle.srcdest}" overwrite = "true">
41-
<fileset dir = "${bundle.path}" defaultexcludes = "yes" />
55+
<copy todir="${bundle.srcdest}" overwrite="true">
56+
<fileset dir="${bundle.path}" defaultexcludes="yes" />
4257
</copy>
4358

4459
<!-- Download RubyGems -->
45-
<echo message = "Download RubyGems" />
46-
<property name = "rubygems.path" location = "${bundle.srcdest}/rubygems" />
47-
<property file = "${rubygems.path}/rubygems.properties" />
48-
<mkdir dir = "${rubygems.path}" />
49-
<get dest = "${rubygems.path}/rubygems-update.gem" src = "${rubygems}" skipexisting = "true" />
60+
<echo message="Download RubyGems" />
61+
<property name="rubygems.path" location="${bundle.srcdest}/rubygems" />
62+
<property file="${rubygems.path}/rubygems.properties" />
63+
<mkdir dir="${rubygems.path}" />
64+
<get dest="${rubygems.path}/rubygems-update.gem" src="${rubygems}" skipexisting="true" />
5065

5166
<!-- Install RubyGems -->
52-
<echo message = "Install RubyGems" />
53-
<exec executable = "${rubygems.path}/install.bat" dir = "${rubygems.path}" failonerror = "true" />
54-
<delete dir = "${rubygems.path}" />
55-
<assertfile file = "${bundle.srcdest}/bin/update_rubygems.bat" />
67+
<echo message="Install RubyGems" />
68+
<exec executable="${rubygems.path}/install.bat" dir="${rubygems.path}" failonerror="true" />
69+
<delete dir="${rubygems.path}" />
70+
<assertfile file="${bundle.srcdest}/bin/update_rubygems.bat" />
5671

5772
<!-- Update RubyGems -->
58-
<echo message = "Update RubyGems" />
59-
<exec executable = "${bundle.srcdest}/bin/update_rubygems.bat" dir = "${bundle.srcdest}/bin" failonerror = "true" />
73+
<echo message="Update RubyGems" />
74+
<exec executable="${bundle.srcdest}/bin/update_rubygems.bat" dir="${bundle.srcdest}/bin" failonerror="true" />
6075

6176
<!-- Check RubyGems version -->
62-
<echo message = "Check RubyGems version" />
63-
<exec executable = "${bundle.srcdest}/bin/gem.bat" dir = "${bundle.srcdest}/bin" failonerror = "true">
64-
<arg value = "--version" />
77+
<echo message="Check RubyGems version" />
78+
<exec executable="${bundle.srcdest}/bin/gem.bat" dir="${bundle.srcdest}/bin" failonerror="true">
79+
<arg value="--version" />
6580
</exec>
6681

6782
<!-- Update paths -->
68-
<echo message = "Update paths" />
69-
<replace dir = "${bundle.srcdest}/bin" token = "${bundle.srcdest}" value = "~BEARSAMPP_LIN_PATH~/tools/ruby/ruby${bundle.version}">
70-
<exclude name = "*.dll,*.exe" />
83+
<echo message="Update paths" />
84+
<replace dir="${bundle.srcdest}/bin" token="${bundle.srcdest}" value="~BEARSAMPP_LIN_PATH~/tools/ruby/ruby${bundle.version}">
85+
<exclude name="*.dll,*.exe" />
7186
</replace>
7287

73-
<delete dir = "${bundle.tmp.prep.path}/${bundle.folder}" />
74-
<mkdir dir = "${bundle.tmp.prep.path}/${bundle.folder}" />
75-
<copy todir = "${bundle.tmp.prep.path}/${bundle.folder}" overwrite = "true">
76-
<fileset dir = "${bundle.srcdest}" />
88+
<delete dir="${bundle.tmp.prep.path}/${bundle.folder}" />
89+
<mkdir dir="${bundle.tmp.prep.path}/${bundle.folder}" />
90+
<copy todir="${bundle.tmp.prep.path}/${bundle.folder}" overwrite="true">
91+
<fileset dir="${bundle.srcdest}" />
7792
</copy>
78-
<copy todir = "${bundle.tmp.prep.path}/${bundle.folder}" overwrite = "true">
79-
<fileset dir = "${bundle.path}" defaultexcludes = "yes" excludes = "
80-
rubygems/**"
81-
/>
93+
<copy todir="${bundle.tmp.prep.path}/${bundle.folder}" overwrite="true">
94+
<fileset dir="${bundle.path}" defaultexcludes="yes" excludes="rubygems/**" />
8295
</copy>
8396
</target>
8497

0 commit comments

Comments
 (0)