Skip to content

ci: installing google-play-services artifact for Windows #1706

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Feb 12, 2021
Merged
20 changes: 19 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,30 @@ jobs:
windows:
runs-on: windows-latest
steps:
- name: git configuration to avoid automatic CRLF conversion
run: |
git config --global core.autocrlf false
git config --global core.eol lf
Comment on lines +30 to +33
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This avoids the error below:

[INFO] --- maven-checkstyle-plugin:3.1.2:check (default) @ google-api-client ---
[INFO] Starting audit...
Error:  D:\a\google-api-java-client\google-api-java-client\google-api-client\src\main\java\com\google\api
\client\googleapis\apache\GoogleApacheHttpTransport.java:1: Expected line ending for file
 is LF(\n), but CRLF(\r\n) is detected. [NewlineAtEndOfFile]
Error:  D:\a\google-api-java-client\google-api-java-client\google-api-client\src\main\java\com\google\api
\client\googleapis\apache\package-info.java:1: Expected line ending for file is LF(\n), but
 CRLF(\r\n) is detected. [NewlineAtEndOfFile]
Error:  D:\a\google-api-java-client\google-api-java-client\google-api-client\src\main\java\com\google\api
\client\googleapis\apache\v2\GoogleApacheHttpTransport.java:1: Expected line ending for file is LF(\n), but CRLF(\r\n) is detected. [NewlineAtEndOfFile]

- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 8
- run: java -version
- run: .kokoro/build.bat
- name: Install google-play-services artifact
shell: bash
run: |
mkdir play-services
cd play-services
curl --output play-services-basement-8.3.0.aar https://dl.google.com/dl/android/maven2/com/google/android/gms/play-services-basement/8.3.0/play-services-basement-8.3.0.aar
unzip play-services-basement-8.3.0.aar
mvn install:install-file \
-Dfile=classes.jar \
-DgroupId=com.google.android.google-play-services \
-DartifactId=google-play-services \
-Dversion=1 \
-Dpackaging=jar
- run: .kokoro/build.sh
shell: bash
Comment on lines +40 to +53
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows has bash.

env:
JOB_TYPE: test
dependencies:
Expand Down
9 changes: 2 additions & 7 deletions checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,8 @@
"http://www.puppycrawl.com/dtds/suppressions_1_0.dtd">

<suppressions>

<suppress checks="LineLength" files="com/google/api/client/googleapis/apache/GoogleApacheHttpTransport.java"/>
<suppress checks="LineLength" files="com/google/api/client/googleapis/extensions/appengine/notifications/AppEngineNotificationServlet.java"/>
<suppress checks="LineLength" files="com/google/api/client/googleapis/extensions/appengine/subscriptions/package-info.java"/>
<suppress checks="LineLength" files="com/google/api/client/googleapis/extensions/servlet/notifications/NotificationServlet.java"/>
<suppress checks="LineLength" files="com/google/api/client/googleapis/javanet/GoogleNetHttpTransport.java"/>
<suppress checks="LineLength" files="com/google/api/client/googleapis/subscriptions/NotificationHeaders.java"/>
Comment on lines -8 to -13
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Files that no longer violates the line length have been removed.

<suppress checks="LineLength" files="com[/\\]google[/\\]api[/\\]client[/\\]googleapis[/\\]extensions[/\\]appengine[/\\]notifications[/\\]AppEngineNotificationServlet.java"/>
<suppress checks="LineLength" files="com[/\\]google[/\\]api[/\\]client[/\\]googleapis[/\\]extensions[/\\]servlet[/\\]notifications[/\\]NotificationServlet.java"/>
Comment on lines +7 to +8
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to add forward slash and back slash to make it work for both Windows and Unix filesystem.


<!-- Don't check JavaDoc on package-info. -->
<suppress checks="JavadocStyleCheck" files="package-info.java"/>
Expand Down
36 changes: 16 additions & 20 deletions checkstyle.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,8 @@ page at http://checkstyle.sourceforge.net/config.html -->
<module name="JavadocMethod">
<property name="scope" value="protected"/>
<property name="severity" value="warning"/>
<property name="allowMissingJavadoc" value="true"/>
<property name="allowMissingParamTags" value="true"/>
<property name="allowMissingReturnTag" value="true"/>
<property name="allowMissingThrowsTags" value="true"/>
<property name="allowThrowsTagsForSubclasses" value="true"/>
<property name="allowUndeclaredRTE" value="true"/>
</module>
Comment on lines -75 to 77
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removed properties are no longer supported in newer version of checkstyle.


<module name="JavadocType">
Expand Down Expand Up @@ -183,22 +179,6 @@ page at http://checkstyle.sourceforge.net/config.html -->

-->

<module name="LineLength">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The LineLength's parent has to be "Check" element in the newer checkstyle.

<!-- Checks if a line is too long. -->
<property name="max" value="${com.puppycrawl.tools.checkstyle.checks.sizes.LineLength.max}" default="100"/>
<property name="severity" value="error"/>

<!--
The default ignore pattern exempts the following elements:
- import statements
- long URLs inside comments
-->

<property name="ignorePattern"
value="${com.puppycrawl.tools.checkstyle.checks.sizes.LineLength.ignorePattern}"
default="^(package .*;\s*)|(import .*;\s*)|( *(\*|//).*https?://.*)$"/>
</module>

<module name="LeftCurly">
<!-- Checks for placement of the left curly brace ('{'). -->
<property name="severity" value="warning"/>
Expand Down Expand Up @@ -316,7 +296,23 @@ page at http://checkstyle.sourceforge.net/config.html -->
-->
<property name="severity" value="warning"/>
</module>
</module>


<module name="LineLength">
<!-- Checks if a line is too long. -->
<property name="max" value="${com.puppycrawl.tools.checkstyle.checks.sizes.LineLength.max}" default="100"/>
<property name="severity" value="error"/>

<!--
The default ignore pattern exempts the following elements:
- import statements
- long URLs inside comments
-->

<property name="ignorePattern"
value="${com.puppycrawl.tools.checkstyle.checks.sizes.LineLength.ignorePattern}"
default="^(package .*;\s*)|(import .*;\s*)|( *(\*|//).*https?://.*)$"/>
</module>
</module>

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>8.23</version>
<version>8.39</version>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the version google-cloud-shared-config 0.10.0 uses.

</dependency>
</dependencies>
<configuration>
Expand Down