1. David Carr
  2. gradle-less-plugin

Commits

David Carr  committed 12ea968

docs: add javadocs to existing classes

  • Participants
  • Parent commits 2ed3664
  • Branches default

Comments (0)

Files changed (4)

File TODO.md

View file
 Items in this group are either under active development, or will likely be under active development soon.  Most items in this list should make it into the next feature release.
 
 * Write README
-* Add javadocs
 
 ## Soon
 

File src/main/java/us/carrclan/david/gradle/less/LessCompile.java

View file
 import java.io.File;
 import java.io.IOException;
 
+/**
+ * Compiles LESS files from a source directory into CSS files in a destination directory.
+ *
+ * <p><pre class="groovyTestCase">
+ * def project = org.gradle.testfixtures.ProjectBuilder.builder().build()
+ * project.with {
+ *     task(name: 'myTask', type: us.carrclan.david.gradle.less.LessCompile) {
+ *         sourceDir = 'web-app/less'
+ *         destinationDir = 'build/web-app/css'
+ *         encoding = 'UTF-8'
+ *         compress = true
+ *     }
+ * }
+ * </pre></p>
+ */
 public class LessCompile extends DefaultTask {
     private Boolean compress;
     private String encoding;
         return new File(getDestinationDir(), newPath);
     }
 
+    /**
+     * Gets whether the LESS compiler's "compress" setting is enabled.
+     */
     @Input @Optional
     public Boolean isCompress() {
         return compress;
     }
 
+    /**
+     * Gets the name of the encoding to use when writing CSS files.
+     */
     @Input @Optional
     public String getEncoding() {
         return encoding;
     }
 
+    /**
+     * Gets the destination directory.
+     */
     @OutputDirectory
     public File getDestinationDir() {
         return destinationDir;
     }
 
+    /**
+     * Gets the source directory.
+     */
     @InputDirectory
     public File getSourceDir() {
         return sourceDir;
     }
 
+    /**
+     * Sets whether the LESS compiler's "compress" setting is enabled.
+     */
     public void setCompress(Boolean compress) {
         this.compress = compress;
     }
 
+    /**
+     * Sets the name of the encoding to use when writing CSS files.
+     */
     public void setEncoding(String encoding) {
         this.encoding = encoding;
     }
 
+    /**
+     * Sets the destination directory.
+     *
+     * @param destinationPath The destination directory.  This is evaluated as per
+     *      {@link org.gradle.api.Project#file(Object)}.
+     */
     public void setDestinationDir(Object destinationPath) {
         this.destinationDir = getProject().file(destinationPath);
     }
 
+    /**
+     * Sets the source directory.
+     *
+     * @param sourcePath The source directory.  This is evaluated as per {@link org.gradle.api.Project#file(Object)}.
+     */
     public void setSourceDir(Object sourcePath) {
         this.sourceDir = getProject().file(sourcePath);
     }

File src/main/java/us/carrclan/david/gradle/less/LessPlugin.java

View file
 import java.io.File;
 import java.util.concurrent.Callable;
 
+/**
+ * A {@link Plugin} that compiles LESS files into CSS files.
+ */
 public class LessPlugin implements Plugin<Project> {
     public static final String LESS_COMPILE_SITE_TASK_NAME = "lessCompileSite";
 

File src/test/groovy/us/carrclan/david/gradle/less/JavadocPreTagTestSuite.groovy

View file
+/*
+ * Copyright 2013 David M. Carr
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in
+ * compliance with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is
+ * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and limitations under the License.
+ */
+
+package us.carrclan.david.gradle.less
+
+import junit.framework.Test
+import junit.framework.TestCase
+import junit.framework.TestSuite
+
+class JavadocPreTagTestSuite extends TestCase {
+    public static Test suite() {
+        new TestSuite().with { suite ->
+            suite.addTest(JavadocAssertionTestSuite.suite('src/main'))
+            suite
+        }
+    }
+}