コード例 #1
0
ファイル: test_list_goals.py プロジェクト: tglstory/pants
    def test_list_goals(self):
        Goal.clear()
        self.assert_console_output(self._INSTALLED_HEADER)

        # Goals with no tasks should always be elided.
        list_goals_goal = Goal.register(self._LIST_GOALS_NAME,
                                        self._LIST_GOALS_DESC)
        self.assert_console_output(self._INSTALLED_HEADER)

        list_goals_goal.install(self._LIST_GOALS_TASK)
        self.assert_console_output(
            self._INSTALLED_HEADER,
            '  {0}: {1}'.format(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC),
        )

        Goal.register(self._LLAMA_NAME,
                      self._LLAMA_DESC).install(self._LLAMA_TASK)
        self.assert_console_output(
            self._INSTALLED_HEADER,
            '  {0}: {1}'.format(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC),
            '  {0}: {1}'.format(self._LLAMA_NAME, self._LLAMA_DESC),
        )

        Goal.register(self._ALPACA_NAME,
                      description='').install(self._ALPACA_TASK)
        self.assert_console_output(
            self._INSTALLED_HEADER,
            '  {0}: {1}'.format(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC),
            '  {0}: {1}'.format(self._LLAMA_NAME, self._LLAMA_DESC),
        )
コード例 #2
0
ファイル: register.py プロジェクト: ryan-williams/mvn2pants
def register_goals():
    Goal.register(
        'jar-manifest',
        'Place a text file into META-INF/ with a list of all the 3rdparty jars bundled into a binary'
    )
    task(name='jar-manifest', action=JarManifestTask,
         serialize=False).install()
コード例 #3
0
ファイル: test_list_goals.py プロジェクト: CaitieM20/pants
  def test_list_goals(self):
    Goal.clear()
    self.assert_console_output(self._INSTALLED_HEADER)

    # Goals with no tasks should always be elided.
    list_goals_goal = Goal.register(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC)
    self.assert_console_output(self._INSTALLED_HEADER)

    list_goals_goal.install(self._LIST_GOALS_TASK)
    self.assert_console_output(
      self._INSTALLED_HEADER,
      '  {0}: {1}'.format(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC),
    )

    Goal.register(self._LLAMA_NAME, self._LLAMA_DESC).install(self._LLAMA_TASK)
    self.assert_console_output(
      self._INSTALLED_HEADER,
      '  {0}: {1}'.format(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC),
      '  {0}: {1}'.format(self._LLAMA_NAME, self._LLAMA_DESC),
    )

    Goal.register(self._ALPACA_NAME, description='').install(self._ALPACA_TASK)
    self.assert_console_output(
      self._INSTALLED_HEADER,
      '  {0}: {1}'.format(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC),
      '  {0}: {1}'.format(self._LLAMA_NAME, self._LLAMA_DESC),
    )
コード例 #4
0
ファイル: register.py プロジェクト: yoshikids/fsqio
def register_goals():
    # Spindle has a circular dependency, in that Spindle is required to build Spindle :(
    # The build_spindle task bootstraps a Spindle binary in order to allow sane iteration on the Spindle source code.
    task(name='build-spindle', action=BuildSpindle).install()
    task(name='spindle', action=SpindleGen).install('gen')

    Goal.register('ide-gen', 'Generate stub interfaces for IDE integration.')
    task(name='spindle-stubs', action=SpindleStubsGen).install('ide-gen')
コード例 #5
0
ファイル: register.py プロジェクト: mateor/fsqio
def register_goals():
  # Spindle has a circular dependency, in that Spindle is required to build Spindle :(
  # The build_spindle task bootstraps a Spindle binary in order to allow sane iteration on the Spindle source code.
  task(name='build-spindle', action=BuildSpindle).install()
  task(name='spindle', action=SpindleGen).install('gen')

  Goal.register('ide-gen', 'Generate stub interfaces for IDE integration.')
  task(name='spindle-stubs', action=SpindleStubsGen).install('ide-gen')
コード例 #6
0
ファイル: register.py プロジェクト: wiwa/pants
def register_goals():
    Goal.register(
        "echo",
        "test tasks that echo their target set",
        options_registrar_cls=SkipAndTransitiveGoalOptionsRegistrar,
    )
    task(name="one", action=EchoOne).install("echo")
    task(name="two", action=EchoTwo).install("echo")
コード例 #7
0
ファイル: register.py プロジェクト: pombredanne/mvn2pants
def register_goals():
    Goal.register(
        "invalidate-fingerprint-dependees",
        "Hack to make sure that java libraries are recompiled when a resource is changed.",
    )
    task(name="invalidate-fingerprint-dependees", action=InvalidateFingerpintDependees).install(
        "invalidate-fingerprint-dependees"
    )
コード例 #8
0
ファイル: register.py プロジェクト: yoshikids/fsqio
def register_goals():
    Goal.register('webpack', 'Build Node.js webpack modules.')

    # These are incompatible with our subclasses at the moment.
    Goal.by_name('test').uninstall_task('node')
    Goal.by_name('resolve').uninstall_task('node')

    # Install our webpack-focused node tasks.
    task(name='webpack-resolve', action=WebPackResolve).install('webpack')
    task(name='webpack-gen', action=WebPack).install('webpack')
    task(name='webpack-bundle', action=WebPackBundle).install('bundle')
    task(name='webpack', action=WebPackTestRun).install('test')
