-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon-setup.xml
More file actions
53 lines (45 loc) · 2.21 KB
/
common-setup.xml
File metadata and controls
53 lines (45 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?xml version="1.0" encoding="UTF-8"?>
<!--
Setup a new product, creating directories, build and properties stubs
Don't import this, call it instead.
-->
<project name="rti-setup" default="new-project" basedir=".">
<target name="new-project" description="setup a new product ant build and project files">
<property name="projects.dir" location="${basedir}/../"/>
<input message="Enter name of project" addproperty="project.name"/>
<property name="project.dir" location="${projects.dir}/${project.name}"/>
<available property="project.exists" file="${project.dir}/nbproject"/>
<antcall target="-prompt" inheritall="true"/>
<echo>Generating project in ${project.dir}</echo>
<mkdir dir="${project.dir}"/>
<mkdir dir="${project.dir}/nbproject"/>
<mkdir dir="${project.dir}/conf"/>
<mkdir dir="${project.dir}/src"/>
<mkdir dir="${project.dir}/test"/>
<mkdir dir="${project.dir}/test/data"/>
<mkdir dir="${project.dir}/test/src"/>
<mkdir dir="${project.dir}/doc"/>
<template src="project-template.xml" dest="nbproject/project.xml"/>
<template src="nbproject-build-template.xml" dest="nbproject/build.xml"/>
<template src="product-template.properties" dest="conf/product.properties"/>
<template src="build-template.xml" dest="conf/build.xml"/>
<template src="test-build-template.xml" dest="test/build.xml"/>
<template src="dot-classpath-template.xml" dest=".classpath"/>
<template src="dot-project-template.xml" dest=".project"/>
</target>
<target name="-prompt" if="project.exists">
<input message="Overwrite existing files?" addproperty="project.overwrite"/>
<fail unless="project.overwrite" message="not overwriting project"/>
</target>
<macrodef name="template">
<attribute name="src"/>
<attribute name="dest"/>
<sequential>
<copy tofile="${project.dir}/@{dest}" file="setup/@{src}">
<filterset>
<filter token="product.name" value="${project.name}"/>
</filterset>
</copy>
</sequential>
</macrodef>
</project>