This project is a Gradle plugin that provides useful tasks for implement a Continuous Integration process for SalesForce projects.
Here you can find the enought required information to have running a Gradle project with Enforce.
1.Create build.gradle file on your source code project, below you have an example:
buildscript {
repositories {
mavenCentral()
maven {
url "https://dl.bintray.com/fundacionjala/enforce"
}
}
dependencies {
classpath 'org.fundacionjala.gradle.plugins.enforce:enforce-gradle-plugin:1.0.0'
}
}
apply plugin: 'enforce'
enforce {
srcPath = 'src'
}
2.Register a Salesforce credential to be used
$ gradle addCredential -Pid=default
-Pusername=<USER NAME>
-Ppassword=<PASSWORD>
-Ptoken=<SECURITY TOKEN>
In this step is recomendable put credential id as default value, to run the EnForce tasks without using credentialId parameter.
Executing a task without credentialId parameter:
$ gradle <TASK NAME>
It uses the default credential.
Executing a task with credentialId parameter:
$ gradle <TASK NAME> -PcredentialId=<CREDENTIAL ID>
This credential will be saved in credentials.dat file located in user HOME directory.
3.Start executing available commands, for example, deploy all classes from your local repository to your organization.
$ gradle deploy
Now you can start using all the Enforce features.
- Java JDK or JRE, version 7 or higher.
- Gradle version 2.0 or higher.
- Internet access (configure Gradle if you are using a Proxy).
It is desired a basic knowledge about Gradle and its plugin mechanism, as starting point you can review:
Once you have the source code, open the source code in a console and execute:
$ gradle build
Please, make sure that your changes are not breaking any functionality running the unit test:
$ gradle test