コード例 #9
0
ファイル: test_list_goals.py プロジェクト: foursquare/pants
  def test_register_duplicate_task_name_is_not_error_when_replacing(self):
    Goal.clear()

    class NoopTask(Task):
      def execute(self):
        pass

    class OtherNoopTask(Task):
      def execute(self):
        pass

    goal = Goal.register(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC)
    task_name = 'foo'
    goal.install(TaskRegistrar(task_name, NoopTask))
    goal.install(TaskRegistrar(task_name, OtherNoopTask), replace=True)

    self.assertTrue(issubclass(goal.task_type_by_name(task_name), OtherNoopTask))
コード例 #10
0
ファイル: test_list_goals.py プロジェクト: ryokugyu/pants
  def test_register_duplicate_task_name_is_not_error_when_replacing(self):
    Goal.clear()

    class NoopTask(Task):
      def execute(self):
        pass

    class OtherNoopTask(Task):
      def execute(self):
        pass

    goal = Goal.register(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC)
    task_name = 'foo'
    goal.install(TaskRegistrar(task_name, NoopTask))
    goal.install(TaskRegistrar(task_name, OtherNoopTask), replace=True)

    self.assertTrue(issubclass(goal.task_type_by_name(task_name), OtherNoopTask))
コード例 #11
0
def register_goals():
  Goal.by_name('idea').uninstall_task('idea')
  Goal.register('old-idea',
    'The old, deprecated task to generate an IntelliJ project (this is the task used in '
    'open-source pants).')
  Goal.register('idea', 
    'Generates an IntelliJ project for the specified targets and transitive dependencies. This is '
    'Square\'s internal version of the idea goal, implemented as a plugin.')
  Goal.register('new-idea', 'This has been renamed to just "idea".')

  task(name='old-idea', action=IdeaGen).install('old-idea')
  task(name='idea', action=SquareIdea).install('idea')
  task(name='new-idea', action=ShowNewIdeaMovedMessage).install('new-idea')
コード例 #12
0
ファイル: test_list_goals.py プロジェクト: foursquare/pants
  def test_register_duplicate_task_name_is_error(self):
    Goal.clear()

    class NoopTask(Task):
      def execute(self):
        pass

    class OtherNoopTask(Task):
      def execute(self):
        pass

    goal = Goal.register(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC)
    task_name = 'foo'
    goal.install(TaskRegistrar(task_name, NoopTask))

    with self.assertRaises(GoalError) as ctx:
      goal.install(TaskRegistrar(task_name, OtherNoopTask))

    self.assertIn('foo', ctx.exception.message)
    self.assertIn(self._LIST_GOALS_NAME, ctx.exception.message)
コード例 #13
0
ファイル: test_list_goals.py プロジェクト: tglstory/pants
    def test_register_duplicate_task_name_is_error(self):
        Goal.clear()

        class NoopTask(Task):
            def execute(self):
                pass

        class OtherNoopTask(Task):
            def execute(self):
                pass

        goal = Goal.register(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC)
        task_name = 'foo'
        goal.install(TaskRegistrar(task_name, NoopTask))

        with self.assertRaises(GoalError) as ctx:
            goal.install(TaskRegistrar(task_name, OtherNoopTask))

        self.assertIn('foo', ctx.exception.message)
        self.assertIn(self._LIST_GOALS_NAME, ctx.exception.message)
コード例 #14
0
ファイル: test_list_goals.py プロジェクト: Gointer/pants
  def test_list_goals_all(self):
    Goal.clear()

    Goal.register(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC)
    Goal.register(self._LLAMA_NAME, self._LLAMA_DESC)
    Goal.register(self._ALPACA_NAME, description='')

    self.assert_console_output(
      self._INSTALLED_HEADER,
      '  {0}: {1}'.format(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC),
      '  {0}: {1}'.format(self._LLAMA_NAME, self._LLAMA_DESC),
      '',
      self._UNDOCUMENTED_HEADER,
      '  {0}'.format(self._ALPACA_NAME),
      options={'all': True}
    )
コード例 #15
0
    def test_list_goals_all(self):
        Goal.clear()

        Goal.register(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC)
        Goal.register(self._LLAMA_NAME, self._LLAMA_DESC)
        Goal.register(self._ALPACA_NAME, description='')

        self.assert_console_output(self._INSTALLED_HEADER,
                                   '  {0}: {1}'.format(self._LIST_GOALS_NAME,
                                                       self._LIST_GOALS_DESC),
                                   '  {0}: {1}'.format(self._LLAMA_NAME,
                                                       self._LLAMA_DESC),
                                   '',
                                   self._UNDOCUMENTED_HEADER,
                                   '  {0}'.format(self._ALPACA_NAME),
                                   options={'all': True})
