You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bd...@apache.org on 2018/01/26 14:47:07 UTC

[sling-site] branch master updated: Add generated list of all Git repositories, based on XML file downloaded from sling-aggregator

This is an automated email from the ASF dual-hosted git repository.

bdelacretaz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-site.git


The following commit(s) were added to refs/heads/master by this push:
     new 6c43175  Add generated list of all Git repositories, based on XML file downloaded from sling-aggregator
6c43175 is described below

commit 6c43175f735b8f774ea53fe68260d5e0c52d375a
Author: Bertrand Delacretaz <bd...@apache.org>
AuthorDate: Fri Jan 26 10:47:46 2018 +0100

    Add generated list of all Git repositories, based on XML file downloaded from sling-aggregator
---
 pom.xml                                            | 28 +++++++++-
 src/main/jbake/content/documentation/bundles.md    |  7 +++
 .../development/getting-and-building-sling.md      |  8 ++-
 src/main/jbake/content/repolist.md                 | 16 ++++++
 src/main/jbake/jbake.properties                    |  3 ++
 src/main/jbake/templates/repolist.tpl              | 62 ++++++++++++++++++++++
 6 files changed, 120 insertions(+), 4 deletions(-)

diff --git a/pom.xml b/pom.xml
index b98758a..0dfdcd5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -29,6 +29,12 @@
   <name>Apache Sling Website</name>
   <version>0.1-SNAPSHOT</version>
 
+  <properties>
+    <repos.list.url>https://raw.githubusercontent.com/apache/sling-aggregator/master/default.xml</repos.list.url>
+    <downloads.dir>${project.build.directory}/downloads</downloads.dir>
+    <repos.list.fullpath>${downloads.dir}/github-repositories.xml</repos.list.fullpath>
+  </properties>
+
   <build>
     <plugins>
       <plugin>
@@ -110,9 +116,27 @@
             <scmBranch>asf-site</scmBranch>
         </configuration>
       </plugin>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <executions>
+          <execution>
+            <id>download-repos-list</id>
+            <phase>process-resources</phase>
+            <configuration>
+              <tasks>
+                <mkdir dir="${downloads.dir}"/>
+                <get src="${repos.list.url}" dest="${repos.list.fullpath}" usetimestamp="true"/>
+              </tasks>
+            </configuration>
+            <goals>
+              <goal>run</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
     </plugins>
-  </build>
-
+    </build>
    <profiles>
         <profile>
             <id>publish-site</id>
diff --git a/src/main/jbake/content/documentation/bundles.md b/src/main/jbake/content/documentation/bundles.md
index ebb6ae7..3cddeaa 100644
--- a/src/main/jbake/content/documentation/bundles.md
+++ b/src/main/jbake/content/documentation/bundles.md
@@ -4,6 +4,13 @@ status=published
 tags=bundles,modules
 ~~~~~~
 
+## Bundles and Git repositories
+
+This is a manually maintained list of Sling bundles which have their documentation here.
+
+See also the [complete list of modules](/repolist.html) - some of them have their own "local" documentation
+in their README files instead of here.
+
 ## Content
 
 * [Content Loading (jcr.contentloader)](/documentation/bundles/content-loading-jcr-contentloader.html)
diff --git a/src/main/jbake/content/documentation/development/getting-and-building-sling.md b/src/main/jbake/content/documentation/development/getting-and-building-sling.md
index b23bbcf..e6ceac8 100644
--- a/src/main/jbake/content/documentation/development/getting-and-building-sling.md
+++ b/src/main/jbake/content/documentation/development/getting-and-building-sling.md
@@ -43,8 +43,12 @@ See [MavenTipsAndTricks](/documentation/development/maventipsandtricks.html).
 
 ## Getting the Sling Source
 
