From: <ls...@us...> - 2009-04-11 09:22:13
|
Revision: 5243 http://jnode.svn.sourceforge.net/jnode/?rev=5243&view=rev Author: lsantha Date: 2009-04-11 09:22:10 +0000 (Sat, 11 Apr 2009) Log Message: ----------- Removing non-classlib classes. Modified Paths: -------------- classlib6/all/build.xml classlib6/all/lib/jnode.xml Removed Paths: ------------- classlib6/builder/src/builder/org/jnode/build/BootDiskBuilder.java classlib6/builder/src/builder/org/jnode/build/BootFloppyBuilder.java classlib6/builder/src/configure/ classlib6/distr/ classlib6/fs/ classlib6/gui/ classlib6/net/ classlib6/shell/ classlib6/sound/ classlib6/textui/ Modified: classlib6/all/build.xml =================================================================== --- classlib6/all/build.xml 2009-04-11 07:29:01 UTC (rev 5242) +++ classlib6/all/build.xml 2009-04-11 09:22:10 UTC (rev 5243) @@ -1,4 +1,4 @@ -<project name="JNode" default="help" basedir="."> +<project name="JNode" default="assemble-plugins" basedir="."> <!-- if task is used from this --> <taskdef resource="net/sf/antcontrib/antcontrib.properties"/> <!-- before including jnode.xml, we must set this property --> @@ -371,35 +371,6 @@ <ant antfile="build-jop.xml" inheritall="on" inheritrefs="on"/> </target> - <!-- Build the boot files for windows NT/2K/XP (with NTLDR) --> - <target name="boot-files-winNT" depends="assemble"> - <x86-build bits="32" target="boot-files-winNT"/> - </target> - - <!-- Create a bootable CDROM image containing all x86 bootable images and the sources --> - <target name="cd-x86" depends="assemble" description="create a bootable JNode CD image with sources included"> - <tar destfile="${sources.dist.tar.gz}" compression="gzip" basedir="${root.dir}" excludes="*/build/**"/> - <x86-build bits="32" target="java-image"/> - <!-- TODO enable this when 64 bit support is working --> - <!--x86-build bits="64" target="java-image"/--> - <property name="jnode.bits" value="32" /> - <ant antfile="build-x86.xml" inheritall="true" inheritrefs="true" target="cdrom"/> - </target> - - <!-- Create a bootable CDROM image for x86 32-bits --> - <target name="cd-x86-lite" depends="assemble" description="create a bootable JNode CD image"> - <x86-build bits="32" target="java-image"/> - <property name="jnode.bits" value="32" /> - <ant antfile="build-x86.xml" inheritall="true" inheritrefs="true" target="cdrom-lite"/> - </target> - - <!-- Create a bootable CDROM image for x86 64-bits --> - <target name="cd-x86_64-lite" depends="assemble"> - <x86-build bits="64" target="java-image"/> - <property name="jnode.bits" value="64" /> - <ant antfile="build-x86.xml" inheritall="true" inheritrefs="true" target="cdrom_64-lite"/> - </target> - <!-- Upload a distribution --> <target name="upload"> <property name="upload.dir" value="${build.dir}/upload"/> @@ -922,90 +893,7 @@ </target> - <target name="checkstyle" description="check the mandatory code conventions"> - <taskdef resource="checkstyletask.properties" classpath="../core/lib/checkstyle-all-4.4.jar"/> - <checkstyle config="jnode_checks.xml"> - <fileset dir="../builder/src/builder" includes="**/*.java"/> - <fileset dir="../builder/src/configure" includes="**/*.java"/> - <fileset dir="../core/src/core" includes="**/*.java"/> - <fileset dir="../core/src/driver" includes="**/*.java"/> - <fileset dir="../core/src/test" includes="**/*.java"/> - <fileset dir="../distr/src/apps" includes="**/*.java"/> - <fileset dir="../distr/src/emu" includes="**/*.java"/> - <fileset dir="../distr/src/install" includes="**/*.java"/> - <fileset dir="../distr/src/test" includes="**/*.java"/> - <fileset dir="../fs/src/fs" includes="**/*.java"/> - <fileset dir="../fs/src/driver" includes="**/*.java"/> - <fileset dir="../fs/src/test" includes="**/*.java"/> - <fileset dir="../gui/src/test" includes="**/*.java"/> - <fileset dir="../gui/src/desktop" includes="**/*.java"/> - <fileset dir="../gui/src/driver" includes="**/*.java"/> - <fileset dir="../gui/src/awt" includes="**/*.java"/> - <fileset dir="../net/src/net" includes="**/*.java"/> - <fileset dir="../net/src/driver" includes="**/*.java"/> - <fileset dir="../net/src/test" includes="**/*.java"/> - <fileset dir="../shell/src/test" includes="**/*.java"/> - <fileset dir="../shell/src/shell" includes="**/*.java"/> - </checkstyle> - </target> - <target name="checkstyle-new" description="check the recommanded code conventions"> - <taskdef resource="checkstyletask.properties" classpath="../core/lib/checkstyle-all-4.4.jar"/> - <checkstyle config="new_checks.xml"> - <!-- - <fileset dir="../builder/src/builder" includes="**/*.java"/> - <fileset dir="../builder/src/configure" includes="**/*.java"/> - <fileset dir="../core/src/core" includes="**/*.java"/> - <fileset dir="../core/src/driver" includes="**/*.java"/> - <fileset dir="../core/src/test" includes="**/*.java"/> - --> - <fileset dir="../distr/src/apps" includes="**/*.java"/> - <fileset dir="../distr/src/emu" includes="**/*.java"/> - <fileset dir="../distr/src/install" includes="**/*.java"/> - <fileset dir="../distr/src/test" includes="**/*.java"/> - <!-- - <fileset dir="../fs/src/fs" includes="**/*.java"/> - <fileset dir="../fs/src/driver" includes="**/*.java"/> - <fileset dir="../fs/src/test" includes="**/*.java"/> - <fileset dir="../gui/src/test" includes="**/*.java"/> - <fileset dir="../gui/src/desktop" includes="**/*.java"/> - <fileset dir="../gui/src/driver" includes="**/*.java"/> - <fileset dir="../gui/src/awt" includes="**/*.java"/> - <fileset dir="../net/src/net" includes="**/*.java"/> - <fileset dir="../net/src/driver" includes="**/*.java"/> - <fileset dir="../net/src/test" includes="**/*.java"/> - <fileset dir="../shell/src/test" includes="**/*.java"/> - <fileset dir="../shell/src/shell" includes="**/*.java"/> - --> - </checkstyle> - </target> - - <target name="findbugs" depends="assemble-plugins"> - <taskdef name="findbugs" classpath="../core/lib/findbugs/lib/findbugs-ant.jar" - classname="edu.umd.cs.findbugs.anttask.FindBugsTask"/> - <findbugs home="../core/lib/findbugs/" output="html" outputFile="./build/findbugs.html" > - <auxclasspath> - <pathelement location="./build/plugins/rt_${jnode-ver}.jar" /> - <pathelement location="./build/plugins/org.classpath.ext.core_${jnode-ver}.jar" /> - <pathelement location="./build/plugins/nanoxml_1.4.jar" /> - <pathelement location="${nanoxml-java.jar}" /> - <pathelement location="${log4j.jar}" /> - </auxclasspath> - <sourcepath> - <pathelement path="../core/src/core/"/> - </sourcepath> - <class location="./build/plugins/org.jnode.vm_${jnode-ver}.jar"/> - <class location="./build/plugins/org.jnode.vm.core_${jnode-ver}.jar"/> - <class location="./build/plugins/org.jnode.vm.memmgr.def_${jnode-ver}.jar"/> - <class location="./build/plugins/org.jnode.driver_${jnode-ver}.jar"/> - <class location="./build/plugins/org.jnode.runtime_${jnode-ver}.jar"/> - <class location="./build/plugins/org.jnode.runtime.core_${jnode-ver}.jar"/> - <class location="./build/plugins/org.jnode.util_${jnode-ver}.jar"/> - <class location="./build/plugins/org.jnode.work_${jnode-ver}.jar"/> - <class location="./build/plugins/org.jnode.security_${jnode-ver}.jar"/> - </findbugs> - </target> - <!-- Create a patch --> <!-- TODO create replacement SVN task <target name="create-patch"> Modified: classlib6/all/lib/jnode.xml =================================================================== --- classlib6/all/lib/jnode.xml 2009-04-11 07:29:01 UTC (rev 5242) +++ classlib6/all/lib/jnode.xml 2009-04-11 09:22:10 UTC (rev 5243) @@ -63,13 +63,7 @@ <attribute name="target"/> <sequential> <ant target="@{target}" dir="${root.dir}/core" inheritall="on" inheritrefs="on" /> - <ant target="@{target}" dir="${root.dir}/shell" inheritall="on" inheritrefs="on" /> - <ant target="@{target}" dir="${root.dir}/net" inheritall="on" inheritrefs="on" /> - <ant target="@{target}" dir="${root.dir}/fs" inheritall="on" inheritrefs="on" /> <ant target="@{target}" dir="${root.dir}/builder" inheritall="on" inheritrefs="on" /> - <ant target="@{target}" dir="${root.dir}/gui" inheritall="on" inheritrefs="on" /> - <ant target="@{target}" dir="${root.dir}/textui" inheritall="on" inheritrefs="on" /> - <ant target="@{target}" dir="${root.dir}/distr" inheritall="on" inheritrefs="on" /> </sequential> </macrodef> Deleted: classlib6/builder/src/builder/org/jnode/build/BootDiskBuilder.java =================================================================== --- classlib6/builder/src/builder/org/jnode/build/BootDiskBuilder.java 2009-04-11 07:29:01 UTC (rev 5242) +++ classlib6/builder/src/builder/org/jnode/build/BootDiskBuilder.java 2009-04-11 09:22:10 UTC (rev 5243) @@ -1,189 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2009 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.build; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; -import java.io.PrintWriter; -import java.util.StringTokenizer; -import org.apache.tools.ant.Project; -import org.jnode.driver.ApiNotFoundException; -import org.jnode.driver.Device; -import org.jnode.driver.DriverException; -import org.jnode.driver.block.BlockDeviceAPI; -import org.jnode.driver.block.Geometry; -import org.jnode.driver.block.MappedFSBlockDeviceSupport; -import org.jnode.fs.FileSystemException; -import org.jnode.fs.fat.FatType; -import org.jnode.fs.fat.GrubBootSector; -import org.jnode.fs.fat.GrubFatFormatter; -import org.jnode.partitions.ibm.IBMPartitionTableEntry; -import org.jnode.partitions.ibm.IBMPartitionTypes; - -/** - * @author Ewout Prangsma (ep...@us...) - */ -public class BootDiskBuilder extends BootFloppyBuilder { - - private File plnFile; - - int bytesPerSector = 512; - - int spc = 1; - - private Geometry geom = new Geometry(64, 16, 32); - - private MappedFSBlockDeviceSupport part0; - - public BootDiskBuilder() { - } - - /** - * Create the actual bootfloppy. - * - * @throws IOException - * @throws DriverException - * @throws FileSystemException - */ - public void createImage() throws IOException, DriverException, - FileSystemException { - super.createImage(); - - FileWriter fw = new FileWriter(plnFile); - PrintWriter pw = new PrintWriter(fw); - pw.println("DRIVETYPE ide"); - pw.println("CYLINDERS " + geom.getCylinders()); - pw.println("HEADS " + geom.getHeads()); - pw.println("SECTORS " + geom.getSectors()); - pw.println("CAPACITY " + geom.getTotalSectors()); - pw.println("ACCESS \"" + getDestFile().getCanonicalPath() - + "\" 0 102400"); - pw.flush(); - fw.flush(); - pw.close(); - fw.close(); - System.out.println("Wrote " + plnFile); - } - - /** - * Format the given device. - * - * @param device - * @throws IOException - */ - protected void formatDevice(Device device) throws IOException { - - /* Format the MBR & partitiontable */ - GrubBootSector mbr = (GrubBootSector) (createFormatter() - .getBootSector()); - - IBMPartitionTableEntry pte = mbr.initPartitions(geom, IBMPartitionTypes.PARTTYPE_DOS_FAT16_LT32M); - - /* - * System.out.println("partition table:"); for (int i = 0; i < 4; i++) { - * System.out.println("" + i + " " + mbr.getPartition(i)); } - */ - - /* Format partition 0 */ - part0 = new MappedFSBlockDeviceSupport(device, pte.getStartLba() - * bytesPerSector, pte.getNrSectors() * bytesPerSector); - GrubFatFormatter ff = createFormatter(); - ff.setInstallPartition(0x0000FFFF); - ff.format(part0); - GrubBootSector part0bs = (GrubBootSector) ff.getBootSector(); - - /* Fixup stage2 sector in MBR */ - mbr.setStage2Sector(pte.getStartLba() + part0bs.getStage2Sector()); - try { - mbr.write(device.getAPI(BlockDeviceAPI.class)); - } catch (ApiNotFoundException ex) { - final IOException ioe = new IOException("BlockDeviceAPI not found on device"); - ioe.initCause(ex); - throw ioe; - } - //System.out.println("mbr stage2 sector=" + mbr.getStage2Sector()); - } - - /** - * @return The formatter - * @throws IOException - * @see org.jnode.build.BootFloppyBuilder#createFormatter() - */ - protected GrubFatFormatter createFormatter() throws IOException { - return new GrubFatFormatter(bytesPerSector, spc, geom, FatType.FAT16, 1, - getStage1ResourceName(), getStage2ResourceName()); - } - - /** - * @return The device length - * @see org.jnode.build.BootFloppyBuilder#getDeviceLength() - */ - protected long getDeviceLength() { - return geom.getTotalSectors() * bytesPerSector; - } - - /** - * @return File - */ - public File getPlnFile() { - return plnFile; - } - - /** - * Sets the plnFile. - * - * @param plnFile The plnFile to set - */ - public void setPlnFile(File plnFile) { - this.plnFile = plnFile; - } - - /** - * @param rootDevice - * @return The device - * @see org.jnode.build.BootFloppyBuilder#getSystemDevice(Device) - */ - protected Device getSystemDevice(Device rootDevice) { - return part0; - } - - /** - * Used by ant to set the geometry property. - * - * @param geometryString String in the format 'cylinder/heads/sectors', - * e.g. '64/16/32'. - */ - public void setGeometry(String geometryString) { - try { - log("Setting bootdisk geometry to " + geometryString, Project.MSG_VERBOSE); - StringTokenizer tokenizer = new StringTokenizer(geometryString, "/"); - geom = new Geometry(Integer.parseInt(tokenizer.nextToken()), - Integer.parseInt(tokenizer.nextToken()), Integer - .parseInt(tokenizer.nextToken())); - } catch (Exception e) { - throw new IllegalArgumentException( - "Invalid geometry " - + geometryString - + ". Must correspond to pattern '<cylinders>/<heads>/<sectors>' e.g. '64/16/32'."); - } - } -} Deleted: classlib6/builder/src/builder/org/jnode/build/BootFloppyBuilder.java =================================================================== --- classlib6/builder/src/builder/org/jnode/build/BootFloppyBuilder.java 2009-04-11 07:29:01 UTC (rev 5242) +++ classlib6/builder/src/builder/org/jnode/build/BootFloppyBuilder.java 2009-04-11 09:22:10 UTC (rev 5243) @@ -1,333 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2003-2009 JNode.org - * - * This library is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; either version 2.1 of the License, or - * (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public - * License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this library; If not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package org.jnode.build; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.nio.ByteBuffer; -import java.util.ArrayList; -import org.apache.tools.ant.DirectoryScanner; -import org.apache.tools.ant.Task; -import org.apache.tools.ant.types.FileSet; -import org.jnode.driver.ApiNotFoundException; -import org.jnode.driver.Device; -import org.jnode.driver.DriverException; -import org.jnode.driver.block.BlockDeviceAPI; -import org.jnode.driver.block.FileDevice; -import org.jnode.fs.FSDirectory; -import org.jnode.fs.FSEntry; -import org.jnode.fs.FSFile; -import org.jnode.fs.FileSystemException; -import org.jnode.fs.fat.FatFileSystem; -import org.jnode.fs.fat.FatFileSystemType; -import org.jnode.fs.fat.GrubFatFormatter; -import org.jnode.util.FileUtils; - -/** - * Builder for the boot floppy (in fact, it's not a floppy but a cdrom image in the iso format). - * - * @author epr - */ -public class BootFloppyBuilder extends Task { - - private File destFile; - - private String stage1ResourceName; - - private String stage2ResourceName; - - private ArrayList<FileSet> fileSets = new ArrayList<FileSet>(); - - /** - * Build the boot floppy. - * - * @throws BuildException - */ - public void execute() throws BuildException { - - try { - if (isExecuteNeeded()) { - createImage(); - } - } catch (Throwable ex) { - ex.printStackTrace(System.err); - throw new BuildException(ex); - } - } - - protected boolean isExecuteNeeded() { - final long lmDest = destFile.lastModified(); - return (getLastModified() > lmDest); - } - - /** - * Create the actual bootfloppy. - * - * @throws IOException - * @throws DriverException - * @throws FileSystemException - */ - public void createImage() throws IOException, DriverException, - FileSystemException { - - final FileDevice newFd = new FileDevice(destFile, "rw"); - try { - newFd.setLength(getDeviceLength()); - formatDevice(newFd); - final Device sysDev = getSystemDevice(newFd); - final BlockDeviceAPI sysDevApi = sysDev - .getAPI(BlockDeviceAPI.class); - copySystemFiles(sysDev); - sysDevApi.flush(); - } catch (ApiNotFoundException ex) { - final IOException ioe = new IOException("BlockDeviceAPI not found on device"); - ioe.initCause(ex); - throw ioe; - } finally { - newFd.close(); - } - } - - /** - * Format the given device. - * - * @param dev - * @throws IOException - */ - protected void formatDevice(Device dev) throws IOException { - GrubFatFormatter ff = createFormatter(); - try { - ff.format(dev.getAPI(BlockDeviceAPI.class)); - } catch (ApiNotFoundException ex) { - final IOException ioe = new IOException("BlockDeviceAPI not found on device"); - ioe.initCause(ex); - throw ioe; - } - } - - /** - * Gets the device the system files must be copied onto. This enabled a - * disk to be formatted with partitions. - * - * @param rootDevice - * @return BlockDevice - */ - protected Device getSystemDevice(Device rootDevice) { - return rootDevice; - } - - /** - * Copy the system files to the given device. - * - * @param device - * @throws IOException - * @throws FileSystemException - */ - protected void copySystemFiles(Device device) throws IOException, - FileSystemException { - final FatFileSystem fs = new FatFileSystem(device, false, new FatFileSystemType()); - - for (FileSet fset : fileSets) { - processFileSet(fs, fset); - } - - fs.close(); - } - - private void processFileSet(FatFileSystem fs, FileSet fset) throws IOException { - final DirectoryScanner ds = fset.getDirectoryScanner(getProject()); - final String[] dirs = ds.getIncludedDirectories(); - for (int i = 0; i < dirs.length; i++) { - getOrCreateDir(fs, dirs[i]); - } - final String[] files = ds.getIncludedFiles(); - for (int i = 0; i < files.length; i++) { - final String fn = files[i]; - final int idx = fn.lastIndexOf(File.separatorChar); - final FSDirectory dir; - final String name; - if (idx >= 0) { - dir = getOrCreateDir(fs, fn.substring(0, idx)); - name = fn.substring(idx + 1); - } else { - dir = getOrCreateDir(fs, ""); - name = fn; - } - final File f = new File(ds.getBasedir(), fn); - addFile(dir, f, name); - } - } - - /** - * Gets the last modification date of all parameters. - * - * @return - */ - protected long getLastModified() { - long lm = 0l; - for (FileSet fset : fileSets) { - lm = Math.max(lm, getLastModified(fset)); - } - return lm; - } - - private long getLastModified(FileSet fset) { - final DirectoryScanner ds = fset.getDirectoryScanner(getProject()); - final File baseDir = ds.getBasedir(); - long lm = 0l; - final String[] dirs = ds.getIncludedDirectories(); - for (int i = 0; i < dirs.length; i++) { - lm = Math.max(lm, new File(baseDir, dirs[i]).lastModified()); - } - final String[] files = ds.getIncludedFiles(); - for (int i = 0; i < files.length; i++) { - lm = Math.max(lm, new File(baseDir, files[i]).lastModified()); - } - return lm; - - } - - private FSDirectory getOrCreateDir(FatFileSystem fs, String dirName) - throws IOException { - FSDirectory dir = fs.getRootDir(); - while (dirName.length() > 0) { - final int idx = dirName.indexOf(File.separatorChar); - final String part; - if (idx >= 0) { - part = dirName.substring(0, idx); - dirName = dirName.substring(idx + 1); - } else { - part = dirName; - dirName = ""; - } - FSEntry entry; - try { - entry = dir.getEntry(part); - } catch (IOException ex) { - // Ignore - entry = null; - } - if (entry == null) { - entry = dir.addDirectory(part); - } - dir = entry.getDirectory(); - } - return dir; - } - - /** - * Add a given file to a given directory with a given filename. - * - * @param dir - * @param src - * @param fname - * @throws IOException - */ - private void addFile(FSDirectory dir, File src, String fname) - throws IOException { - - long size = src.length(); - /* - * log.info( "Adding " + src + " as " + fname + " size " + (size / - * 1024) + "Kb"); - */ - - //final byte[] buf = new byte[ (int) size]; - final ByteBuffer buf = ByteBuffer.allocate((int) size); - InputStream is = new FileInputStream(src); - FileUtils.copy(is, buf.array()); - is.close(); - - final FSFile fh = dir.addFile(fname).getFile(); - fh.setLength(size); - //fh.write(0, buf, 0, buf.length); - fh.write(0, buf); - - log("Added " + src + " as " + fname + " size " + (size / 1024) + "Kb"); - } - - /** - * Returns the destFile. - * - * @return File - */ - public File getDestFile() { - return destFile; - } - - /** - * Sets the destFile. - * - * @param destFile The destFile to set - */ - public void setDestFile(File destFile) { - this.destFile = destFile; - } - - protected GrubFatFormatter createFormatter() throws IOException { - return new GrubFatFormatter(0, stage1ResourceName, stage2ResourceName); - } - - protected long getDeviceLength() { - return 1440 * 1024; - } - - /** - * @return Returns the stage1ResourceName. - */ - public final String getStage1ResourceName() { - return this.stage1ResourceName; - } - - /** - * @param stage1ResourceName The stage1ResourceName to set. - */ - public final void setStage1ResourceName(String stage1ResourceName) { - this.stage1ResourceName = stage1ResourceName; - } - - /** - * @return Returns the stage2ResourceName. - */ - public final String getStage2ResourceName() { - return this.stage2ResourceName; - } - - /** - * @param stage2ResourceName The stage2ResourceName to set. - */ - public final void setStage2ResourceName(String stage2ResourceName) { - this.stage2ResourceName = stage2ResourceName; - } - - /** - * Add a fileset to this task. - * - * @return - */ - public FileSet createFileset() { - final FileSet fs = new FileSet(); - fileSets.add(fs); - return fs; - } -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |