1 /*
2 * Derivative Work
3 * Copyright 2010 SOFTEC sa. All rights reserved.
4 *
5 * Original Work
6 * Copyright 2001-2005 The Apache Software Foundation.
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20
21 package org.codehaus.mojo.javascript;
22
23 import java.io.File;
24
25 /**
26 * Goal used to package stripped JavaScript files and package them as a javascript archive
27 * attaching this new artifact to the project for beeing installed / deployed with
28 * the regular uncompressed js-archive.
29 *
30 * @goal attach-stripped
31 * @phase package
32 */
33 public class AttachStrippedMojo
34 extends AbstractPackageMojo
35 {
36 /**
37 * The output directory of the compressed javascript files.
38 *
39 * @parameter default-value="${project.build.directory}/stripped"
40 */
41 private File strippedDirectory;
42
43 /**
44 * The output directory of the compressed javascript archive.
45 *
46 * @parameter default-value="${project.build.directory}"
47 */
48 private File buildDirectory;
49
50 /**
51 * classifier for the compressed artifact
52 *
53 * @parameter default-value="stripped"
54 */
55 private String classifier;
56
57 /**
58 * {@inheritDoc}
59 *
60 * @see org.codehaus.mojo.javascript.AbstractPackageMojo#getOutputDirectory()
61 */
62 protected File getOutputDirectory()
63 {
64 return buildDirectory;
65 }
66
67 String getClassifier()
68 {
69 return classifier;
70 }
71
72 /**
73 * {@inheritDoc}
74 *
75 * @see org.codehaus.mojo.javascript.AbstractPackageMojo#getScriptsDirectory()
76 */
77 protected File getScriptsDirectory()
78 {
79 return strippedDirectory;
80 }
81 }