Lines 1-9
Link Here
|
1 |
# Eclass for building dev-java/ant-* packages |
1 |
# Copyright 2007-2008 Gentoo Foundation |
2 |
# |
|
|
3 |
# Copyright 2007 Gentoo Foundation |
4 |
# Distributed under the terms of the GNU General Public License, v2 or later |
2 |
# Distributed under the terms of the GNU General Public License, v2 or later |
5 |
# Author Vlastimil Babka <caster@gentoo.org> |
3 |
# $Header: $ |
6 |
# $Header: /var/cvsroot/gentoo-x86/eclass/ant-tasks.eclass,v 1.4 2007/02/02 22:59:53 caster Exp $ |
4 |
|
|
|
5 |
# @ECLASS: ant-tasks.eclass |
6 |
# @MAINTAINER: |
7 |
# java@gentoo.org |
8 |
# |
9 |
# Original author Vlastimil Babka <caster@gentoo.org> |
10 |
# @BLURB: Eclass for building dev-java/ant-* packages |
11 |
# @DESCRIPTION: |
12 |
# This eclass provides functionality and default ebuild variables for building |
13 |
# dev-java/ant-* packages easily. |
14 |
# |
15 |
# It inherits versionator, java-pkg-2, and java-ant-2 |
16 |
|
7 |
|
17 |
|
8 |
# we set ant-core dep ourselves, restricted |
18 |
# we set ant-core dep ourselves, restricted |
9 |
JAVA_ANT_DISABLE_ANT_CORE_DEP=true |
19 |
JAVA_ANT_DISABLE_ANT_CORE_DEP=true |
Lines 13-70
Link Here
|
13 |
|
23 |
|
14 |
EXPORT_FUNCTIONS src_unpack src_compile src_install |
24 |
EXPORT_FUNCTIONS src_unpack src_compile src_install |
15 |
|
25 |
|
16 |
# ----------------------------------------------------------------------------- |
26 |
# @ECLASS-VARIABLE: ANT_TASK_JDKVER |
17 |
# @eclass-begin |
27 |
# @DESCRIPTION: |
18 |
# @eclass-shortdesc Eclass for building dev-java/ant-* packages |
|
|
19 |
# @eclass-maintainer java@gentoo.org |
20 |
# |
21 |
# This eclass provides functionality and default ebuild variables for building |
22 |
# dev-java/ant-* packages easily. |
23 |
# |
24 |
# ----------------------------------------------------------------------------- |
25 |
|
26 |
# ----------------------------------------------------------------------------- |
27 |
# @variable-preinherit ANT_TASK_JDKVER |
28 |
# @variable-default 1.4 |
29 |
# |
30 |
# Affects the >=virtual/jdk version set in DEPEND string. Defaults to 1.4, can |
28 |
# Affects the >=virtual/jdk version set in DEPEND string. Defaults to 1.4, can |
31 |
# be overriden from ebuild BEFORE inheriting this eclass. |
29 |
# be overriden from ebuild BEFORE inheriting this eclass. |
32 |
# ----------------------------------------------------------------------------- |
|
|
33 |
ANT_TASK_JDKVER=${ANT_TASK_JDKVER-1.4} |
30 |
ANT_TASK_JDKVER=${ANT_TASK_JDKVER-1.4} |
34 |
|
31 |
|
35 |
# ----------------------------------------------------------------------------- |
|
|
36 |
# @variable-preinherit ANT_TASK_JREVER |
32 |
# @variable-preinherit ANT_TASK_JREVER |
37 |
# @variable-default 1.4 |
33 |
# @DESCRIPTION: |
38 |
# |
|
|
39 |
# Affects the >=virtual/jre version set in DEPEND string. Defaults to 1.4, can |
34 |
# Affects the >=virtual/jre version set in DEPEND string. Defaults to 1.4, can |
40 |
# be overriden from ebuild BEFORE inheriting this eclass. |
35 |
# be overriden from ebuild BEFORE inheriting this eclass. |
41 |
# ----------------------------------------------------------------------------- |
|
|
42 |
ANT_TASK_JREVER=${ANT_TASK_JREVER-1.4} |
36 |
ANT_TASK_JREVER=${ANT_TASK_JREVER-1.4} |
43 |
|
37 |
|
44 |
# ----------------------------------------------------------------------------- |
38 |
# @ECLASS-VARIABLE: ANT_TASK_NAME |
45 |
# @variable-internal ANT_TASK_NAME |
39 |
# @DESCRIPTION: |
46 |
# @variable-default the rest of $PN after "ant-" |
|
|
47 |
# |
48 |
# The name of this ant task as recognized by ant's build.xml, derived from $PN. |
40 |
# The name of this ant task as recognized by ant's build.xml, derived from $PN. |
49 |
# ----------------------------------------------------------------------------- |
41 |
# Default the rest of $PN after "ant-" |
50 |
ANT_TASK_NAME="${PN#ant-}" |
42 |
ANT_TASK_NAME="${PN#ant-}" |
51 |
|
43 |
|
52 |
# ----------------------------------------------------------------------------- |
44 |
# @ECLASS-VARIABLE: ANT_TASK_DEPNAME |
53 |
# @variable-preinherit ANT_TASK_DEPNAME |
45 |
# @DESCRIPTION: |
54 |
# @variable-default $ANT_TASK_NAME |
|
|
55 |
# |
56 |
# Specifies JAVA_PKG_NAME (PN{-SLOT} used with java-pkg_jar-from) of the package |
46 |
# Specifies JAVA_PKG_NAME (PN{-SLOT} used with java-pkg_jar-from) of the package |
57 |
# that this one depends on. Defaults to the name of ant task, ebuild can |
47 |
# that this one depends on. Defaults to the name of ant task, ebuild can |
58 |
# override it before inheriting this eclass. |
48 |
# override it before inheriting this eclass. |
59 |
# ----------------------------------------------------------------------------- |
|
|
60 |
ANT_TASK_DEPNAME=${ANT_TASK_DEPNAME-${ANT_TASK_NAME}} |
49 |
ANT_TASK_DEPNAME=${ANT_TASK_DEPNAME-${ANT_TASK_NAME}} |
61 |
|
50 |
|
62 |
# ----------------------------------------------------------------------------- |
51 |
# @ECLASS-VARIABLE: ANT_TASK_PV |
63 |
# @variable-internal ANT_TASK_PV |
52 |
# @DESCRIPTION: |
64 |
# @variable-default Just the number in $PV without any beta/RC suffixes |
|
|
65 |
# |
66 |
# Version of ant-core this task is intended to register and thus load with. |
53 |
# Version of ant-core this task is intended to register and thus load with. |
67 |
# ----------------------------------------------------------------------------- |
54 |
# Default Just the number in $PV without any beta/RC suffixes |
68 |
ANT_TASK_PV="${PV}" |
55 |
ANT_TASK_PV="${PV}" |
69 |
|
56 |
|
70 |
# special care for beta/RC releases |
57 |
# special care for beta/RC releases |
Lines 103-116
Link Here
|
103 |
|
90 |
|
104 |
S="${WORKDIR}/${MY_P}" |
91 |
S="${WORKDIR}/${MY_P}" |
105 |
|
92 |
|
106 |
# ------------------------------------------------------------------------------ |
93 |
# @FUNCTION: eclass-src_unpack |
107 |
# @eclass-src_unpack |
94 |
# @USAGE: [ base ] [ jar-dep ] [ all ] |
108 |
# |
95 |
# @DESCRIPTION: |
109 |
# Is split into two parts, defaults to both of them ('all'). |
96 |
# Is split into two parts, defaults to both of them ('all'). |
|
|
97 |
# |
110 |
# base: performs the unpack, build.xml replacement and symlinks ant.jar from |
98 |
# base: performs the unpack, build.xml replacement and symlinks ant.jar from |
111 |
# ant-core |
99 |
# ant-core |
|
|
100 |
# |
112 |
# jar-dep: symlinks the jar file(s) from dependency package |
101 |
# jar-dep: symlinks the jar file(s) from dependency package |
113 |
# ------------------------------------------------------------------------------ |
|
|
114 |
ant-tasks_src_unpack() { |
102 |
ant-tasks_src_unpack() { |
115 |
[[ -z "${1}" ]] && ant-tasks_src_unpack all |
103 |
[[ -z "${1}" ]] && ant-tasks_src_unpack all |
116 |
|
104 |
|
Lines 140-161
Link Here
|
140 |
|
128 |
|
141 |
} |
129 |
} |
142 |
|
130 |
|
143 |
# ------------------------------------------------------------------------------ |
131 |
# @FUNCTION: eclass-src_compile |
144 |
# @eclass-src_compile |
132 |
# @DESCRIPTION: |
145 |
# |
|
|
146 |
# Compiles the jar with installed ant-core. |
133 |
# Compiles the jar with installed ant-core. |
147 |
# ------------------------------------------------------------------------------ |
|
|
148 |
ant-tasks_src_compile() { |
134 |
ant-tasks_src_compile() { |
149 |
ANT_TASKS="none" eant -Dbuild.dep=${ANT_TASK_NAME} jar-dep |
135 |
ANT_TASKS="none" eant -Dbuild.dep=${ANT_TASK_NAME} jar-dep |
150 |
} |
136 |
} |
151 |
|
137 |
|
152 |
# ------------------------------------------------------------------------------ |
138 |
# @FUNCTION: eclass-src_install |
153 |
# @eclass-src_install |
139 |
# @DESCRIPTION: |
154 |
# |
|
|
155 |
# Installs the jar and registers its presence for the ant launcher script. |
140 |
# Installs the jar and registers its presence for the ant launcher script. |
156 |
# Version param ensures it won't get loaded (thus break) when ant-core is |
141 |
# Version param ensures it won't get loaded (thus break) when ant-core is |
157 |
# updated to newer version. |
142 |
# updated to newer version. |
158 |
# ------------------------------------------------------------------------------ |
|
|
159 |
ant-tasks_src_install() { |
143 |
ant-tasks_src_install() { |
160 |
java-pkg_dojar build/lib/${PN}.jar |
144 |
java-pkg_dojar build/lib/${PN}.jar |
161 |
java-pkg_register-ant-task --version "${ANT_TASK_PV}" |
145 |
java-pkg_register-ant-task --version "${ANT_TASK_PV}" |