Commits

Kevin Poalses  committed f257284

RENO: Modified to be multi-module build

  • Participants
  • Parent commits 2b9925b
  • Branches editing

Comments (0)

Files changed (1)

File build.gradle

 
 allprojects {
 
+    apply plugin: 'java'
+    sourceCompatibility = 1.7
+    targetCompatibility = 1.7
+
     apply plugin: 'maven'
 
     group = 'net.poalsoft.dossier'
                 }
             }
         }
-
     }
 
 }
 
 subprojects {
 
-    apply plugin: 'java'
-    sourceCompatibility = 1.7
-    targetCompatibility = 1.7
-
     dependencies {
 
         // Testing
         }
     }
 
-    // Play nice with Maven-only users
-    install {
-        repositories.mavenInstaller {
-            customizePom(pom, project)
-        }
-    }
-
 }
 
 project(':') {
 
     archivesBaseName = 'dossier'
     description = """\
-    The aim with Dossier is to create an elegant, standards-compliant contact and note manager.
+    Dossier is an elegant, standards-compliant contact and note manager.
     """
-    ext.generatedPomFileName = 'pom.xml'
 
-    task generatePom {
-        apply plugin: 'maven'
-        group = 'Build'
-        description = 'Generates a root Maven pom for convenience.'
-
-        outputs.files(generatedPomFileName)
-
-        doLast() {
-            // customize the pom creation process
-            def pomFile = pom {
-                project {
-                    name = project.description
-                    packaging = 'pom'
-                    modules = subprojects.collect { project -> project.archivesBaseName }
-                }
-            }
-
-            pomFile.whenConfigured { pom -> pom.artifactId = project.archivesBaseName }
-            pomFile.writeTo(generatedPomFileName)
+    install {
+        repositories.mavenInstaller {
+            customizeRootPom(pom, project)
         }
     }
 
-    artifacts {
-        archives file: file(generatedPomFileName), builtBy: generatePom
-    }
-
-
 }
 
 project(':base') {
                        )
         }
     }
-
 }
 
 
     }
 }
 
-
+/**
+ * Customize the POM generated for sub-projects.
+ *
+ * @param pom POM to customize
+ * @param gradleProject Sub-project
+ */
 def customizePom(pom, gradleProject) {
     pom.whenConfigured { generatedPom ->
 
 
         // add all items necessary for maven central publication
         generatedPom.project {
-            name = gradleProject.description
+            name = gradleProject.name
             description = gradleProject.description
             organization {
                 name = 'poalsoft.net'
     }
 }
 
+/**
+ * Customize the POM generated for the root project.
+ *
+ * @param pom POM to customize
+ * @param gradleProject Root project
+ */
+def customizeRootPom(pom, gradleProject) {
+    pom.whenConfigured { generatedPom ->
+
+        generatedPom.project {
+            name = gradleProject.name
+            description = gradleProject.description
+            packaging = 'pom'
+            modules = subprojects.collect { project -> project.archivesBaseName }
+            organization {
+                name = 'poalsoft.net'
+            }
+
+            developers {
+                developer {
+                    name = 'Kevin Poalses'
+                    email = 'kevinp@poalsoft.net'
+                }
+            }
+        }
+    }
+}