File: common.xml

package info (click to toggle)
guice 4.0-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,620 kB
  • ctags: 9,493
  • sloc: xml: 60,913; java: 54,700; sh: 119; jsp: 12; makefile: 10
file content (156 lines) | stat: -rw-r--r-- 6,302 bytes parent folder | download | duplicates (3)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<?xml version="1.0"?>

<project name="common">

  <property file="build.properties"/>

  <!-- can be overridden at the command line with -Dversion=
       or in IDEA, in the ant properties dialog -->
  <property name="version" value="snapshot"/>
  <property name="api.version" value="1.4"/>

  <target name="compile" description="Compile Java source.">
    <mkdir dir="${build.dir}/classes"/>
    <javac srcdir="${src.dir}"
         debug="on"
         destdir="${build.dir}/classes"
         source="1.6" target="1.6" includeantruntime="false">
      <compilerarg value="-Xlint:all,-serial"/>
      <classpath refid="compile.classpath"/>
    </javac>
    <copy toDir="${build.dir}/classes">
      <fileset dir="${src.dir}" excludes="**/*.java"/>
    </copy>
  </target>

  <target name="manifest" description="Generate OSGi manifest." depends="compile">
    <dirname property="common.basedir" file="${ant.file.common}"/>
    <taskdef resource="aQute/bnd/ant/taskdef.properties"
      classpath="${common.basedir}/lib/build/bnd-0.0.384.jar"/>

    <fail unless="module" message="Missing 'module' property (use the primary package name in this jar)"/>
    <property name="imports" value=""/>

    <property name="Bundle-Name" value="${ant.project.name}"/>
    <property name="Bundle-SymbolicName" value="${module}"/>
    <property name="Bundle-Version" value="${replace;${version};^[^0-9];0.0.0.$0}"/>

    <property name="Bundle-Description" value="Guice is a lightweight dependency injection framework for Java 6 and above"/>
    <property name="Bundle-DocURL" value="https://github.com/google/guice"/>
    <property name="Bundle-Copyright" value="Copyright (C) 2006 Google Inc."/>
    <property name="Bundle-License" value="http://www.apache.org/licenses/LICENSE-2.0.txt"/>
    <property name="Bundle-RequiredExecutionEnvironment" value="JavaSE-1.6"/>
    <property name="Bundle-Vendor" value="Google, Inc."/>

    <property name="Export-Package" value="!${module}.internal.*,${module}.*;version=${api.version}"/>

    <condition property="Eclipse-ExtensibleAPI" value="true">
      <equals arg1="${module}" arg2="com.google.inject"/>
    </condition>

    <condition property="Import-Package" value="!com.google.inject.*,*" else="!${module}.*,${imports},*">
      <istrue value="${fragment}"/>
    </condition>

    <condition property="Fragment-Host" value="com.google.inject">
      <istrue value="${fragment}"/>
    </condition>

    <property name="-nouses" value="true"/>

    <property name="-removeheaders" value="Bnd-LastModified,Ignore-Package,Include-Resource,Private-Package,Tool"/>

    <bndwrap jars="${build.dir}/classes" output="${build.dir}"/>

    <unjar src="${build.dir}/classes.bar" dest="${build.dir}">
      <patternset>
        <include name="META-INF/MANIFEST.MF"/>
      </patternset>
    </unjar>
  </target>

  <target name="test.compile"
      depends="compile"
      description="Compile test source.">
    <mkdir dir="${build.dir}/test"/>
    <javac srcdir="${test.dir}"
         debug="on"
         destdir="${build.dir}/test"
         source="1.6" target="1.6" includeantruntime="false">
      <classpath path="${build.dir}/classes"/>
      <classpath path="${build.dir}/test"/>
      <classpath refid="compile.classpath"/>
    </javac>
    <copy toDir="${build.dir}/test">
      <fileset dir="${test.dir}" excludes="**/*.java"/>
    </copy>
  </target>

  <target name="test"
      depends="test.compile"
      description="Execute JUnit tests.">
    <java fork="true"
        classname="junit.textui.TestRunner"
        failonerror="true"
        taskname="junit">
      <classpath>
        <pathelement location="${build.dir}/test"/>
        <pathelement location="${build.dir}/classes"/>
        <path refid="compile.classpath"/>
      </classpath>
      <arg value="${test.class}"/>
    </java>
  </target>

  <target name="clean"
      description="Remove generated files.">
    <delete dir="${build.dir}"/>
  </target>

  <target name="source.jar"
      description="Create a .jar file with sources">
    <mkdir dir="${build.dir}"/>
    <zip destfile="${build.dir}/${ant.project.name}-${version}-src.jar">
      <fileset dir="${src.dir}"/>
    </zip>
  </target>

  <target name="distjars"
      depends="source.jar, jar"
      description="Build jar files"/>

  <target name="test.withdeps" depends="test.compile"
      description="Build a jar of tests with internal.util refocused.">
    <mkdir dir="${build.dir}/dist"/>
    <dirname property="common.basedir" file="${ant.file.common}"/>
    <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"
        classpath="${common.basedir}/lib/build/jarjar-1.1.jar"/>
    <jarjar jarfile="${build.dir}/${ant.project.name}-${version}-tests.jar">
      <fileset dir="${build.dir}/test"/>
      <rule pattern="net.sf.cglib.*" result="com.google.inject.internal.cglib.$@1"/>
      <rule pattern="net.sf.cglib.**.*" result="com.google.inject.internal.cglib.@1.$@2"/>
      <rule pattern="org.objectweb.asm.*" result="com.google.inject.internal.asm.$@1"/>
      <rule pattern="org.objectweb.asm.**.*" result="com.google.inject.internal.asm.@1.$@2"/>
      <keep pattern="com.google.inject.**"/>
      <keep pattern="com.googlecode.**"/>
    </jarjar>
  </target>

  <target name="jar.withdeps" depends="compile"
      description="Build jar with dependencies embedded.">
    <mkdir dir="${build.dir}/dist"/>
    <dirname property="common.basedir" file="${ant.file.common}"/>
    <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"
        classpath="${common.basedir}/lib/build/jarjar-1.1.jar"/>
    <jarjar jarfile="${build.dir}/${ant.project.name}-with-deps.jar">
      <fileset dir="${build.dir}/classes"/>
      <zipfileset src="${common.basedir}/lib/build/cglib-3.1.jar"/>
      <zipfileset src="${common.basedir}/lib/build/asm-5.0.3.jar"/>
      <rule pattern="net.sf.cglib.*" result="com.google.inject.internal.cglib.$@1"/>
      <rule pattern="net.sf.cglib.**.*" result="com.google.inject.internal.cglib.@1.$@2"/>
      <rule pattern="org.objectweb.asm.*" result="com.google.inject.internal.asm.$@1"/>
      <rule pattern="org.objectweb.asm.**.*" result="com.google.inject.internal.asm.@1.$@2"/>
      <keep pattern="com.google.inject.**"/>
    </jarjar>
  </target>
</project>