You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@aurora.apache.org by ma...@apache.org on 2014/05/16 01:36:54 UTC

git commit: Add JSHint to our build.

Repository: incubator-aurora
Updated Branches:
  refs/heads/master 17a3a5d9d -> cbe7b3b88


Add JSHint to our build.

Right now it does not break the build when JSHint fails.
Will fix the errors in a separate review.

Testing Done:
./gradlew clean build works.

Bugs closed: AURORA-228

Reviewed at https://reviews.apache.org/r/21407/


Project: http://git-wip-us.apache.org/repos/asf/incubator-aurora/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-aurora/commit/cbe7b3b8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-aurora/tree/cbe7b3b8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-aurora/diff/cbe7b3b8

Branch: refs/heads/master
Commit: cbe7b3b88cb4393a3ca8f1372e0646aca98cfe22
Parents: 17a3a5d
Author: David McLaughlin <da...@dmclaughlin.com>
Authored: Thu May 15 16:32:26 2014 -0700
Committer: Suman Karumuri <sk...@twitter.com>
Committed: Thu May 15 16:32:26 2014 -0700

----------------------------------------------------------------------
 build.gradle | 36 +++++++++++++++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-aurora/blob/cbe7b3b8/build.gradle
----------------------------------------------------------------------
diff --git a/build.gradle b/build.gradle
index 09fe3bf..ac54257 100644
--- a/build.gradle
+++ b/build.gradle
@@ -21,6 +21,7 @@ apply plugin: 'findbugs'
 apply plugin: 'idea'
 apply plugin: 'jacoco'
 apply plugin: 'java'
+apply plugin: 'js'
 apply plugin: 'license'
 apply plugin: 'maven-publish'
 apply plugin: 'project-report'
@@ -34,6 +35,7 @@ buildscript {
     classpath 'com.github.ben-manes:gradle-versions-plugin:0.4'
     classpath 'com.github.goldin.plugins.gradle:about:0.3.1'
     classpath 'nl.javadude.gradle.plugins:license-gradle-plugin:0.7.0'
+    classpath 'com.eriwen:gradle-js-plugin:1.11.1'
   }
 }
 
@@ -277,6 +279,38 @@ task checkPython() {
 }
 
 /**
+ * There is a jshint target recommended in the README for gradle-js-plugin
+ * but it does not work. This workaround from here:
+ * https://github.com/eriwen/gradle-js-plugin/issues/73
+ */
+task jsHint(type:com.eriwen.gradle.js.tasks.JsHintTask) {
+  source = fileTree('src/main/resources/org/apache/aurora/scheduler/http/ui/js/')
+  dest file("${buildDir}/jshint.out")
+  // Set this to false once JS code complies with JSHint.
+  ignoreExitCode true
+  outputToStdOut true
+  jshint.options = [
+    // See: http://www.jshint.com/docs/options/ for explanation.
+    browser: true,
+    camelcase: true,
+    curly: true,
+    eqeqeq: true,
+    indent: 2,
+    quotmark: true,
+    trailing: true,
+    undef: true,
+    unused: true
+  ]
+  jshint.predef = [
+    '_': true,
+    'angular': true,
+    'moment': true,
+    'Thrift': true
+  ]
+}
+tasks.checkstyleMain.dependsOn(jsHint)
+
+/**
  * Check if Apache Thrift is all ready installed and is the same version as we
  * depend on, otherwise compile the version in build-support. project.thrift will
  * contain the path to the thrift executable when finished
@@ -439,4 +473,4 @@ task FlagSchemaChanges(type: Test) << {
 
 javadoc {
   classpath += sourceSets.generated.output
-}
+}
\ No newline at end of file