Skip to content

Commit 0c5790f

Browse files
author
Stu Hood
authored
Fix a broken 3rdparty example. (#5797)
Fix an example that was using a broken include, and use explicit comments to ensure it doesn't break again.
1 parent d0f9118 commit 0c5790f

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed
+2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Copyright 2015 Pants project contributors (see CONTRIBUTORS.md).
22
# Licensed under the Apache License, Version 2.0 (see LICENSE).
33

4+
# DOCSTART: This target is included in documentation.
45
jar_library(
56
jars=[
67
jar(org='com.google.auto.value', name='auto-value', rev='1.1'),
78
],
89
# Is used as an annotation processor.
910
scope='compile',
1011
)
12+
# DOCEND

examples/src/java/org/pantsbuild/example/3rdparty_jvm.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ may make sense to organize them in multiple subdirectories, say by category or b
2121
In the appropriate `BUILD` file, you create a <a pantsref="bdict_jar_library">`jar_library`</a>
2222
referencing the <a pantsref="bdict_jar">`jar`</a>s you want:
2323

24-
!inc[start-at=junit&end-before=scalatest](../../../../../../3rdparty/BUILD)
24+
!inc[start-after=DOCSTART&end-before=DOCEND](../../../../../../3rdparty/jvm/com/google/auto/value/BUILD)
2525

2626
Here, the <a pantsref="bdict_jar_library">`jar_library`</a>'s name
2727
defines a target address that other build targets can refer to. The
@@ -37,12 +37,13 @@ statements in your Java code.
3737

3838
For example, your `BUILD` file might have
3939

40-
!inc[start-after=junit_tests&end-before=src/java](../../../../../tests/java/org/pantsbuild/example/hello/greet/BUILD)
40+
!inc[start-after=DOCSTART&end-before=DOCEND](../../../../../src/java/org/pantsbuild/example/autovalue/BUILD)
4141

4242
And your Java code might have:
4343

4444
:::java
45-
import org.junit.Test;
45+
import com.google.auto.value.AutoValue;
46+
4647

4748
"Round Trip" Dependencies
4849
-------------------------

examples/src/java/org/pantsbuild/example/autovalue/BUILD

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ jvm_binary(
88
],
99
)
1010

11+
# DOCSTART: This target is included in documentation.
1112
java_library(name='autovalue-lib',
12-
sources = globs('*'),
1313
dependencies = [
1414
'3rdparty/jvm/com/google/auto/value',
1515
],
1616
)
17+
# DOCEND

0 commit comments

Comments
 (0)