コード例 #16
0
ファイル: test_list_goals.py プロジェクト: ryokugyu/pants
  def test_list_goals_all(self):
    Goal.clear()

    Goal.register(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC).install(self._LIST_GOALS_TASK)

    # Goals with no tasks should always be elided.
    Goal.register(self._LLAMA_NAME, self._LLAMA_DESC)

    Goal.register(self._ALPACA_NAME, description='').install(self._ALPACA_TASK)

    self.assert_console_output(
      self._INSTALLED_HEADER,
      '  {0}: {1}'.format(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC),
      '',
      self._UNDOCUMENTED_HEADER,
      '  {0}'.format(self._ALPACA_NAME),
      options={'all': True}
    )
コード例 #17
0
ファイル: test_list_goals.py プロジェクト: CaitieM20/pants
  def test_list_goals_all(self):
    Goal.clear()

    Goal.register(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC).install(self._LIST_GOALS_TASK)

    # Goals with no tasks should always be elided.
    Goal.register(self._LLAMA_NAME, self._LLAMA_DESC)

    Goal.register(self._ALPACA_NAME, description='').install(self._ALPACA_TASK)

    self.assert_console_output(
      self._INSTALLED_HEADER,
      '  {0}: {1}'.format(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC),
      '',
      self._UNDOCUMENTED_HEADER,
      '  {0}'.format(self._ALPACA_NAME),
      options={'all': True}
    )
コード例 #18
0
    def test_list_goals_graph(self):
        Goal.clear()

        Goal.register(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC)
        Goal.register(self._LLAMA_NAME, self._LLAMA_DESC)
        Goal.register(self._ALPACA_NAME, description='')

        self.assert_console_output(
            'digraph G {\n  rankdir=LR;\n  graph [compound=true];',
            '  subgraph cluster_goals {\n    node [style=filled];\n    color = blue;\n    label = "goals";',
            '    goals_goals [label="goals"];',
            '  }',
            '  subgraph cluster_llama {\n    node [style=filled];\n    color = blue;\n    label = "llama";',
            '    llama_llama [label="llama"];',
            '  }',
            '  subgraph cluster_alpaca {\n    node [style=filled];\n    color = blue;\n    label = "alpaca";',
            '    alpaca_alpaca [label="alpaca"];',
            '  }',
            '  alpaca_alpaca -> llama_llama [ltail=cluster_alpaca lhead=cluster_llama];',
            '}',
            options={'graph': True})
コード例 #19
0
ファイル: test_list_goals.py プロジェクト: CaitieM20/pants
  def test_list_goals_graph(self):
    Goal.clear()

    Goal.register(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC).install(self._LIST_GOALS_TASK)
    Goal.register(self._LLAMA_NAME, self._LLAMA_DESC).install(self._LLAMA_TASK)
    Goal.register(self._ALPACA_NAME, description='')

    self.assert_console_output(
      'digraph G {\n  rankdir=LR;\n  graph [compound=true];',
      '  subgraph cluster_goals {\n    node [style=filled];\n    color = blue;\n    label = "goals";',
      '    goals_goals [label="goals"];',
      '  }',
      '  subgraph cluster_llama {\n    node [style=filled];\n    color = blue;\n    label = "llama";',
      '    llama_llama [label="llama"];',
      '  }',
      '  subgraph cluster_alpaca {\n    node [style=filled];\n    color = blue;\n    label = "alpaca";',
      '    alpaca_alpaca [label="alpaca"];',
      '  }',
      '  alpaca_alpaca -> llama_llama [ltail=cluster_alpaca lhead=cluster_llama];',
      '}',
      options={'graph': True}
    )
コード例 #20
0
ファイル: test_list_goals.py プロジェクト: Gointer/pants
  def test_list_goals(self):
    Goal.clear()
    self.assert_console_output(self._INSTALLED_HEADER)

    Goal.register(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC)
    self.assert_console_output(
      self._INSTALLED_HEADER,
      '  {0}: {1}'.format(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC),
    )

    Goal.register(self._LLAMA_NAME, self._LLAMA_DESC)
    self.assert_console_output(
      self._INSTALLED_HEADER,
      '  {0}: {1}'.format(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC),
      '  {0}: {1}'.format(self._LLAMA_NAME, self._LLAMA_DESC),
    )

    Goal.register(self._ALPACA_NAME, description='')
    self.assert_console_output(
      self._INSTALLED_HEADER,
      '  {0}: {1}'.format(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC),
      '  {0}: {1}'.format(self._LLAMA_NAME, self._LLAMA_DESC),
    )
コード例 #21
0
    def test_list_goals(self):
        Goal.clear()
        self.assert_console_output(self._INSTALLED_HEADER)

        Goal.register(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC)
        self.assert_console_output(
            self._INSTALLED_HEADER,
            '  {0}: {1}'.format(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC),
        )

        Goal.register(self._LLAMA_NAME, self._LLAMA_DESC)
        self.assert_console_output(
            self._INSTALLED_HEADER,
            '  {0}: {1}'.format(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC),
            '  {0}: {1}'.format(self._LLAMA_NAME, self._LLAMA_DESC),
        )

        Goal.register(self._ALPACA_NAME, description='')
        self.assert_console_output(
            self._INSTALLED_HEADER,
            '  {0}: {1}'.format(self._LIST_GOALS_NAME, self._LIST_GOALS_DESC),
            '  {0}: {1}'.format(self._LLAMA_NAME, self._LLAMA_DESC),
        )
