Skip to content

Commit 90a280d

Browse files
committed
Merge branch 'master' of github.com:GoogleCloudPlatform/java-repo-tools into tswast-update-java-repo-tools
1 parent f89ed2e commit 90a280d

File tree

4 files changed

+90
-54
lines changed

4 files changed

+90
-54
lines changed

README.md

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,34 +27,21 @@ git remote add java-repo-tools git@github.com:GoogleCloudPlatform/java-repo-tool
2727
git fetch java-repo-tools master
2828
```
2929

30-
To make it easier to push changes back upstream, create a new branch.
31-
32-
```
33-
git checkout -b java-repo-tools java-repo-tools/master
34-
```
35-
3630
We can then go back to the `my-java-samples` code and prepare a Pull Request to
37-
add the `java-repo-tools` code in a subtree.
38-
39-
```
40-
git checkout master
41-
# Making a new branch ia optional, but recommended to send a pull request to
42-
# start using java-repo-tools.
43-
git checkout -b use-java-repo-tools
44-
```
45-
46-
So that we can pull future updates from the `java-repo-tools` repository, we
47-
merge histories. This way we won't get unnecessary conflicts when pulling changes
48-
in.
31+
add the `java-repo-tools` code in a subtree. Making a new branch is optional, but
32+
recommended so that you can more easily send a pull request to start using
33+
`java-repo-tools`.
4934

5035
```
51-
git merge -s ours --no-commit java-repo-tools/master
36+
git checkout -b use-java-repo-tools origin/master
5237
```
5338

54-
Finally, read the `java-repo-tools` into a subtree.
39+
Finally, read the `java-repo-tools` into a subtree. So that you can pull future
40+
updates from the `java-repo-tools` repository, this command will merge histories.
41+
This way prevents unnecessary conflicts when pulling changes in.
5542

5643
```
57-
git read-tree --prefix=java-repo-tools/ -u java-repo-tools
44+
git subtree add --prefix=java-repo-tools java-repo-tools master
5845
```
5946

6047
Now all the content of `java-repo-tools` will be in the `java-repo-tools/`
@@ -143,13 +130,14 @@ Pull Request as you would in the normal flow.
143130
What if you make changes in your repository and now want to push them upstream?
144131

145132
Assuming you just commited changes in the `java-repo-tools/` directory of your
146-
`my-main-branch`, to merge the changes into the local `java-repo-tools` branch,
147-
we need to cherry pick this commit using the subtree strategy. It will ignore
148-
any changes to file not in the `java-repo-tools/` directory.
133+
`my-main-branch`, to split the `java-repo-tools` changes into their own branch.
134+
The first time using the `subtree` command, we may need to use the `--rejoin`
135+
argument.
149136

150137
```
151-
git checkout java-repo-tools
152-
git cherry-pick -x --strategy=subtree my-main-branch
138+
git subtree split --prefix=java-repo-tools -b java-repo-tools-update-from-java-docs-samples
139+
git checkout java-repo-tools-update-from-java-docs-samples
140+
git push java-repo-tools java-repo-tools-update-from-java-docs-samples
153141
```
154142

155143
After you have committed all the changes you want to your `java-repo-tools`

google-checks.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,13 +121,13 @@
121121
value="Member name ''{0}'' must match pattern ''{1}''."/>
122122
</module>
123123
<module name="ParameterName">
124-
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
124+
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
125125
<message key="name.invalidPattern"
126126
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
127127
</module>
128128
<module name="LocalVariableName">
129129
<property name="tokens" value="VARIABLE_DEF"/>
130-
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
130+
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
131131
<property name="allowOneCharVarInForLoop" value="true"/>
132132
<message key="name.invalidPattern"
133133
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
@@ -213,8 +213,11 @@
213213
<module name="EmptyCatchBlock">
214214
<property name="exceptionVariableName" value="expected"/>
215215
</module>
216+
<module name="FileContentsHolder"/>
216217
</module>
217218

218219
<!-- Allow silencing rules with annotations http://stackoverflow.com/a/22556386/101923 -->
219220
<module name="SuppressWarningsFilter" />
221+
<!-- Allow silencing with comment http://stackoverflow.com/questions/4023185 -->
222+
<module name="SuppressionCommentFilter" />
220223
</module>

pom.xml

Lines changed: 19 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -75,32 +75,25 @@ limitations under the License.
7575
<execution><goals><goal>check</goal></goals></execution>
7676
</executions>
7777
</plugin>
78-
<plugin>
79-
<groupId>org.eluder.coveralls</groupId>
80-
<artifactId>coveralls-maven-plugin</artifactId>
81-
<version>3.1.0</version>
82-
<configuration>
83-
<coberturaReports>
84-
<coberturaReport>${basedir}/target/coverage.xml</coberturaReport>
85-
</coberturaReports>
86-
</configuration>
87-
</plugin>
88-
<plugin>
89-
<groupId>org.codehaus.mojo</groupId>
90-
<artifactId>cobertura-maven-plugin</artifactId>
91-
<version>2.6</version>
92-
<configuration>
93-
<outputDirectory>${basedir}/target</outputDirectory>
94-
<formats>
95-
<format>xml</format>
96-
<format>html</format>
97-
</formats>
98-
<format>xml</format>
99-
<maxmem>256m</maxmem>
100-
<!-- aggregated reports for multi-module projects -->
101-
<aggregate>true</aggregate>
102-
</configuration>
103-
</plugin>
78+
<plugin>
79+
<groupId>org.jacoco</groupId>
80+
<artifactId>jacoco-maven-plugin</artifactId>
81+
<version>0.7.6.201602180812</version>
82+
<executions>
83+
<execution>
84+
<goals>
85+
<goal>prepare-agent</goal>
86+
</goals>
87+
</execution>
88+
<execution>
89+
<id>report</id>
90+
<phase>test</phase>
91+
<goals>
92+
<goal>report</goal>
93+
</goals>
94+
</execution>
95+
</executions>
96+
</plugin>
10497
</plugins>
10598
</build>
10699
</project>

test-devserver.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env bash
2+
# Copyright 2016 Google Inc. All Rights Reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
# Usage:
17+
# test-devserver.sh path/to/project
18+
#
19+
# This script runs the local appengine:devserver Maven plugin and verifies that
20+
# a request to http://localhost:8080/ does not return an error code.
21+
#
22+
# As an example, this is useful for verifying that datastore-indexes.xml is
23+
# correct (only if autoGenerate=false and the / handler does all queries used),
24+
# as an example.
25+
26+
set -e
27+
set -x
28+
29+
if [ -z "$1" ]; then
30+
echo "Missing directory parameter."
31+
echo "Usage:"
32+
echo " $0 path/to/project"
33+
exit 1
34+
fi
35+
36+
(
37+
cd "$1"
38+
expect -c '
39+
spawn mvn --batch-mode clean appengine:devserver -DskipTests
40+
set timeout 600
41+
expect localhost:8080
42+
sleep 10
43+
spawn curl --silent --output /dev/stderr --write-out "%{http_code}" http://localhost:8080/
44+
expect {
45+
"200" {
46+
exit
47+
}
48+
}
49+
exit 1
50+
'
51+
)
52+

0 commit comments

Comments
 (0)