aries-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From alien11...@apache.org
Subject svn commit: r1804225 - in /aries/trunk/blueprint/plugin: blueprint-maven-plugin-itest/src/it/custom-destination/ blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/ blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plu...
Date Sun, 06 Aug 2017 06:34:04 GMT
Author: alien11689
Date: Sun Aug  6 06:34:03 2017
New Revision: 1804225

URL: http://svn.apache.org/viewvc?rev=1804225&view=rev
Log:
[ARIES-1734] Allow for changing base directory for generated blueprint file

Modified:
    aries/trunk/blueprint/plugin/blueprint-maven-plugin-itest/src/it/custom-destination/pom.xml
    aries/trunk/blueprint/plugin/blueprint-maven-plugin-itest/src/it/custom-destination/verify.groovy
    aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/AddResourceDirMojo.java
    aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/GenerateMojo.java
    aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/ResourceInitializer.java
    aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Bean.java

Modified: aries/trunk/blueprint/plugin/blueprint-maven-plugin-itest/src/it/custom-destination/pom.xml
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin-itest/src/it/custom-destination/pom.xml?rev=1804225&r1=1804224&r2=1804225&view=diff
==============================================================================
--- aries/trunk/blueprint/plugin/blueprint-maven-plugin-itest/src/it/custom-destination/pom.xml
(original)
+++ aries/trunk/blueprint/plugin/blueprint-maven-plugin-itest/src/it/custom-destination/pom.xml
Sun Aug  6 06:34:03 2017
@@ -41,6 +41,7 @@
                 <artifactId>blueprint-maven-plugin</artifactId>
                 <version>@blueprint-maven-plugin.version@</version>
                 <configuration>
+                    <baseDir>${project.build.directory}/classes</baseDir>
                     <generatedFileName>blueprint.xml</generatedFileName>
                     <generatedDir>custom/my</generatedDir>
                 </configuration>

Modified: aries/trunk/blueprint/plugin/blueprint-maven-plugin-itest/src/it/custom-destination/verify.groovy
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin-itest/src/it/custom-destination/verify.groovy?rev=1804225&r1=1804224&r2=1804225&view=diff
==============================================================================
--- aries/trunk/blueprint/plugin/blueprint-maven-plugin-itest/src/it/custom-destination/verify.groovy
(original)
+++ aries/trunk/blueprint/plugin/blueprint-maven-plugin-itest/src/it/custom-destination/verify.groovy
Sun Aug  6 06:34:03 2017
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-def file = new File(basedir, 'target/generated-sources/blueprint/custom/my/blueprint.xml')
+def file = new File(basedir, 'target/classes/custom/my/blueprint.xml')
 assert file.exists()
 def xml = new groovy.util.XmlSlurper().parse(file)
 assert xml.name() == 'blueprint'

Modified: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/AddResourceDirMojo.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/AddResourceDirMojo.java?rev=1804225&r1=1804224&r2=1804225&view=diff
==============================================================================
--- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/AddResourceDirMojo.java
(original)
+++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/AddResourceDirMojo.java
Sun Aug  6 06:34:03 2017
@@ -39,8 +39,14 @@ public class AddResourceDirMojo extends
     @Parameter(defaultValue = "${project}", required = true)
     protected MavenProject project;
 
+    /**
+     * Base directory to write generated hierarchy.
+     */
+    @Parameter(defaultValue = "${project.build.directory}/generated-sources/blueprint/")
+    private String baseDir;
+
     @Override
     public void execute() throws MojoExecutionException, MojoFailureException {
-        ResourceInitializer.generateResourceEntry(project);
+        ResourceInitializer.prepareBaseDir(project, baseDir);
     }
 }

Modified: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/GenerateMojo.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/GenerateMojo.java?rev=1804225&r1=1804224&r2=1804225&view=diff
==============================================================================
--- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/GenerateMojo.java
(original)
+++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/GenerateMojo.java
Sun Aug  6 06:34:03 2017
@@ -73,8 +73,14 @@ public class GenerateMojo extends Abstra
     protected String generatedFileName;
 
     /**
+     * Base directory to write generated hierarchy.
+     */
+    @Parameter(defaultValue = "${project.build.directory}/generated-sources/blueprint/")
+    private String baseDir;
+
+    /**
      * Base directory to write into
-     * (relative to ${project.build.directory}/generated-sources/blueprint).
+     * (relative to baseDir property).
      */
     @Parameter(defaultValue = "OSGI-INF/blueprint/")
     private String generatedDir;
@@ -128,9 +134,9 @@ public class GenerateMojo extends Abstra
     }
 
     private void writeBlueprint(Blueprint blueprint) throws Exception {
-        String generatedBaseDir = ResourceInitializer.generateResourceEntry(project);
+        ResourceInitializer.prepareBaseDir(project, baseDir);
 
-        File dir = new File(generatedBaseDir, generatedDir);
+        File dir = new File(baseDir, generatedDir);
         File file = new File(dir, generatedFileName);
         file.getParentFile().mkdirs();
         getLog().info("Generating blueprint to " + file);

Modified: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/ResourceInitializer.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/ResourceInitializer.java?rev=1804225&r1=1804224&r2=1804225&view=diff
==============================================================================
--- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/ResourceInitializer.java
(original)
+++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/ResourceInitializer.java
Sun Aug  6 06:34:03 2017
@@ -22,12 +22,9 @@ import org.apache.maven.model.Resource;
 import org.apache.maven.project.MavenProject;
 
 class ResourceInitializer {
-    static String generateResourceEntry(MavenProject project){
-        String buildDir = project.getBuild().getDirectory();
-        String generatedBaseDir = buildDir + "/generated-sources/blueprint";
+    static void prepareBaseDir(MavenProject project, String baseDir){
         Resource resource = new Resource();
-        resource.setDirectory(generatedBaseDir);
+        resource.setDirectory(baseDir);
         project.addResource(resource);
-        return generatedBaseDir;
     }
 }

Modified: aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Bean.java
URL: http://svn.apache.org/viewvc/aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Bean.java?rev=1804225&r1=1804224&r2=1804225&view=diff
==============================================================================
--- aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Bean.java
(original)
+++ aries/trunk/blueprint/plugin/blueprint-maven-plugin/src/main/java/org/apache/aries/blueprint/plugin/model/Bean.java
Sun Aug  6 06:34:03 2017
@@ -45,7 +45,7 @@ import java.util.TreeSet;
 import static org.apache.aries.blueprint.plugin.model.AnnotationHelper.findSingleton;
 import static org.apache.aries.blueprint.plugin.model.NamingHelper.getBeanName;
 
-class Bean implements BeanEnricher, XmlWriter, Comparable<Bean>{
+class Bean implements BeanEnricher, XmlWriter, Comparable<Bean> {
 
     private static final String NS_EXT = "http://aries.apache.org/blueprint/xmlns/blueprint-ext/v1.0.0";
 



Mime
View raw message