コード例 #22
0
ファイル: register.py プロジェクト: ericzundel/pants
def register_goals():
  ng_killall = task(name='ng-killall', action=NailgunKillall)
  ng_killall.install()

  Goal.by_name('invalidate').install(ng_killall, first=True)
  Goal.by_name('clean-all').install(ng_killall, first=True)

  task(name='jar-dependency-management', action=JarDependencyManagementSetup).install('bootstrap')

  task(name='jvm-platform-explain', action=JvmPlatformExplain).install('jvm-platform-explain')
  task(name='jvm-platform-validate', action=JvmPlatformValidate).install('jvm-platform-validate')

  task(name='bootstrap-jvm-tools', action=BootstrapJvmTools).install('bootstrap')
  task(name='provide-tools-jar', action=ProvideToolsJar).install('bootstrap')

  # Compile
  task(name='zinc', action=ZincCompile).install('compile')

  # Dependency resolution.
  task(name='ivy', action=IvyResolve).install('resolve', first=True)
  task(name='ivy-imports', action=IvyImports).install('imports')
  task(name='unpack-jars', action=UnpackJars).install()

  # Resource preparation.
  task(name='prepare', action=PrepareResources).install('resources')
  task(name='services', action=PrepareServices).install('resources')

  task(name='export-classpath', action=RuntimeClasspathPublisher).install()
  task(name='jvm-dep-check', action=JvmDependencyCheck).install('compile')

  task(name='jvm', action=JvmDependencyUsage).install('dep-usage')

  # Generate documentation.
  task(name='javadoc', action=JavadocGen).install('doc')
  task(name='scaladoc', action=ScaladocGen).install('doc')

  # Bundling.
  Goal.register('jar', 'Create a JAR file.')
  task(name='create', action=JarCreate).install('jar')
  detect_duplicates = task(name='dup', action=DuplicateDetector)

  task(name='jvm', action=BinaryCreate).install('binary')
  detect_duplicates.install('binary')

  task(name='consolidate-classpath', action=ConsolidateClasspath).install('bundle')
  task(name='jvm', action=BundleCreate).install('bundle')
  detect_duplicates.install('bundle')

  task(name='detect-duplicates', action=DuplicateDetector).install()

  # Publishing.
  task(name='check-published-deps', action=CheckPublishedDeps).install('check-published-deps')

  task(name='jar', action=JarPublish).install('publish')

  # Testing.
  task(name='junit', action=JUnitRun).install('test')
  task(name='bench', action=BenchmarkRun).install('bench')

  # Running.
  task(name='jvm', action=JvmRun, serialize=False).install('run')
  task(name='jvm-dirty', action=JvmRun, serialize=False).install('run-dirty')
  task(name='scala', action=ScalaRepl, serialize=False).install('repl')
  task(name='scala-dirty', action=ScalaRepl, serialize=False).install('repl-dirty')
  task(name='scalafmt', action=ScalaFmtCheckFormat, serialize=False).install('compile', first=True)
  task(name='scalafmt', action=ScalaFmtFormat, serialize=False).install('fmt')
  task(name='test-jvm-prep-command', action=RunTestJvmPrepCommand).install('test', first=True)
  task(name='binary-jvm-prep-command', action=RunBinaryJvmPrepCommand).install('binary', first=True)
  task(name='compile-jvm-prep-command', action=RunCompileJvmPrepCommand).install('compile', first=True)
コード例 #23
0
def register_goals():
  Goal.register('copy_signed_jars', 'Copy these resolved jars individually into a specific directory under dist/')
  task(name='copy_signed_jars', action=CopySignedJars).install('binary')
コード例 #24
0
ファイル: register.py プロジェクト: Gointer/pants
def register_goals():
  # Register descriptions for the standard multiple-task goals.  Single-task goals get
  # their descriptions from their single task.
  Goal.register('buildgen', 'Automatically generate BUILD files.')
  Goal.register('bootstrap', 'Bootstrap tools needed by subsequent build steps.')
  Goal.register('imports', 'Resolve external source dependencies.')
  Goal.register('gen', 'Generate code.')
  Goal.register('resolve', 'Resolve external binary dependencies.')
  Goal.register('compile', 'Compile source code.')
  Goal.register('binary', 'Create a runnable binary.')
  Goal.register('resources', 'Prepare resources.')
  Goal.register('bundle', 'Create a deployable application bundle.')
  Goal.register('test', 'Run tests.')
  Goal.register('bench', 'Run benchmarks.')
  Goal.register('repl', 'Run a REPL.')
  Goal.register('repl-dirty', 'Run a REPL, skipping compilation.')
  Goal.register('run', 'Invoke a binary.')
  Goal.register('run-dirty', 'Invoke a binary, skipping compilation.')
  Goal.register('doc', 'Generate documentation.')
  Goal.register('publish', 'Publish a build artifact.')
  Goal.register('dep-usage', 'Collect target dependency usage data.')

  # Register tasks.

  # Cleaning.
  task(name='invalidate', action=Invalidate).install()
  task(name='clean-all', action=Clean).install('clean-all')

  # Pantsd.
  kill_pantsd = task(name='kill-pantsd', action=PantsDaemonKill)
  kill_pantsd.install()
  kill_pantsd.install('clean-all')

  # Reporting server.
  # TODO: The reporting server should be subsumed into pantsd, and not run via a task.
  task(name='server', action=ReportingServerRun, serialize=False).install()
  task(name='killserver', action=ReportingServerKill, serialize=False).install()

  # Getting help.
  task(name='goals', action=ListGoals).install()
  task(name='options', action=ExplainOptionsTask).install()
  task(name='targets', action=TargetsHelp).install()

  # Stub for other goals to schedule 'compile'. See noop_exec_task.py for why this is useful.
  task(name='compile', action=NoopCompile).install('compile')

  # Prep commands must be the first thing we register under its goal.
  task(name='test-prep-command', action=RunTestPrepCommand).install('test', first=True)
  task(name='binary-prep-command', action=RunBinaryPrepCommand).install('binary', first=True)
  task(name='compile-prep-command', action=RunCompilePrepCommand).install('compile', first=True)

  # Stub for other goals to schedule 'test'. See noop_exec_task.py for why this is useful.
  task(name='test', action=NoopTest).install('test')

  # Operations on files that the SCM detects as changed.
  task(name='changed', action=WhatChanged).install()
  task(name='compile-changed', action=CompileChanged).install()
  task(name='test-changed', action=TestChanged).install()

  # Workspace information.
  task(name='roots', action=ListRoots).install()
  task(name='bash-completion', action=BashCompletion).install()

  # Handle sources that aren't loose files in the repo.
  task(name='deferred-sources', action=DeferredSourcesMapper).install()
