Class ProjectDelegate

java.lang.Object
org.savantbuild.parser.groovy.ProjectDelegate

public class ProjectDelegate extends Object
Groovy delegate that captures the Project configuration from the project build file. The methods on this class capture the configuration from the DSL.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final org.savantbuild.output.Output
     
    final Project
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    ProjectDelegate(org.savantbuild.output.Output output, Project project)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.savantbuild.dep.domain.Dependencies
    dependencies(groovy.lang.Closure<?> closure)
    Configures the project dependencies.
    publications(groovy.lang.Closure<?> closure)
    Configures the project publications.
    org.savantbuild.dep.workflow.Workflow
    publishWorkflow(groovy.lang.Closure<?> closure)
    Configures the project publish workflow.
    org.savantbuild.dep.workflow.Workflow
    workflow(groovy.lang.Closure<?> closure)
    Configures the project workflow.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • output

      public final org.savantbuild.output.Output output
    • project

      public final Project project
  • Constructor Details

    • ProjectDelegate

      public ProjectDelegate(org.savantbuild.output.Output output, Project project)
  • Method Details

    • dependencies

      public org.savantbuild.dep.domain.Dependencies dependencies(@DelegatesTo(DependenciesDelegate.class) groovy.lang.Closure<?> closure)

      Configures the project dependencies. This method is called with a closure that contains the dependencies definition. It should look like:

         dependencies {
           group(name: "compile") {
             dependency("org.example:compile:1.0")
           }
           group(name: "test-compile") {
             dependency("org.example:test:1.0")
           }
         }
       
      Parameters:
      closure - The closure that is called to setup the Dependencies configuration. This closure uses the delegate class DependenciesDelegate.
      Returns:
      The Dependencies.
    • publications

      public Publications publications(@DelegatesTo(PublicationsDelegate.class) groovy.lang.Closure<?> closure)

      Configures the project publications. This method is called with a closure that contains the publication definitions. It should look like:

         publications {
           main {
             publication(name: "foo", file: "build/jars/foo-${project.version}.jar", source: "build/jars/foo-${project.version}-src.jar")
             publication(name: "foo-test", file: "build/jars/foo-test-${project.version}.jar", source: "build/jars/foo-test${project.version}-src.jar")
           }
         }
       
      Parameters:
      closure - The closure that is called to setup the publications. This closure uses the delegate class PublicationsDelegate.
      Returns:
      The list of Publications.
    • publishWorkflow

      public org.savantbuild.dep.workflow.Workflow publishWorkflow(@DelegatesTo(ProcessDelegate.class) groovy.lang.Closure<?> closure)

      Configures the project publish workflow. This method is called with a closure that contains the public workflow definition. It should look like:

         publishWorkflow {
           subversion(repository: "http://svn.example.com/")
         }
       
      Parameters:
      closure - The closure that is called to setup the publish workflow configuration. This closure uses the delegate class WorkflowDelegate.ProcessDelegate.
      Returns:
      The workflow.
    • workflow

      public org.savantbuild.dep.workflow.Workflow workflow(@DelegatesTo(WorkflowDelegate.class) groovy.lang.Closure<?> closure)

      Configures the project workflow. This method is called with a closure that contains the workflow definition. It should look like:

         workflow {
           fetch {
             cache()
             url(url: "https://repository.savantbuild.org")
           }
           publish {
             cache()
           }
         }
       
      Parameters:
      closure - The closure that is called to set up the workflow configuration. This closure uses the delegate class WorkflowDelegate.
      Returns:
      The workflow.