Skip to content
This repository was archived by the owner on Jul 15, 2024. It is now read-only.

Commit 4c2649c

Browse files
chore: remove enable-samples profile (#582)
Source-Author: Neenu Shaji <Neenu1995@users.noreply.github.com> Source-Date: Mon Nov 22 11:22:11 2021 -0500 Source-Repo: googleapis/synthtool Source-Sha: 7a7c48f96e90d1cdc3ab0cc8293279fdcb10fd36 Source-Link: googleapis/synthtool@7a7c48f
1 parent 24c30e7 commit 4c2649c

File tree

3 files changed

+9
-57
lines changed

3 files changed

+9
-57
lines changed

.kokoro/build.sh

-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ samples)
9191

9292
pushd ${SAMPLES_DIR}
9393
mvn -B \
94-
-Penable-samples \
9594
-ntp \
9695
-DtrimStackTrace=false \
9796
-Dclirr.skip=true \

CONTRIBUTING.md

+7-54
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,12 @@ mvn -Penable-integration-tests clean verify
5353

5454
## Code Samples
5555

56-
Code Samples must be bundled in separate Maven modules, and guarded by a
57-
Maven profile with the name `enable-samples`.
56+
All code samples must be in compliance with the [java sample formatting guide][3].
57+
Code Samples must be bundled in separate Maven modules.
5858

5959
The samples must be separate from the primary project for a few reasons:
60-
1. Primary projects have a minimum Java version of Java 7 whereas samples have
61-
a minimum Java version of Java 8. Due to this we need the ability to
60+
1. Primary projects have a minimum Java version of Java 8 whereas samples can have
61+
Java version of Java 11. Due to this we need the ability to
6262
selectively exclude samples from a build run.
6363
2. Many code samples depend on external GCP services and need
6464
credentials to access the service.
@@ -68,39 +68,16 @@ The samples must be separate from the primary project for a few reasons:
6868
### Building
6969

7070
```bash
71-
mvn -Penable-samples clean verify
71+
mvn clean verify
7272
```
7373

7474
Some samples require access to GCP services and require a service account:
7575

7676
```bash
7777
export GOOGLE_APPLICATION_CREDENTIALS=/path/to/service/account.json
78-
mvn -Penable-samples clean verify
78+
mvn clean verify
7979
```
8080

81-
### Profile Config
82-
83-
1. To add samples in a profile to your Maven project, add the following to your
84-
`pom.xml`
85-
86-
```xml
87-
<project>
88-
[...]
89-
<profiles>
90-
<profile>
91-
<id>enable-samples</id>
92-
<modules>
93-
<module>sample</module>
94-
</modules>
95-
</profile>
96-
</profiles>
97-
[...]
98-
</project>
99-
```
100-
101-
2. [Activate](#profile-activation) the profile.
102-
3. Define your samples in a normal Maven project in the `samples/` directory.
103-
10481
### Code Formatting
10582

10683
Code in this repo is formatted with
@@ -110,30 +87,6 @@ To run formatting on your project, you can run:
11087
mvn com.coveo:fmt-maven-plugin:format
11188
```
11289

113-
### Profile Activation
114-
115-
To include code samples when building and testing the project, enable the
116-
`enable-samples` Maven profile.
117-
118-
#### Command line
119-
120-
To activate the Maven profile on the command line add `-Penable-samples` to your
121-
Maven command.
122-
123-
#### Maven `settings.xml`
124-
125-
To activate the Maven profile in your `~/.m2/settings.xml` add an entry of
126-
`enable-samples` following the instructions in [Active Profiles][2].
127-
128-
This method has the benefit of applying to all projects you build (and is
129-
respected by IntelliJ IDEA) and is recommended if you are going to be
130-
contributing samples to several projects.
131-
132-
#### IntelliJ IDEA
133-
134-
To activate the Maven Profile inside IntelliJ IDEA, follow the instructions in
135-
[Activate Maven profiles][3] to activate `enable-samples`.
136-
13790
[1]: https://cloud.google.com/docs/authentication/getting-started#creating_a_service_account
13891
[2]: https://maven.apache.org/settings.html#Active_Profiles
139-
[3]: https://www.jetbrains.com/help/idea/work-with-maven-profiles.html#activate_maven_profiles
92+
[3]: https://github.com/GoogleCloudPlatform/java-docs-samples/blob/main/SAMPLE_FORMAT.md

synth.metadata

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"git": {
55
"name": ".",
66
"remote": "https://github.com/googleapis/java-compute.git",
7-
"sha": "8c2e39c36f81e5238538b1471dd16d942c5e8da6"
7+
"sha": "24c30e78d36140f0442209ad4b02e1b6c3917379"
88
}
99
},
1010
{
@@ -18,7 +18,7 @@
1818
"git": {
1919
"name": "synthtool",
2020
"remote": "https://github.com/googleapis/synthtool.git",
21-
"sha": "42a3786737c17ece39924d7025f3be481812da53"
21+
"sha": "7a7c48f96e90d1cdc3ab0cc8293279fdcb10fd36"
2222
}
2323
}
2424
],

0 commit comments

Comments
 (0)