コード例 #25
0
ファイル: register.py プロジェクト: ryan-williams/mvn2pants
def register_goals():
    Goal.register('findbugs', 'Check Java code for findbugs violations.')
    task(name='findbugs', action=FindBugs).install()
コード例 #26
0
ファイル: register.py プロジェクト: baroquebobcat/pants
def register_goals():
  Goal.register('echo', 'test tasks that echo their target set',
                options_registrar_cls=SkipAndTransitiveGoalOptionsRegistrar)
  task(name='one', action=EchoOne).install('echo')
  task(name='two', action=EchoTwo).install('echo')
コード例 #27
0
def register_goals():
    Goal.register('jax-ws-gen', 'Generated code for jax-ws xml templates.')
    task(name='jax-ws-gen', action=JaxWsGen).install('gen')
コード例 #28
0
ファイル: register.py プロジェクト: cosmicexplorer/pants
def register_goals():
  # Register descriptions for the standard multiple-task goals.  Single-task goals get
  # their descriptions from their single task.
  Goal.register('buildgen', 'Automatically generate BUILD files.')
  Goal.register('bootstrap', 'Bootstrap tools needed by subsequent build steps.')
  Goal.register('imports', 'Resolve external source dependencies.')
  Goal.register('gen', 'Generate code.')
  Goal.register('resolve', 'Resolve external binary dependencies.')
  Goal.register('compile', 'Compile source code.')
  Goal.register('binary', 'Create a runnable binary.')
  Goal.register('resources', 'Prepare resources.')
  Goal.register('bundle', 'Create a deployable application bundle.')
  Goal.register('bench', 'Run benchmarks.')
  Goal.register('repl', 'Run a REPL.')
  Goal.register('repl-dirty', 'Run a REPL, skipping compilation.')
  Goal.register('run', 'Invoke a binary.')
  Goal.register('run-dirty', 'Invoke a binary, skipping compilation.')
  Goal.register('doc', 'Generate documentation.')
  Goal.register('publish', 'Publish a build artifact.')
  Goal.register('dep-usage', 'Collect target dependency usage data.')
  Goal.register('lint', 'Find formatting errors in source code.',
                LintTaskMixin.goal_options_registrar_cls)
  Goal.register('fmt', 'Autoformat source code.', FmtTaskMixin.goal_options_registrar_cls)
  Goal.register('buildozer', 'Manipulate BUILD files.')

  # Register tasks.

  # Cleaning.
  task(name='clean-all', action=Clean).install('clean-all')

  # Pantsd.
  kill_pantsd = task(name='kill-pantsd', action=PantsDaemonKill)
  kill_pantsd.install()
  # Kill pantsd/watchman first, so that they're not using any files
  # in .pants.d at the time of removal.
  kill_pantsd.install('clean-all', first=True)

  # Reporting server.
  # TODO: The reporting server should be subsumed into pantsd, and not run via a task.
  task(name='server', action=ReportingServerRun, serialize=False).install()
  task(name='killserver', action=ReportingServerKill, serialize=False).install()

  # Auth.
  task(name='login', action=Login).install()

  # Getting help.
  task(name='options', action=ExplainOptionsTask).install()
  task(name='targets', action=TargetsHelp).install()

  # Set up pants.ini.
  task(name="generate-pants-ini", action=GeneratePantsIni).install()

  # Stub for other goals to schedule 'compile'. See noop_exec_task.py for why this is useful.
  task(name='compile', action=NoopCompile).install('compile')

  # Prep commands must be the first thing we register under its goal.
  task(name='test-prep-command', action=RunTestPrepCommand).install('test', first=True)
  task(name='binary-prep-command', action=RunBinaryPrepCommand).install('binary', first=True)
  task(name='compile-prep-command', action=RunCompilePrepCommand).install('compile', first=True)

  # Stub for other goals to schedule 'test'. See noop_exec_task.py for why this is useful.
  task(name='legacy', action=NoopTest).install('test')

  # Workspace information.
  task(name='roots', action=ListRoots).install()
  task(name='bash-completion', action=BashCompletion).install()

  # Handle sources that aren't loose files in the repo.
  task(name='deferred-sources', action=DeferredSourcesMapper).install()

  # Processing aliased targets has to occur very early.
  task(name='substitute-aliased-targets', action=SubstituteAliasedTargets).install(
    'bootstrap', first=True)
