Skip to content

Commit cf6f8c5

Browse files
committed
Добавлен ant task для компоновки библиотек в единый jar
1 parent 45ef0f8 commit cf6f8c5

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
/dist/
1+
/dist/
2+
/store/
3+
/nbproject/private/

build.xml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,34 @@
1010
<project name="OwnLang" default="default" basedir=".">
1111
<description>Builds, tests, and runs the project OwnLang.</description>
1212
<import file="nbproject/build-impl.xml"/>
13+
14+
<target name="package-for-store" depends="jar">
15+
<property name="store.jar.name" value="${application.title}"/>
16+
17+
<property name="store.dir" value="store"/>
18+
<property name="store.jar" value="${store.dir}/${store.jar.name}.jar"/>
19+
20+
<echo message="Packaging ${application.title} into a single JAR at ${store.jar}"/>
21+
22+
<delete dir="${store.dir}"/>
23+
<mkdir dir="${store.dir}"/>
24+
25+
<jar destfile="${store.dir}/temp_final.jar" filesetmanifest="skip">
26+
<zipgroupfileset dir="dist" includes="*.jar"/>
27+
<zipgroupfileset dir="dist/lib" includes="*.jar"/>
28+
29+
<manifest>
30+
<attribute name="Main-Class" value="${main.class}"/>
31+
</manifest>
32+
</jar>
33+
34+
<zip destfile="${store.jar}">
35+
<zipfileset src="${store.dir}/temp_final.jar"
36+
excludes="META-INF/*.SF, META-INF/*.DSA, META-INF/*.RSA"/>
37+
</zip>
38+
39+
<delete file="${store.dir}/temp_final.jar"/>
40+
</target>
1341
<!--
1442
1543
There exist several targets which are by default empty and which can be

0 commit comments

Comments
 (0)