Ant clean task
Excludes extracted files and gifs, etc.
This commit is contained in:
parent
9807883de3
commit
48356e9c35
@ -73,10 +73,17 @@
|
|||||||
|
|
||||||
<target description="delete all byproducts" name="clean">
|
<target description="delete all byproducts" name="clean">
|
||||||
<delete>
|
<delete>
|
||||||
<fileset dir="${basedir}" includes="**/*.class"/>
|
<fileset dir="${basedir}" casesensitive="yes">
|
||||||
<fileset dir="${basedir}" includes="**/*Output.txt"/>
|
<include name="**/*.class" />
|
||||||
<fileset dir="${basedir}" includes="**/log.txt"/>
|
<include name="**/*Output.txt" />
|
||||||
<fileset dir="${basedir}" includes="failures"/>
|
<include name="**/log.txt" />
|
||||||
|
<include name="failures" />
|
||||||
|
<exclude name="*.java"/>
|
||||||
|
<exclude name="Copyright.txt Templates.cpp InstantiateGenericType.cpp Mixins.cpp"/>
|
||||||
|
<exclude name="DogsAndRobots.cpp VendingMachineInput.txt Trash.dat DDTrash.dat VTrash.dat log.prop"/>
|
||||||
|
<exclude name="Face*.gif"/>
|
||||||
|
<exclude name="build.xml"/>
|
||||||
|
</fileset>
|
||||||
</delete>
|
</delete>
|
||||||
<echo message="clean successful"/>
|
<echo message="clean successful"/>
|
||||||
</target>
|
</target>
|
||||||
|
@ -47,6 +47,8 @@ parser.add_argument("-a", "--ant", action='store_true',
|
|||||||
help="Copy ant build files from Github repository to extracted examples")
|
help="Copy ant build files from Github repository to extracted examples")
|
||||||
parser.add_argument("-m", "--makeant", action='store_true',
|
parser.add_argument("-m", "--makeant", action='store_true',
|
||||||
help="Make ant files that don't exist")
|
help="Make ant files that don't exist")
|
||||||
|
parser.add_argument("-f", "--find", action='store_true',
|
||||||
|
help="Find non-java files in TIJDirectorsCut.txt")
|
||||||
|
|
||||||
|
|
||||||
def extractExamples():
|
def extractExamples():
|
||||||
@ -167,7 +169,8 @@ def copyAntBuildFiles():
|
|||||||
target = destination / common
|
target = destination / common
|
||||||
shutil.copy(str(build), str(target))
|
shutil.copy(str(build), str(target))
|
||||||
shutil.copy(str(github / "Ant-Common.xml"), str(destination))
|
shutil.copy(str(github / "Ant-Common.xml"), str(destination))
|
||||||
|
for face in (github / "gui").glob("*.gif"):
|
||||||
|
shutil.copy(str(face), str(destination / "gui"))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -351,6 +354,18 @@ def createAntFiles():
|
|||||||
chapter.makeBuildFile()
|
chapter.makeBuildFile()
|
||||||
|
|
||||||
|
|
||||||
|
def findNonJavaFiles():
|
||||||
|
if not sourceText.exists():
|
||||||
|
print("Cannot find", sourceText)
|
||||||
|
sys.exit()
|
||||||
|
with sourceText.open("rb") as book:
|
||||||
|
text = book.read().decode("utf-8", "ignore")
|
||||||
|
for listing in re.findall("^//:.*?///:~", text, re.DOTALL | re.MULTILINE):
|
||||||
|
title = listing.splitlines()[0].strip()
|
||||||
|
if not title.endswith(".java"):
|
||||||
|
print(title)
|
||||||
|
|
||||||
|
|
||||||
def default():
|
def default():
|
||||||
clean()
|
clean()
|
||||||
extractExamples()
|
extractExamples()
|
||||||
@ -378,5 +393,8 @@ if __name__ == '__main__':
|
|||||||
if args.makeant:
|
if args.makeant:
|
||||||
createAntFiles()
|
createAntFiles()
|
||||||
|
|
||||||
|
if args.find:
|
||||||
|
findNonJavaFiles()
|
||||||
|
|
||||||
if args.clean:
|
if args.clean:
|
||||||
clean()
|
clean()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user