コード例 #29
0
ファイル: register.py プロジェクト: ericzundel/mvn2pants
def register_goals():
  Goal.register('jax-ws-gen', 'Generated code for jax-ws xml templates.')
  task(name='jax-ws-gen', action=JaxWsGen).install('gen')
コード例 #30
0
def register_goals():
  # Register descriptions for the standard multiple-task goals.  Single-task goals get
  # their descriptions from their single task.
  Goal.register('buildgen', 'Automatically generate BUILD files.')
  Goal.register('bootstrap', 'Bootstrap tools needed by subsequent build steps.')
  Goal.register('imports', 'Resolve external source dependencies.')
  Goal.register('gen', 'Generate code.')
  Goal.register('resolve', 'Resolve external binary dependencies.')
  Goal.register('compile', 'Compile source code.')
  Goal.register('binary', 'Create a runnable binary.')
  Goal.register('resources', 'Prepare resources.')
  Goal.register('bundle', 'Create a deployable application bundle.')
  Goal.register('bench', 'Run benchmarks.')
  Goal.register('repl', 'Run a REPL.')
  Goal.register('repl-dirty', 'Run a REPL, skipping compilation.')
  Goal.register('run', 'Invoke a binary.')
  Goal.register('run-dirty', 'Invoke a binary, skipping compilation.')
  Goal.register('doc', 'Generate documentation.')
  Goal.register('publish', 'Publish a build artifact.')
  Goal.register('dep-usage', 'Collect target dependency usage data.')
  Goal.register('lint', 'Find formatting errors in source code.',
                LintTaskMixin.goal_options_registrar_cls)
  Goal.register('fmt', 'Autoformat source code.', FmtTaskMixin.goal_options_registrar_cls)
  Goal.register('buildozer', 'Manipulate BUILD files.')

  # Register tasks.

  # Cleaning.
  task(name='clean-all', action=Clean).install('clean-all')

  # Pantsd.
  kill_pantsd = task(name='kill-pantsd', action=PantsDaemonKill)
  kill_pantsd.install()
  # Kill pantsd/watchman first, so that they're not using any files
  # in .pants.d at the time of removal.
  kill_pantsd.install('clean-all', first=True)

  # Reporting server.
  # TODO: The reporting server should be subsumed into pantsd, and not run via a task.
  task(name='server', action=ReportingServerRun, serialize=False).install()
  task(name='killserver', action=ReportingServerKill, serialize=False).install()

  # Auth.
  task(name='login', action=Login).install()

  # Getting help.
  task(name='options', action=ExplainOptionsTask).install()
  task(name='targets', action=TargetsHelp).install()

  # Set up pants.ini.
  task(name="generate-pants-ini", action=GeneratePantsIni).install()

  # Stub for other goals to schedule 'compile'. See noop_exec_task.py for why this is useful.
  task(name='compile', action=NoopCompile).install('compile')

  # Prep commands must be the first thing we register under its goal.
  task(name='test-prep-command', action=RunTestPrepCommand).install('test', first=True)
  task(name='binary-prep-command', action=RunBinaryPrepCommand).install('binary', first=True)
  task(name='compile-prep-command', action=RunCompilePrepCommand).install('compile', first=True)

  # Stub for other goals to schedule 'test'. See noop_exec_task.py for why this is useful.
  task(name='legacy', action=NoopTest).install('test')

  # Workspace information.
  task(name='bash-completion', action=BashCompletion).install()

  # Handle sources that aren't loose files in the repo.
  task(name='deferred-sources', action=DeferredSourcesMapper).install()

  # Processing aliased targets has to occur very early.
  task(name='substitute-aliased-targets', action=SubstituteAliasedTargets).install(
    'bootstrap', first=True)
コード例 #31
0
ファイル: register.py プロジェクト: triplequote/pants
def register_goals():
    Goal.register('echo',
                  'test tasks that echo their target set',
                  options_registrar_cls=SkipAndTransitiveGoalOptionsRegistrar)
    task(name='one', action=EchoOne).install('echo')
    task(name='two', action=EchoTwo).install('echo')
コード例 #32
0
def register_goals():
    Goal.register(
        name="snyktest",
        description="Snyk Test your dependencies for vulnerabilities")
    task(name='dependencies', action=DependenciesTask).install('snyktest')
    task(name='snyk', action=SnykTask).install('snyktest')
