| Copyright 2015 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 <Install$Dir>.BonusBin Then Else Obey

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

| Create an empty directory to hold the files that will be zipped up
CDir <ab_res$dir>.zip

| Copy the Apache licence file into the zip directory
Copy ab_res:LICENSE <ab_res$dir>.zip.LICENSE ~cf~r~v

| Copy the ROM image into the zip directory
Copy <Install$Dir>.BonusBin <ab_res$dir>.zip.HardDisc4 ~cfr~v

| Copy the ReadMe for this build into the zip directory
Copy ab_res:ReadMe/txt <ab_res$dir>.zip.ReadMe/txt ~cf~r~v
Copy ab_res:Replay/txt <ab_res$dir>.zip.HardDisc4.Apps.Replay.ReadMe/txt ~cf~r~v
Copy ab_res:Territories/txt <ab_res$dir>.zip.HardDisc4.Modules.Territories.ReadMe/txt ~cf~r~v
Copy ab_res:DeveloperModules/txt <ab_res$dir>.zip.HardDisc4.Modules.Developer.ReadMe/txt ~cf~r~v

| Set the zip directory as the current directory
Dir <ab_res$dir>.zip

| Create a zip archive with the required files in it
Do zip -9qr ^.<ab_local$zip> *

| Return the CSD to its original state
Back

| Delete any pre-existing zip archive on the autobuild server
Remove <ab_zip$file>

| Copy the template zip archive onto the autobuild server
SetType <ab_res$dir>.<ab_local$zip> &A91
Copy <ab_res$dir>.<ab_local$zip> <ab_zip$file> ~cfr~v
Access <ab_zip$file> rw/r