diff --git a/README.md b/README.md index 57a9451f..12420c6b 100644 --- a/README.md +++ b/README.md @@ -76,7 +76,7 @@ ruler { ### Running the task -Once this is done, `analyzeBundle` tasks will be added for each of your app variants. Running this task will build the app and generate a HTML report, which you can use to analyze your app size. It will also generate a JSON report, in case you want to further process the data. +Once this is done, `analyzeBundle` tasks will be added for each of your app variants. Running this task will build the app and generate an HTML report, which you can use to analyze your app size. It will also generate a JSON report, in case you want to further process the data. ## Ownership @@ -133,7 +133,7 @@ The project is set up like a standard Gradle project. You can build it using `./ There is also a sample project, which shows the usage of the plugin. Because the way this sample project is set up, the initial build can fail if you bump the plugin version. To fix this, you have to publish the plugin to your local Maven repository by running `./gradlew publishToMavenLocal -PwithoutSample`. -When working on the frontend, you can start a development server by running `./gradlew browserRun`, which will show a report filled with dummy data to make development easier. +When working on the frontend, you can start a development server by running `./gradlew jsBrowserRun`, which will show a report filled with dummy data to make development easier. ## Compatibility diff --git a/ruler-frontend/build.gradle.kts b/ruler-frontend/build.gradle.kts index 2e08c3b8..d81b08dd 100644 --- a/ruler-frontend/build.gradle.kts +++ b/ruler-frontend/build.gradle.kts @@ -22,7 +22,7 @@ plugins { kotlin { js(IR) { browser { - commonWebpackConfig (Action { + commonWebpackConfig(Action { cssSupport { enabled.set(true) } diff --git a/ruler-gradle-plugin/src/main/kotlin/com/spotify/ruler/plugin/FileProvider.kt b/ruler-gradle-plugin/src/main/kotlin/com/spotify/ruler/plugin/FileProvider.kt index 1705eab0..e5886b93 100644 --- a/ruler-gradle-plugin/src/main/kotlin/com/spotify/ruler/plugin/FileProvider.kt +++ b/ruler-gradle-plugin/src/main/kotlin/com/spotify/ruler/plugin/FileProvider.kt @@ -1,3 +1,18 @@ +/* + * Copyright 2021 Spotify AB + * + * 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. + */ package com.spotify.ruler.plugin import com.android.build.api.artifact.SingleArtifact @@ -63,7 +78,7 @@ internal fun Project.getResourceMappingFile( variant: ApplicationVariant ): Provider { val defaultResourceMappingFile = project.objects.fileProperty() // Empty by default - @Suppress("SpellCheckingInspection") + val resourceMappingFilePath = when { hasDexGuard(project) -> "outputs/dexguard/mapping/bundle/${variant.name}/resourcefilenamemapping.txt" else -> return defaultResourceMappingFile // No DexGuard plugin -> use default empty file @@ -88,6 +103,5 @@ private fun hasDexGuard(project: Project): Boolean { /** Checks if the given [project] is using ProGuard for obfuscation, instead of R8. */ private fun hasProGuard(project: Project): Boolean { - @Suppress("SpellCheckingInspection") return project.pluginManager.hasPlugin("com.guardsquare.proguard") } diff --git a/sample/lib/src/main/res/layout/activity_lib.xml b/sample/lib/src/main/res/layout/activity_lib.xml index ba28dee2..77b1d2e8 100644 --- a/sample/lib/src/main/res/layout/activity_lib.xml +++ b/sample/lib/src/main/res/layout/activity_lib.xml @@ -21,7 +21,7 @@ android:layout_height="match_parent" android:paddingVertical="18dp" android:paddingHorizontal="12dp" - tools:context=".MainActivity"> + tools:context=".LibActivity">