Skip to content

Commit 9315c4d

Browse files
committed
Merge pull request #10 from GoogleCloudPlatform/java-repo-tools-update-from-java-docs-samples
Java repo tools update from java docs samples
2 parents f8e7856 + bbaa0fc commit 9315c4d

File tree

4 files changed

+82
-33
lines changed

4 files changed

+82
-33
lines changed

README.md

+6-5
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,14 @@ Pull Request as you would in the normal flow.
137137
What if you make changes in your repository and now want to push them upstream?
138138

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

144144
```
145-
git checkout java-repo-tools
146-
git cherry-pick -x --strategy=subtree my-main-branch
145+
git subtree split --prefix=java-repo-tools -b java-repo-tools-update-from-java-docs-samples
146+
git checkout java-repo-tools-update-from-java-docs-samples
147+
git push java-repo-tools java-repo-tools-update-from-java-docs-samples
147148
```
148149

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

google-checks.xml

+5-2
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

+19-26
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

+52
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)