コード例 #33
0
ファイル: register.py プロジェクト: wolframarnold/pants
def register_goals():
    ng_killall = task(name='ng-killall', action=NailgunKillall)
    ng_killall.install()

    Goal.by_name('invalidate').install(ng_killall, first=True)
    Goal.by_name('clean-all').install(ng_killall, first=True)

    task(name='jar-dependency-management',
         action=JarDependencyManagementSetup).install('bootstrap')

    task(name='jvm-platform-explain',
         action=JvmPlatformExplain).install('jvm-platform-explain')
    task(name='jvm-platform-validate',
         action=JvmPlatformValidate).install('jvm-platform-validate')

    task(name='bootstrap-jvm-tools',
         action=BootstrapJvmTools).install('bootstrap')

    # Compile
    task(name='zinc', action=ZincCompile).install('compile')

    # Dependency resolution.
    task(name='ivy', action=IvyResolve).install('resolve', first=True)
    task(name='ivy-imports', action=IvyImports).install('imports')
    task(name='unpack-jars', action=UnpackJars).install()

    # Resource preparation.
    task(name='prepare', action=PrepareResources).install('resources')
    task(name='services', action=PrepareServices).install('resources')

    task(name='export-classpath', action=RuntimeClasspathPublisher).install()
    task(name='jvm-dep-check', action=JvmDependencyCheck).install('compile')

    task(name='jvm', action=JvmDependencyUsage).install('dep-usage')

    # Generate documentation.
    task(name='javadoc', action=JavadocGen).install('doc')
    task(name='scaladoc', action=ScaladocGen).install('doc')

    # Bundling.
    Goal.register('jar', 'Create a JAR file.')
    task(name='create', action=JarCreate).install('jar')
    detect_duplicates = task(name='dup', action=DuplicateDetector)

    task(name='jvm', action=BinaryCreate).install('binary')
    detect_duplicates.install('binary')

    task(name='jvm', action=BundleCreate).install('bundle')
    detect_duplicates.install('bundle')

    task(name='detect-duplicates', action=DuplicateDetector).install()

    # Publishing.
    task(
        name='check_published_deps',
        action=CheckPublishedDeps,
    ).install('check_published_deps')

    task(name='jar', action=JarPublish).install('publish')

    # Testing.
    task(name='junit', action=JUnitRun).install('test')
    task(name='bench', action=BenchmarkRun).install('bench')

    # Running.
    task(name='jvm', action=JvmRun, serialize=False).install('run')
    task(name='jvm-dirty', action=JvmRun, serialize=False).install('run-dirty')
    task(name='scala', action=ScalaRepl, serialize=False).install('repl')
    task(name='scala-dirty', action=ScalaRepl,
         serialize=False).install('repl-dirty')
    task(name='test-jvm-prep-command',
         action=RunTestJvmPrepCommand).install('test', first=True)
    task(name='binary-jvm-prep-command',
         action=RunBinaryJvmPrepCommand).install('binary', first=True)
    task(name='compile-jvm-prep-command',
         action=RunCompileJvmPrepCommand).install('compile', first=True)
コード例 #34
0
def register_goals():
    # Register descriptions for the standard multiple-task goals.  Single-task goals get
    # their descriptions from their single task.
    Goal.register('buildgen', 'Automatically generate BUILD files.')
    Goal.register('bootstrap',
                  'Bootstrap tools needed by subsequent build steps.')
    Goal.register('imports', 'Resolve external source dependencies.')
    Goal.register('gen', 'Generate code.')
    Goal.register('resolve', 'Resolve external binary dependencies.')
    Goal.register('compile', 'Compile source code.')
    Goal.register('binary', 'Create a runnable binary.')
    Goal.register('resources', 'Prepare resources.')
    Goal.register('bundle', 'Create a deployable application bundle.')
    Goal.register('test', 'Run tests.')
    Goal.register('bench', 'Run benchmarks.')
    Goal.register('repl', 'Run a REPL.')
    Goal.register('repl-dirty', 'Run a REPL, skipping compilation.')
    Goal.register('run', 'Invoke a binary.')
    Goal.register('run-dirty', 'Invoke a binary, skipping compilation.')
    Goal.register('doc', 'Generate documentation.')
    Goal.register('publish', 'Publish a build artifact.')
    Goal.register('dep-usage', 'Collect target dependency usage data.')
    Goal.register('fmt', 'Autoformat source code.')

    # Register tasks.

    # Cleaning.
    task(name='invalidate', action=Invalidate).install()
    task(name='clean-all', action=Clean).install('clean-all')

    # Pantsd.
    kill_pantsd = task(name='kill-pantsd', action=PantsDaemonKill)
    kill_pantsd.install()
    kill_pantsd.install('clean-all')

    # Reporting server.
    # TODO: The reporting server should be subsumed into pantsd, and not run via a task.
    task(name='server', action=ReportingServerRun, serialize=False).install()
    task(name='killserver', action=ReportingServerKill,
         serialize=False).install()

    # Getting help.
    task(name='goals', action=ListGoals).install()
    task(name='options', action=ExplainOptionsTask).install()
    task(name='targets', action=TargetsHelp).install()

    # Stub for other goals to schedule 'compile'. See noop_exec_task.py for why this is useful.
    task(name='compile', action=NoopCompile).install('compile')

    # Prep commands must be the first thing we register under its goal.
    task(name='test-prep-command',
         action=RunTestPrepCommand).install('test', first=True)
    task(name='binary-prep-command',
         action=RunBinaryPrepCommand).install('binary', first=True)
    task(name='compile-prep-command',
         action=RunCompilePrepCommand).install('compile', first=True)

    # Stub for other goals to schedule 'test'. See noop_exec_task.py for why this is useful.
    task(name='test', action=NoopTest).install('test')

    # Operations on files that the SCM detects as changed.
    # TODO: Remove these in `1.5.0dev0` as part of the changed goal deprecations.
    task(name='changed', action=WhatChanged).install()
    task(name='compile-changed', action=CompileChanged).install()
    task(name='test-changed', action=TestChanged).install()

    # Workspace information.
    task(name='roots', action=ListRoots).install()
    task(name='bash-completion', action=BashCompletion).install()

    # Handle sources that aren't loose files in the repo.
    task(name='deferred-sources', action=DeferredSourcesMapper).install()

    # Processing aliased targets has to occur very early.
    task(name='substitute-aliased-targets',
         action=SubstituteAliasedTargets).install('bootstrap', first=True)
