svn commit: r1782605 - in /ofbiz/trunk: README.md build.gradle

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1782605 - in /ofbiz/trunk: README.md build.gradle

Taher Alkhateeb
Author: taher
Date: Sat Feb 11 13:36:40 2017
New Revision: 1782605

URL: http://svn.apache.org/viewvc?rev=1782605&view=rev
Log:
Implemented: new gradle task pullPluginSource using a subversion gradle plugin
(OFBIZ-9182)

Added a new gradle task called pullPluginSource that fetches a plugin from
the (yet to be created) plugins repository. Also updated the README.md file
to reflect the changes that happened recently on the plugin management tasks

This is the last commit required before restructuring the subversion repository
as per the discussion thread mentioned in the above JIRA

Modified:
    ofbiz/trunk/README.md
    ofbiz/trunk/build.gradle

Modified: ofbiz/trunk/README.md
URL: http://svn.apache.org/viewvc/ofbiz/trunk/README.md?rev=1782605&r1=1782604&r2=1782605&view=diff
==============================================================================
--- ofbiz/trunk/README.md (original)
+++ ofbiz/trunk/README.md Sat Feb 11 13:36:40 2017
@@ -514,6 +514,14 @@ If you need username and password to acc
 
 `gradlew pullPlugin -PrepoUrl="http://www.example.com/custom-maven" -PrepoUser=myuser -PrepoPassword=mypassword -PdependencyId="org.apache.ofbiz.plugin:myplugin:0.1.0"`
 
+### Pull a source plugin
+
+Download a plugin from source control (currently subversion) and place it in
+the plugins directory. This is mostly useful when working on the trunk branch
+as it requires the latest version of a plugin
+
+`gradlew pullPluginSource -PpluginId=ecommerce`
+
 ### Install a plugin
 
 If you have a plugin called mycustomplugin and want to install it in OFBiz follow the
@@ -525,10 +533,8 @@ below instructions:
 
 `gradlew installPlugin -PpluginId=myplugin`
 
-The above commands achieve the following:
-
-- add the plugin to /plugins/component-load.xml
-- executes the task "install" in the plugin's build.gradle file if it exists
+The above commands executes the task "install" in the plugin's build.gradle
+file if it exists
 
 ### Uninstall a plugin
 
@@ -537,10 +543,8 @@ run the below command
 
 `gradlew uninstallPlugin -PpluginId=myplugin`
 
-The above commands achieve the following:
-
-- executes the task "uninstall" in the plugin's build.gradle file if it exists
-- removes the plugin from /plugins/component-load.xml
+The above command executes the task "uninstall" in the plugin's build.gradle
+file if it exists
 
 ### Remove a plugin
 
@@ -561,10 +565,7 @@ Create a new plugin. The following proje
 
 `gradlew createPlugin -PpluginId=myplugin -PpluginResourceName=MyPlugin -PwebappName=mypluginweb -PbasePermission=MYSECURITY`
 
-The above commands achieve the following:
-
-- create a new plugin in /plugins/myplugin
-- add the plugin to /plugins/component-load.xml
+The above command creates a new plugin in /plugins/myplugin
 
 ### Push a plugin to a repository
 

Modified: ofbiz/trunk/build.gradle
URL: http://svn.apache.org/viewvc/ofbiz/trunk/build.gradle?rev=1782605&r1=1782604&r2=1782605&view=diff
==============================================================================
--- ofbiz/trunk/build.gradle (original)
+++ ofbiz/trunk/build.gradle Sat Feb 11 13:36:40 2017
@@ -16,15 +16,24 @@
  * specific language governing permissions and limitations
  * under the License.
  */
+import at.bxm.gradleplugins.svntools.tasks.SvnCheckout
 import org.apache.tools.ant.filters.ReplaceTokens
 
 /* ========================================================
  * Project setup
  * ======================================================== */
-
+buildscript {
+    repositories {
+        jcenter()
+    }
+    dependencies {
+      classpath "at.bxm.gradleplugins:gradle-svntools-plugin:latest.release"
+    }
+}
 apply plugin: 'java'
 apply plugin: 'eclipse'
 apply plugin: 'maven-publish'
+apply plugin: "at.bxm.svntools"
 
 apply from: 'common.gradle'
 
@@ -722,6 +731,20 @@ task pullPlugin(group: ofbizPlugin, desc
     }
 }
 
+task pullPluginSource(group: ofbizPlugin, description: 'Download and install a plugin from source control') {
+
+    if (project.hasProperty('pluginId')) {
+        task pullPluginFromSvn(type: SvnCheckout) {
+            svnUrl = "https://svn.apache.org/repos/asf/ofbiz/ofbiz-plugins/${pluginId}"
+            workspaceDir = "${rootDir}/plugins/${pluginId}"
+        }
+        dependsOn pullPluginFromSvn
+    }
+    doLast {
+        installPlugin pluginId
+    }
+}
+
 // ========== Clean up tasks ==========
 task cleanCatalina(group: cleanupGroup, description: 'Clean Catalina data in runtime/catalina/work') {
     doLast { delete "${rootDir}/runtime/catalina/work" }