[
https://issues.apache.org/jira/browse/BEAM-3252?focusedWorklogId=89948&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-89948
]
ASF GitHub Bot logged work on BEAM-3252:
----------------------------------------
Author: ASF GitHub Bot
Created on: 11/Apr/18 13:32
Start Date: 11/Apr/18 13:32
Worklog Time Spent: 10m
Work Description: asfgit closed pull request #414: [BEAM-3252] Updating
contributor's guide to reference Gradle.
URL: https://github.com/apache/beam-site/pull/414
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git a/src/contribute/contribution-guide.md
b/src/contribute/contribution-guide.md
index c8ddd8d0d..4b60154d8 100644
--- a/src/contribute/contribution-guide.md
+++ b/src/contribute/contribution-guide.md
@@ -246,9 +246,9 @@ to prevent the issue from reoccurring.
#### Java SDK
-For contributions to the Java code, run unit tests locally via Maven.
+For contributions to the Java code, run checks locally via Gradle.
- $ mvn clean verify
+ $ ./gradlew :beam-sdks-java-core:check --rerun-tasks
#### Python SDK
@@ -271,11 +271,11 @@ command.
$ tox -e lint_py2,lint_py3
-Beam supports running Python SDK tests using Maven. For this, navigate to root
+Beam supports running Python SDK tests using Gradle. For this, navigate to root
directory of your Apache Beam clone and execute following command. Currently
this cannot be run from a virtual environment.
- $ mvn clean verify -pl sdks/python
+ $ ./gradlew :beam-sdks-python:check --rerun-tasks
## Review
diff --git a/src/contribute/intellij.md b/src/contribute/intellij.md
index fe3d7fb1a..99291ca2e 100644
--- a/src/contribute/intellij.md
+++ b/src/contribute/intellij.md
@@ -15,20 +15,25 @@ section_menu: section-menu/contribute.html
>
> Mastering IntelliJ is, ultimately, your responsibility.
-## Enable Annotation Processing
+## Create a working Gradle module
-To configure annotation processing in IntelliJ:
+1. Create an empty IntelliJ project outside of the Beam source tree.
+2. Under Project Structure > Project, select a Project SDK.
+3. Under Project Structure > Modules, click the + sign to add a module and
+ select "Import Module".
+ 1. Select the directory containing the Beam source tree.
+ 2. Tick the "Import module from external model" button and select Gradle
+ from the list.
+ 3. Tick the following boxes.
+ * Create separate module per source set
+ * Store generated project files externally
+ * Use default gradle wrapper
+4. Delegate build actions to Gradle by going to Settings > Build, Execution,
+ Deployment > Build Tools > Gradle and checking "Delegate IDE build/run
+ actions to gradle".
-1. Open Annotation Processors Settings dialog box by going to Settings ->
- Build, Execution, Deployment -> Compiler -> Annotation Processors
-2. Select the following buttons:
- * "Enable annotation processing"
- * "Obtain processors from project classpath"
- * "Store generated sources relative to: _Module content root_"
-3. Set the generated source directories to be equal to the Maven directories:
- * Set "Production sources directory:" to
`target/generated-sources/annotations`
- * Set "Test sources directory:" to
`target/generated-test-sources/test-annotations`
-4. Click "OK"
+This should result in a working Gradle project. Build the project by executing
+the "build" task in the root Gradle module.
## Checkstyle
@@ -36,7 +41,7 @@ IntelliJ supports checkstyle within the IDE using the
Checkstyle-IDEA plugin.
1. Install the "Checkstyle-IDEA" plugin from the IntelliJ plugin repository
2. Configure the plugin by going to Settings -> Other Settings -> Checkstyle
-3. Set Checkstyle version to the same as in `/pom.xml` (e.g. 6.19)
+3. Set Checkstyle version to the same as in `/build_rules.gradle` (e.g. 8.7)
4. Set the "Scan Scope" to "Only Java sources (including tests)"
5. In the "Configuration File" pane, add a new configuration using the plus
icon:
1. Set the "Description" to "Beam"
diff --git a/src/contribute/maturity-model.md b/src/contribute/maturity-model.md
index 429b04abf..8f8cc040f 100644
--- a/src/contribute/maturity-model.md
+++ b/src/contribute/maturity-model.md
@@ -42,7 +42,7 @@ The following table summarizes project's self-assessment
against the Apache Matu
<tr>
<td><p>CD30</p></td>
<td><p>The code can be built in a reproducible way using widely
available standard tools.</p></td>
- <td><p><b>YES.</b> The project uses Apache Maven and can be built via <a
href="https://github.com/apache/beam/blob/master/README.md">the standard
“mvn install” on any platform</a>.</p></td>
+ <td><p><b>YES.</b> The project uses Gradle and can be built via <a
href="https://github.com/apache/beam/blob/master/README.md">the standard
“gradle build” on any platform</a>.</p></td>
</tr>
<tr>
<td><p>CD40</p></td>
diff --git a/src/contribute/runner-guide.md b/src/contribute/runner-guide.md
index 0302cd19e..3fdfbab5d 100644
--- a/src/contribute/runner-guide.md
+++ b/src/contribute/runner-guide.md
@@ -637,37 +637,23 @@ matching a `ParDo` where the `DoFn` uses state or timers,
etc.
The Beam Java SDK and Python SDK have suites of runner validation tests. The
configuration may evolve faster than this document, so check the configuration
of other Beam runners. But be aware that we have tests and you can use them
-very easily! To enable these tests in a Java-based runner using Maven, you
+very easily! To enable these tests in a Java-based runner using Gradle, you
scan the dependencies of the SDK for tests with the JUnit category
`ValidatesRunner`.
{:.no-toggle}
-```xml
-<plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-surefire-plugin</artifactId>
- <executions>
- <execution>
- <id>validates-runner-tests</id>
- <phase>integration-test</phase>
- <goals><goal>test</goal></goals>
- <configuration>
- <groups>org.apache.beam.sdk.testing.ValidatesRunner</groups>
- <dependenciesToScan>
- <dependency>org.apache.beam:beam-sdks-java-core</dependency>
- </dependenciesToScan>
- <systemPropertyVariables>
- <beamTestPipelineOptions>
- [
- "--runner=MyRunner",
- … misc test options …
- ]
- </beamTestPipelineOptions>
- </systemPropertyVariables>
- </configuration>
- </execution>
- </executions>
-</plugin>
+```
+task validatesRunner(type: Test) {
+ group = "Verification"
+ description = "Validates the runner"
+ def pipelineOptions = JsonOutput.toJson(["--runner=MyRunner", ... misc test
options ...])
+ systemProperty "beamTestPipelineOptions", pipelineOptions
+ classpath = configurations.validatesRunner
+ testClassesDirs =
files(project(":sdks:java:core").sourceSets.test.output.classesDirs)
+ useJUnit {
+ includeCategories 'org.apache.beam.sdk.testing.ValidatesRunner'
+ }
+}
```
Enable these tests in other languages is unexplored.
diff --git a/src/contribute/testing.md b/src/contribute/testing.md
index ed733f9ee..2dcc7fea3 100644
--- a/src/contribute/testing.md
+++ b/src/contribute/testing.md
@@ -161,7 +161,7 @@ details on those testing types.
</td>
<td>Correctness
</td>
- <td>E2E Test, <a
href="https://github.com/apache/beam/blob/master/runners/pom.xml#L47">@ValidatesRunner</a>
+ <td>E2E Test, @ValidatesRunner
</td>
<td><a
href="https://github.com/apache/beam/blob/master/examples/java/src/test/java/org/apache/beam/examples/WordCountIT.java#L78">WordCountIT</a>,
<a
href="https://github.com/apache/beam/blob/master/sdks/java/core/src/test/java/org/apache/beam/sdk/transforms/ParDoTest.java">ParDoTest</a>
</td>
@@ -319,33 +319,27 @@ desired configurations.
#### How to run Java NeedsRunner tests
-NeedsRunner is a category of tests that require a Beam runner. A subset of
these
-tests cannot be executed while building their corresponding modules because all
-runners depend on these modules (e.g. `sdks/java/core`) to be built. To break
-the circular dependency, these tests are executed after the Direct Runner is
-built.
-
-To run this subset of the NeedsRunner tests (requires Maven 3.3.1+):
+NeedsRunner is a category of tests that require a Beam runner. To run
+NeedsRunner tests:
```
-$ mvn -pl runners/direct-java -am install -DskipTests
-$ mvn -pl runners/direct-java surefire:test@validates-runner-tests
+$ ./gradlew :runners:direct-java:needsRunnerTests
```
To run a single NeedsRunner test use the `test` property, e.g.
```
-$ mvn -pl runners/direct-java surefire:test@validates-runner-tests
-Dtest=MapElementsTest#testMapBasic
+$ ./gradlew :runners:direct-java:needsRunnerTests --tests
org.apache.beam.sdk.transforms.MapElementsTest.testMapBasic
```
will run the `MapElementsTest.testMapBasic()` test.
-
NeedsRunner tests in modules that are not required to build runners (e.g.
-`sdks/java/io/jdbc`) can be executed with the `mvn test` command:
+`sdks/java/io/google-cloud-platform`) can be executed with the `gradle test`
+command:
```
-mvn -pl sdks/java/io/jdbc test -Dgroups=org.apache.beam.sdk.testing.NeedsRunner
+$ ./gradlew sdks:java:io:google-cloud-platform:test --tests
org.apache.beam.sdk.io.gcp.spanner.SpannerIOWriteTest
```
### ValidatesRunner
@@ -380,14 +374,13 @@ from the Beam examples, or custom-built pipelines, the
framework will provide
hooks during several pipeline lifecycle events, e.g., pipeline creation,
pipeline success, and pipeline failure, to allow verification of pipeline
state.
-The E2E testing framework is currently built to hook into the [Maven Failsafe
-Integration Test
-plugin](http://maven.apache.org/surefire/maven-failsafe-plugin/), which means
it
-is tightly integrated with the overall build process. Once it is determined how
-Python and other future languages will integrate into the overall build/test
-system (via Maven or otherwise) we will adjust this. The framework provides a
-wrapper around actual Beam pipelines, enabling those pipelines to be run in an
-environment which facilitates verification of pipeline results and details.
+The E2E testing framework is currently built to execute the tests in [PerfKit
+Benchmarker](https://github.com/GoogleCloudPlatform/PerfKitBenchmarker),
+invoked via Gradle tasks. Once it is determined how Python and other future
+languages will integrate into the overall build/test system (via Gradle or
+otherwise) we will adjust this. The framework provides a wrapper around actual
+Beam pipelines, enabling those pipelines to be run in an environment which
+facilitates verification of pipeline results and details.
Verifiers include:
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 89948)
Time Spent: 1h 50m (was: 1h 40m)
> Update contributors guide to discuss Gradle
> -------------------------------------------
>
> Key: BEAM-3252
> URL: https://issues.apache.org/jira/browse/BEAM-3252
> Project: Beam
> Issue Type: Sub-task
> Components: build-system, website
> Reporter: Luke Cwik
> Assignee: Daniel Oliveira
> Priority: Major
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)