コード例 #35
0
def register_goals():
    # Register descriptions for the standard multiple-task goals.  Single-task goals get
    # their descriptions from their single task.
    Goal.register("buildgen", "Automatically generate BUILD files.")
    Goal.register("bootstrap",
                  "Bootstrap tools needed by subsequent build steps.")
    Goal.register("imports", "Resolve external source dependencies.")
    Goal.register("gen", "Generate code.")
    Goal.register("resolve", "Resolve external binary dependencies.")
    Goal.register("compile", "Compile source code.")
    Goal.register("binary", "Create a runnable binary.")
    Goal.register("resources", "Prepare resources.")
    Goal.register("bundle", "Create a deployable application bundle.")
    Goal.register("bench", "Run benchmarks.")
    Goal.register("repl", "Run a REPL.")
    Goal.register("repl-dirty", "Run a REPL, skipping compilation.")
    Goal.register("run", "Invoke a binary.")
    Goal.register("run-dirty", "Invoke a binary, skipping compilation.")
    Goal.register("doc", "Generate documentation.")
    Goal.register("publish", "Publish a build artifact.")
    Goal.register("dep-usage", "Collect target dependency usage data.")
    Goal.register("lint", "Find formatting errors in source code.")
    Goal.register("fmt", "Autoformat source code.")
    Goal.register("buildozer", "Manipulate BUILD files.")

    # Register tasks.

    # Cleaning.
    task(name="clean-all", action=Clean).install("clean-all")

    # Pantsd.
    kill_pantsd = task(name="kill-pantsd", action=PantsDaemonKill)
    kill_pantsd.install()
    # Kill pantsd/watchman first, so that they're not using any files
    # in .pants.d at the time of removal.
    kill_pantsd.install("clean-all", first=True)

    # Reporting server.
    # TODO: The reporting server should be subsumed into pantsd, and not run via a task.
    task(name="server", action=ReportingServerRun, serialize=False).install()
    task(name="killserver", action=ReportingServerKill,
         serialize=False).install()

    # Auth.
    task(name="login", action=Login).install()

    # Getting help.
    task(name="options", action=ExplainOptionsTask).install()
    task(name="targets", action=TargetsHelp).install()

    # Stub for other goals to schedule 'compile'. See noop_exec_task.py for why this is useful.
    task(name="compile", action=NoopCompile).install("compile")

    # Prep commands must be the first thing we register under its goal.
    task(name="test-prep-command",
         action=RunTestPrepCommand).install("test", first=True)
    task(name="binary-prep-command",
         action=RunBinaryPrepCommand).install("binary", first=True)
    task(name="compile-prep-command",
         action=RunCompilePrepCommand).install("compile", first=True)

    # Stub for other goals to schedule 'test'. See noop_exec_task.py for why this is useful.
    task(name="legacy", action=NoopTest).install("test")

    # Workspace information.
    task(name="bash-completion", action=BashCompletion).install()

    # Handle sources that aren't loose files in the repo.
    task(name="deferred-sources", action=DeferredSourcesMapper).install()

    # Processing aliased targets has to occur very early.
    task(name="substitute-aliased-targets",
         action=SubstituteAliasedTargets).install("bootstrap", first=True)
コード例 #36
0
ファイル: register.py プロジェクト: ericzundel/mvn2pants
def register_goals():
  Goal.register('findbugs', 'Check Java code for findbugs violations.')
  task(name='findbugs', action=FindBugs).install()
コード例 #37
0
def register_goals():
  Goal.register('sq-depmap','Generates a visualization of the dependency graph of the target arguments using graphviz dot.') 
  task(name='sq-depmap', action=SquareDepmap).install('sq-depmap')
コード例 #38
0
ファイル: register.py プロジェクト: ericzundel/mvn2pants
def register_goals():
  Goal.register('jar-manifest', 'Place a text file into META-INF/ with a list of all the 3rdparty jars bundled into a binary') 
  task(name='jar-manifest', action=JarManifestTask, serialize=False).install()
コード例 #39
0
def register_goals():
    Goal.register(name="python-protobufgen",
                  description="Generate python stubs from proto files")
    task(name="python-protoc", action=ProtocTask).install("python-protobufgen")