Skip to content

Commit

Permalink
chore: added lint report (#636)
Browse files Browse the repository at this point in the history
* chore: added lint report

* chore: get rid of deprecation

* chore: change path

* chore: merging lint reports

* chore: upload merged file

* chore: fixed warnings
  • Loading branch information
kikoso authored Oct 16, 2024
1 parent 61b99c2 commit 2301f0b
Show file tree
Hide file tree
Showing 10 changed files with 79 additions and 6 deletions.
49 changes: 49 additions & 0 deletions .github/workflows/lint-report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Copyright 2024 Google LLC
#
# 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.

name: Lint and Upload SARIF

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
lint:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'adopt'
java-version: '17'

- name: Run Android Lint
run: ./gradlew lint

- name: Merge SARIF files
run: |
jq -s '{ "$schema": "https://json.schemastore.org/sarif-2.1.0", "version": "2.1.0", "runs": map(.runs) | add }' maps-compose/build/reports/lint-results.sarif maps-compose-utils/build/reports/lint-results.sarif maps-compose-widgets/build/reports/lint-results.sarif app/build/reports/lint-results.sarif > merged.sarif
- name: Upload SARIF file
uses: github/codeql-action/upload-sarif@v3
with:
sarif_file: merged.sarif
4 changes: 4 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ plugins {
}

android {
lint {
sarifOutput = file("$buildDir/reports/lint-results.sarif")
}

buildTypes {
getByName("debug") {
enableUnitTestCoverage = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package com.google.maps.android.compose.markerexamples


import android.R.drawable.ic_menu_myplaces
import android.annotation.SuppressLint
import android.graphics.Color
import android.os.Bundle
import android.util.Log
Expand Down Expand Up @@ -56,6 +57,7 @@ private val center = LatLng(-18.000, -58.000)
private val defaultCameraPosition1 = CameraPosition.fromLatLngZoom(center, 2f)
class AdvancedMarkersActivity : ComponentActivity(), OnMapsSdkInitializedCallback {

@SuppressLint("SetTextI18n")
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
MapsInitializer.initialize(applicationContext, MapsInitializer.Renderer.LATEST, this)
Expand Down
4 changes: 3 additions & 1 deletion app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
limitations under the License.
-->

<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<adaptive-icon xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
tools:ignore="MonochromeLauncherIcon">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
10 changes: 7 additions & 3 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
limitations under the License.
-->

<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
<adaptive-icon xmlns:tools="http://schemas.android.com/tools"
xmlns:android="http://schemas.android.com/apk/res/android"
tools:ignore="MonochromeLauncherIcon">
<background android:drawable="@drawable/ic_launcher_background"
tools:ignore="MonochromeLauncherIcon" />
<foreground android:drawable="@drawable/ic_launcher_foreground"
tools:ignore="MonochromeLauncherIcon" />
</adaptive-icon>
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[versions]
activitycompose = "1.9.2"
agp = "8.4.2"
agp = "8.7.1"
androidxtest = "1.6.1"
compose-bom = "2024.09.02"
dokka = "1.9.20"
Expand Down
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#Wed Oct 16 09:55:51 CEST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
4 changes: 4 additions & 0 deletions maps-compose-utils/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ plugins {
}

android {
lint {
sarifOutput = file("$buildDir/reports/lint-results.sarif")
}

namespace = "com.google.maps.android.compose.utils"
compileSdk = 34

Expand Down
4 changes: 4 additions & 0 deletions maps-compose-widgets/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ plugins {
}

android {
lint {
sarifOutput = file("$buildDir/reports/lint-results.sarif")
}

namespace = "com.google.maps.android.compose.widgets"
compileSdk = 34

Expand Down
3 changes: 3 additions & 0 deletions maps-compose/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ plugins {
}

android {
lint {
sarifOutput = file("$buildDir/reports/lint-results.sarif")
}

namespace = "com.google.maps.android.compose"
compileSdk = 34
Expand Down

0 comments on commit 2301f0b

Please sign in to comment.