Bump version to 0.36.9
[cygport.git] / cygclass / nant.cygclass
blob2aad539206486ca7f3798b6aa4cedd79f525fcd7
1 ################################################################################
3 # nant.cygclass - functions for building .NET packages with NAnt
5 # Part of cygport - Cygwin packaging application
6 # Copyright (C) 2006-2020 Cygport authors
7 # Provided by the Cygwin project <https://cygwin.com/>
9 # cygport is free software: you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation, either version 3 of the License, or
12 # (at your option) any later version.
14 # cygport is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with cygport.  If not, see <https://www.gnu.org/licenses/>.
22 ################################################################################
24 #****ih* Cygclasses/nant.cygclass
25 #  SYNOPSIS
26 #  inherit nant
27 #  DESCRIPTION
28 #  NAnt is a build system written in .NET and used in some .NET projects.
29 #  The build is controlled by a single XML file, named '*.build' by default,
30 #  which specifies the targets to be built, the commands to build them, and the
31 #  options which may be given to control the build.
33 #  NAnt includes support for a number of commands (called tasks), including
34 #  compiling and executing .NET code, generating documentation, downloading
35 #  files, de/compressing archives, and running testsuites.  Third-party NAnt
36 #  tasks also exist to support additional commands.
38 #  This cygclass builds packages which use the NAnt build system.
39 #  INHERITS
40 #  mono.cygclass
41 #  REQUIRES
42 #  nant
43 #****
45 inherit mono
47 check_prog_req nant
49 #****id* nant.cygclass/NANT
50 #  DESCRIPTION
51 #  Absolute path to the NAnt build tool.
52 #****
53 NANT=/usr/bin/nant
55 #****iv* nant.cygclass/NANT_BUILD_FILE
56 #  DESCRIPTION
57 #  Name or relative path of the NAnt build file.  This need only be defined
58 #  if it is not '*.build' (the default).
59 #****
61 #****iC* nant.cygclass/cygnant
62 #  SYNOPSIS
63 #  cygnant [OPTIONS]
64 #  DESCRIPTION
65 #  Runs NAnt with the given options, if any.
66 #****
67 cygnant() {
68         local fileargs
70         if ! find . -maxdepth 1 -name "${NANT_BUILD_FILE:*.build}"
71         then
72                 error "NAnt *.build file not found"
73         fi
75         if defined NANT_BUILD_FILE
76         then
77                 fileargs="-buildfile:${NANT_BUILD_FILE}"
78         fi
80         /usr/bin/nant ${fileargs} ${@} || error "nant build failed"
83 #****iI* nant.cygclass/donanttask
84 #  SYNOPSIS
85 #  donanttask ASSEMBLY [ASSEMBLY] ...
86 #  DESCRIPTION
87 #  Installs the given assembly file(s) into the NAnt task directory.
88 #****
89 donanttask() {
90         local _insinto_tmp=${_insinto_dir}
92         insinto /usr/share/NAnt/bin/tasks
93         doins ${@}
95         _insinto_dir=${_insinto_tmp}
98 #****iv* nant.cygclass/NANT_BUILD_ARGS
99 #  DESCRIPTION
100 #  Arguments to pass to the NAnt build command if this src_compile is used.
101 #****
102 #****iv* nant.cygclass/NANT_BUILD_TARGETS
103 #  DESCRIPTION
104 #  Target(s) to be built during the NAnt build command if this src_compile is used.
105 #****
107 #****io* nant.cygclass/src_compile (nant)
108 #  DEFINITION
109 src_compile() {
110         lndirs
111         cd ${B}
112         cygnant ${NANT_BUILD_ARGS} ${NANT_BUILD_TARGETS}
114 #****
116 #****iv* nant.cygclass/NANT_TEST_ARGS
117 #  DESCRIPTION
118 #  Arguments to pass to NAnt during testing if this src_test is used.
119 #****
120 #****iv* nant.cygclass/NANT_TEST_TARGETS
121 #  DESCRIPTION
122 #  Target(s) to be built to run the testsuite if this src_test is used.
123 #****
125 #****io* nant.cygclass/src_test (nant)
126 #  DEFINITION
127 src_test() {
128         cd ${B}
129         cygnant ${NANT_TEST_ARGS} ${NANT_TEST_TARGETS:-test}
131 #****
133 readonly -f cygnant donanttask