| Copyright 2013 Castle Technology Ltd
|
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
|     http://www.apache.org/licenses/LICENSE-2.0
|
| Unless required by applicable law or agreed to in writing, software
| distributed under the License is distributed on an "AS IS" BASIS,
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
| See the License for the specific language governing permissions and
| limitations under the License.
|
| If there is no ROM image (e.g. the build failed), exit here
IfThere <Build$Dir>.Images.<Build$ImageName> Then Else Obey

| Run our clean script
Run <ab_res$dir>.clean

| Prepare the ROM build zip directory
CDir <ab_res$dir>.zip

| Populate the ROM Build zip directory
Copy ab_res:LICENSE                       <ab_res$dir>.zip.LICENSE ~cf~r~v
Copy ab_res:ReadMe/txt                    <ab_res$dir>.zip.ReadMe/txt ~cf~r~v
Copy <Build$Dir>.Images.<Build$ImageName> <ab_res$dir>.zip.riscos ~cf~r~v

| Create a zip archive with the required files in it
Dir <ab_res$dir>.zip
Do zip -9qr ^.<ab_local$zip> *
SetType <ab_res$dir>.<ab_local$zip> &A91
Back

| Prepare the softload zip directory
Do Mkdir -p <ab_soft$dir>

| Populate the softload zip directory
Copy ab_res:LICENSE <ab_res$dir>.zips.LICENSE ~cf~r~v
Copy ab_res:soft.ReadMe/txt <ab_res$dir>.zips.ReadMe/txt ~cf~r~v
Copy ab_res:soft.!Run       <ab_soft$dir>.* ~cf~v
Copy ab_res:soft.Loader     <ab_soft$dir>.* ~cf~v
Copy ab_res:soft.SoftLoad   <ab_soft$dir>.* ~cf~v
Run BasCrunch -1 ab_res:soft.Prompt <ab_soft$dir>.Prompt
Copy <ab_res$dir>.zip.riscos <ab_soft$dir>.riscos ~cf~r~v

| Copy pre-EDID specific softload support
Do Mkdir -p <ab_res$dir>.zips.!Boot.Choices.Boot.PreDesk
Copy ab_res:Configure <ab_res$dir>.zips.!Boot.Choices.Boot.PreDesk.Configure ~cfr~v

| Create a zip archive with the required files in it
Dir <ab_res$dir>.zips
Do zip -9qr ^.<ab_local$soft> *
SetType <ab_res$dir>.<ab_local$soft> &A91
Back

| Prepare the translation resources zipfile
CDir <ab_res$dir>.translate
CDir <ab_res$dir>.translate.Unprocessed
Copy ab_res:LICENSE <ab_res$dir>.translate.LICENSE ~cf~r~v
Sed -e s/"_BUILD_"/"RiscPC\/A7000\/A7000+"/g < ab_res:TransReadMe/txt >  <ab_res$dir>.translate.ReadMe/txt
IfThere <Resource$Dir>.Apps       Then Copy <Resource$Dir>.Apps       <ab_res$dir>.translate.Unprocessed.Apps ~cfr~v
IfThere <Resource$Dir>.Resources  Then Copy <Resource$Dir>.Resources  <ab_res$dir>.translate.Unprocessed.Resources ~cfr~v
IfThere <Resource$Dir>.Resources2 Then Copy <Resource$Dir>.Resources2 <ab_res$dir>.translate.Unprocessed.Resources ~cfr~v
IfThere <Resource$Dir>.Resources3 Then Copy <Resource$Dir>.Resources3 <ab_res$dir>.translate.Unprocessed.Resources ~cfr~v
IfThere <Resource$Dir>.Resources4 Then Copy <Resource$Dir>.Resources4 <ab_res$dir>.translate.Unprocessed.Resources ~cfr~v

| Create a zip archive with the required files in it
Dir <ab_res$dir>.translate
Do zip -9qr ^.<ab_local$translate> *
SetType <ab_res$dir>.<ab_local$translate> &A91
Back

| Copy just the ROM build zip archive onto the autobuild server
Remove <ab_zip$file>
Copy <ab_res$dir>.<ab_local$zip> <ab_zip$file> ~cfr~v
Access <ab_zip$file> rw/r