-We provide a way of checking out all of the source modules that are used in Sling. Since that's over 2^<super>8</super> repositories, it's based on
-additional tooling.
+The Sling source code is managed in Git using the Apache Gitbox tools: Git repositories are mirrored from GitHub to the canonical
+Apache Git repositories. In practice, one can work on GitHub and the replication to the Apache repositories is transparent.
+
+The [complete list of modules](/repolist.html) can be used to clone individual modules, but we provide a more convenient
+way of checking out all of the source modules that are used in Sling. Since that's over 2^<super>8</super> repositories,
+it's based on additional tooling:
 
 1. Install a git client if needed and the [Google Repo](https://android.googlesource.com/tools/repo) tool.
 
diff --git a/src/main/jbake/content/repolist.md b/src/main/jbake/content/repolist.md
new file mode 100644
index 0000000..468bd7c
--- /dev/null
+++ b/src/main/jbake/content/repolist.md
@@ -0,0 +1,16 @@
+title=Sling Git Repositories
+type=repolist
+status=published
+tags=sourcecode,development
+tableOfContents=false
+~~~~~~
+
+This is the list of all Sling source code repositories, generated by a script found in 
+the [sling-aggregator](https://github.com/apache/sling-aggregator) project.
+
+They should be classified in categories like 'core', 'contrib' etc. as we did
+in our svn repository. This is still a work in progress, if you're unsure about
+the status of one of these repositories please ask on our dev list.
+
+We also have specific documentation about some of these modules on the
+[Bundles](documentation/bundles.html) page.
\ No newline at end of file
diff --git a/src/main/jbake/jbake.properties b/src/main/jbake/jbake.properties
index a81e14d..2733d0e 100644
--- a/src/main/jbake/jbake.properties
+++ b/src/main/jbake/jbake.properties
@@ -14,6 +14,7 @@ template.post.file=post.tpl
 template.page.file=page.tpl
 template.feed.file=feed.tpl
 template.project.file=project.tpl
+template.repolist.file=repolist.tpl
 render.index=false
 render.feed=false
 index.paginate=false
@@ -23,3 +24,5 @@ sling.lastCommitBaseUrl=https://github.com/apache/sling-site/commit/
 # character encoding MIME name used in templates.
 # use one of http://www.iana.org/assignments/character-sets/character-sets.xhtml
 template.encoding=UTF-8
+repolist.path=./target/downloads/github-repositories.xml
+sling.github.baseURL=https://github.com/apache/
diff --git a/src/main/jbake/templates/repolist.tpl b/src/main/jbake/templates/repolist.tpl
new file mode 100644
index 0000000..22ef443
--- /dev/null
+++ b/src/main/jbake/templates/repolist.tpl
@@ -0,0 +1,62 @@
+// ------------------------------------------------------------------------------------------------
+// Sling 'repolist' page - list of GitHub repositories generated from an XML file
+// that our pom downloads.
+// ------------------------------------------------------------------------------------------------
+
+// Include common utilities
+U = new includes.U(config)
+
+layout 'layout/main.tpl', true,
+    projects: projects,
+    tags : contents {
+        //include template: 'tags-brick.tpl'
+    },
+    bodyContents: contents {
+        section(class:"wrap"){
+            yieldUnescaped U.processBody(content, config)
+        }
+        
+        def filename = "${config.repolist_path}"
+        def file = new File(filename)
+        def repos = new XmlSlurper().parse(file)
+        def NOGROUP = "<NO GROUP SET>"
+        Set groups = []
+
+        // Get the groups
+        repos.'**'.findAll { 
+            node -> 
+            node.name() == 'project' }*.each() {
+                p ->
+                def group = p.attributes().groups
+                if(group) {
+                    groups.add(group)
+                }
+            }
+
+        // Sort and add ungrouped projects to the end
+        groups=groups.toSorted()
+        groups.add(NOGROUP)
+
+        // List projects by group
+        groups.each() {
+            group ->
+            h2() { 
+                yield("Group: ${group}")
+            }
+            
+            ul() {
+                repos.'**'.findAll { 
+                    node -> 
+                    node.name() == 'project' && (node.attributes().groups == group || group == NOGROUP &&   !node.attributes().hasProperty('groups'))
+                }*.each() {
+                    p -> 
+                    li() {
+                        a(href:"${config.sling_github_baseURL}${p.attributes().name}") {
+                            yield("${p.attributes().path}")
+                        }
+                    }
+                }
+            }
+    
+        }
+    }

-- 
To stop receiving notification emails like this one, please contact
bdelacretaz@apache.org.