Skip to content
This repository has been archived by the owner on May 9, 2020. It is now read-only.

Commit

Permalink
Implemented: new gradle task pullPluginSource using a subversion grad…
Browse files Browse the repository at this point in the history
…le 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


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1782605 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
pythys committed Feb 11, 2017
1 parent 08b3240 commit ed08f74
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 13 deletions.
25 changes: 13 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,14 @@ If you need username and password to access the custom repository:

`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
Expand All @@ -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

Expand All @@ -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

Expand All @@ -561,10 +565,7 @@ Create a new plugin. The following project parameters are passed:

`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

Expand Down
25 changes: 24 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -722,6 +731,20 @@ task pullPlugin(group: ofbizPlugin, description: 'Download and install a plugin
}
}

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" }
Expand Down

0 comments on commit ed08f74

Please sign in to comment.