Skip to content

Commit

Permalink
Merge pull request #10 from GoogleCloudPlatform/java-repo-tools-updat…
Browse files Browse the repository at this point in the history
…e-from-java-docs-samples

Java repo tools update from java docs samples
  • Loading branch information
tswast committed May 2, 2016
2 parents f8e7856 + bbaa0fc commit 9315c4d
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 33 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,13 +137,14 @@ Pull Request as you would in the normal flow.
What if you make changes in your repository and now want to push them upstream?

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

```
git checkout java-repo-tools
git cherry-pick -x --strategy=subtree my-main-branch
git subtree split --prefix=java-repo-tools -b java-repo-tools-update-from-java-docs-samples
git checkout java-repo-tools-update-from-java-docs-samples
git push java-repo-tools java-repo-tools-update-from-java-docs-samples
```

After you have committed all the changes you want to your `java-repo-tools`
Expand Down
7 changes: 5 additions & 2 deletions google-checks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@
value="Member name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="ParameterName">
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
<message key="name.invalidPattern"
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
</module>
<module name="LocalVariableName">
<property name="tokens" value="VARIABLE_DEF"/>
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
<property name="format" value="^[a-z][a-zA-Z0-9]*$"/>
<property name="allowOneCharVarInForLoop" value="true"/>
<message key="name.invalidPattern"
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
Expand Down Expand Up @@ -213,8 +213,11 @@
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="expected"/>
</module>
<module name="FileContentsHolder"/>
</module>

<!-- Allow silencing rules with annotations http://stackoverflow.com/a/22556386/101923 -->
<module name="SuppressWarningsFilter" />
<!-- Allow silencing with comment http://stackoverflow.com/questions/4023185 -->
<module name="SuppressionCommentFilter" />
</module>
45 changes: 19 additions & 26 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,32 +75,25 @@ limitations under the License.
<execution><goals><goal>check</goal></goals></execution>
</executions>
</plugin>
<plugin>
<groupId>org.eluder.coveralls</groupId>
<artifactId>coveralls-maven-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<coberturaReports>
<coberturaReport>${basedir}/target/coverage.xml</coberturaReport>
</coberturaReports>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.6</version>
<configuration>
<outputDirectory>${basedir}/target</outputDirectory>
<formats>
<format>xml</format>
<format>html</format>
</formats>
<format>xml</format>
<maxmem>256m</maxmem>
<!-- aggregated reports for multi-module projects -->
<aggregate>true</aggregate>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.6.201602180812</version>
<executions>
<execution>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
52 changes: 52 additions & 0 deletions test-devserver.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/env bash
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Usage:
# test-devserver.sh path/to/project
#
# This script runs the local appengine:devserver Maven plugin and verifies that
# a request to http://localhost:8080/ does not return an error code.
#
# As an example, this is useful for verifying that datastore-indexes.xml is
# correct (only if autoGenerate=false and the / handler does all queries used),
# as an example.

set -e
set -x

if [ -z "$1" ]; then
echo "Missing directory parameter."
echo "Usage:"
echo " $0 path/to/project"
exit 1
fi

(
cd "$1"
expect -c '
spawn mvn --batch-mode clean appengine:devserver -DskipTests
set timeout 600
expect localhost:8080
sleep 10
spawn curl --silent --output /dev/stderr --write-out "%{http_code}" http://localhost:8080/
expect {
"200" {
exit
}
}
exit 1
'
)

0 comments on commit 9315c4d

Please sign in to comment.