Author: jleroux
Date: Sat Sep 17 06:51:23 2016
New Revision: 1761131

URL: http://svn.apache.org/viewvc?rev=1761131&view=rev
Log:
Improves: Create a Gradle task to use Xlint arguments when building
(OFBIZ-8251)

Attached is a simple and clean fix. Essentially, it's better to just use Xlint 
which is equal to Xlint:all to show everything and you can dig through it for 
whatever you want.
What this fix requires is only passing a project property called Xlint. So .. 
the syntax is ./gradlew -PXlint build

This adds also the documentation for both this issue and the OWASP-DC task

Thanks: Taher

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=1761131&r1=1761130&r2=1761131&view=diff
==============================================================================
--- ofbiz/trunk/README.md (original)
+++ ofbiz/trunk/README.md Sat Sep 17 06:51:23 2016
@@ -426,6 +426,22 @@ default password
 
 `gradlew loadAdminUserLogin -PuserLoginId=MyUserName`
 
+#### Compile Java using Xlint output
+
+Xlint prints output of all warnings detected by the compiler
+
+`gradlew -PXlint build`
+
+#### Run OWASP tool to identify dependency vulnerabilities (CVEs)
+
+The below command activates a gradle plugin (OWASP) and Identifies
+and reports known vulnerabilities (CVEs) in OFBiz library dependencies.
+This command takes a long time to execute because it needs to download
+all plugin dependencies and the CVE identification process is also
+time consuming
+
+`gradlew -PenableOwasp dependencyCheck`
+
 #### Setup eclipse project for OFBiz
 
 Thanks to some gradle magic, setting up OFBiz on eclipse is very

Modified: ofbiz/trunk/build.gradle
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/build.gradle?rev=1761131&r1=1761130&r2=1761131&view=diff
==============================================================================
--- ofbiz/trunk/build.gradle (original)
+++ ofbiz/trunk/build.gradle Sat Sep 17 06:51:23 2016
@@ -39,19 +39,12 @@ javadoc.failOnError = false
 sourceCompatibility = '1.8'
 targetCompatibility = '1.8'
 
-/* Please don't remove. This is useful when you want to see 
-   unchecked warnings and deprecated members or classes in log.
-allprojects {
-    gradle.projectsEvaluated {
-        tasks.withType(JavaCompile) {
-            options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
-        }
-    }
-}*/
-
-// Enforces UTF-8 java compilation encoding on Windows platform
+// Java compile options
 tasks.withType(JavaCompile) {
     options.encoding = 'UTF-8'
+    if(project.hasProperty('Xlint')) {
+        options.compilerArgs << "-Xlint"
+    }
 }
 
 // root and subproject settings


Reply via email to