• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

fundacionjala/enforce-gradle-plugin: Gradle plugin for Salesforce projects, help ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

fundacionjala/enforce-gradle-plugin

开源软件地址(OpenSource Url):

https://github.com/fundacionjala/enforce-gradle-plugin

开源编程语言(OpenSource Language):

Groovy 94.0%

开源软件介绍(OpenSource Introduction):

Build Status license


Quick start

General description

This project is a Gradle plugin that provides useful tasks for implement a Continuous Integration process for SalesForce projects.

How can you use this plugin?

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()
        jcenter()
    }
    dependencies {
        classpath 'org.fundacionjala.gradle.plugins.enforce:enforce-gradle-plugin:1.1.5'
    }
}

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.


Reports

  • These reports are generated on {PROJECT_FOLDER}/build/report/ after execute gradle runTest command.
  • They are able to be integration with Jenkins enviroments

JUnit test result report

Configuration

  • Select your job.
  • Go to Configure -> Add post-build action
  • Select Publish JUnit test result report option

Unit test result configuration

Preview

Unit test result preview

Enforce code coverage and test result report

  • Summary, contains charts with the coverage and test results.
  • Unit Test, contains unit test execution results and also it has options to filter its results.
  • Coverage, contains a list of all classes categorized by coverage status(Danger, Risk, Acceptable, Safe) and also it is possible to review the covered and uncovered lines by file(click on file name).

Configuration

  • Select your job.
  • Go to Configure -> Add post-build action
  • Select Publish HTML reports option

Code coverage result configuration

Preview Enforce code coverage and test result report preview


Development

Requirements

Using the plugin in your gradle build script

You can use your own gradle version but to avoid unexpected results with the compatibility we recommend to use the gradle wrapper. You can modify the build.gradle file and specify your version there.

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 wrapper

Please, make sure that your changes are not breaking any functionality running the unit test:

   $ ./gradlew test



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap