Adding 'dos' and 'as' to the AntTask. #20

This commit is contained in:
Rob Greene 2018-03-04 13:27:08 -06:00
parent 59a08d5146
commit 1987164dc5
2 changed files with 20 additions and 5 deletions

View File

@ -1,5 +1,7 @@
package com.webcodepro.applecommander.ui; package com.webcodepro.applecommander.ui;
import java.io.FileInputStream;
/* /*
* Copyright (C) 2012 by David Schmidt * Copyright (C) 2012 by David Schmidt
* david__schmidt at users.sourceforge.net * david__schmidt at users.sourceforge.net
@ -25,6 +27,7 @@ import java.io.PrintStream;
import org.apache.tools.ant.BuildException; import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task; import org.apache.tools.ant.Task;
import com.webcodepro.applecommander.storage.Disk; import com.webcodepro.applecommander.storage.Disk;
import com.webcodepro.applecommander.storage.DiskException; import com.webcodepro.applecommander.storage.DiskException;
import com.webcodepro.applecommander.storage.FormattedDisk; import com.webcodepro.applecommander.storage.FormattedDisk;
@ -35,7 +38,8 @@ public class AntTask extends Task
{ {
/* /*
* Commands: * Commands:
* cc65: <imagename> <filename> <type> * dos: <imagename> <filename> <type>
* as: <imagename> [<filename>]
* d: <imagename> <filename> * d: <imagename> <filename>
* e: <imagename> <filename> * e: <imagename> <filename>
* i: <imagename> * i: <imagename>
@ -83,7 +87,7 @@ public class AntTask extends Task
System.out.println(ex.getMessage()); System.out.println(ex.getMessage());
} }
} }
else if (_command.equals("p") || (_command.equals("cc65"))) else if (_command.equals("p") || (_command.equals("cc65") || (_command.equals("cc65")) || (_command.equals("as"))))
{ {
try try
{ {
@ -91,8 +95,19 @@ public class AntTask extends Task
{ {
com.webcodepro.applecommander.ui.ac.putFile(_input, _imageName, _fileName, _type, _address); com.webcodepro.applecommander.ui.ac.putFile(_input, _imageName, _fileName, _type, _address);
} }
else else if (_command.equals("cc65"))
com.webcodepro.applecommander.ui.ac.putCC65(_input, _imageName, _fileName, _type); {
System.err.println("Note: 'cc65' is deprecated. Please use 'as' or 'dos' as appropriate.");
com.webcodepro.applecommander.ui.ac.putDOS(_input, _imageName, _fileName, _type);
}
else if (_command.equals("dos"))
{
com.webcodepro.applecommander.ui.ac.putDOS(_input, _imageName, _fileName, _type);
}
else {
com.webcodepro.applecommander.ui.ac.putAppleSingle(_imageName, _fileName,
new FileInputStream(_input));
}
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -247,7 +247,7 @@ public class ac {
* Put file fileName into the file named fileOnImageName on the disk named imageName; * Put file fileName into the file named fileOnImageName on the disk named imageName;
* Assume a cc65 style four-byte header with start address in bytes 0-1. * Assume a cc65 style four-byte header with start address in bytes 0-1.
*/ */
public static void putCC65(String fileName, String imageName, String fileOnImageName, String fileType) public static void putDOS(String fileName, String imageName, String fileOnImageName, String fileType)
throws IOException, DiskException { throws IOException, DiskException {
byte[] header = new byte[4]; byte[] header = new byte[4];