ScalaBazaar Ant task now correctly handles empty packages (placeholders).

git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@6637 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
dubochet 2006-03-08 21:25:29 +00:00
parent 10e2d3e496
commit 14d6c0ba4c
1 changed files with 16 additions and 16 deletions

View File

@ -235,6 +235,8 @@ package scala.tools.ant {
</package>
}
log("Creating package '" + name.get + "'")
// Creates the advert file
val advert = {
<availablePackage>
@ -255,11 +257,10 @@ package scala.tools.ant {
for {
val Pair(folder, fileSets) <- fileSetsMap.fileSets
val fileSet <- fileSets
val file <-
List.fromArray(fileSet.getDirectoryScanner(getProject).getIncludedFiles)
} yield {Console.println(file.toString); Triple(folder, fileSet.getDir(getProject), file)}
val file <- List.fromArray(fileSet.getDirectoryScanner(getProject).getIncludedFiles)
} yield Triple(folder, fileSet.getDir(getProject), file)
val zip = new ZipOutputStream(new FileOutputStream(file.get, false))
if (!zipContent.isEmpty) {
val zip = new ZipOutputStream(new FileOutputStream(file.get, false))
for (val Triple(destFolder, srcFolder, file) <- zipContent) {
log(file, Project.MSG_DEBUG)
zip.putNextEntry(new ZipEntry(destFolder + "/" + file))
@ -272,18 +273,17 @@ package scala.tools.ant {
zip.closeEntry()
input.close()
}
zip.putNextEntry(new ZipEntry("meta/description"))
val packInput = new StringReader(pack.toString())
var byte = packInput.read()
while (byte != -1) {
zip.write (byte)
byte = packInput.read()
}
zip.closeEntry()
packInput.close()
zip.close
} else log("No files added to SBaz archive.", Project.MSG_VERBOSE)
} else log("Archive contains no files.", Project.MSG_VERBOSE)
zip.putNextEntry(new ZipEntry("meta/description"))
val packInput = new StringReader(pack.toString())
var byte = packInput.read()
while (byte != -1) {
zip.write (byte)
byte = packInput.read()
}
zip.closeEntry()
packInput.close()
zip.close
}
}