Skip to content

Commit

Permalink
Merge pull request #5 from google/chris/github_config
Browse files Browse the repository at this point in the history
Adding GitHub action test workflow.
  • Loading branch information
arriolac authored Jan 26, 2021
2 parents 007c791 + d2834b1 commit 55323e4
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 25 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Copyright 2021 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.

# A workflow that runs tests on every new pull request
name: Tests

on:
repository_dispatch:
types: [test]
pull_request:
branches: ['*']
workflow_dispatch:

jobs:
run-unit-test:
runs-on: ubuntu-latest

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout Repo
uses: actions/checkout@v2

- name: Run tests
run: |
echo "Running unit tests"
./gradlew :plugin:build check test -x lint --stacktrace
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Secrets Gradle Plugin for Android
![Tests](https://github.com/google/secrets-gradle-plugin/workflows/Tests/badge.svg)
![Apache-2.0](https://img.shields.io/badge/license-Apache-blue)

A Gradle plugin for providing your secrets securely to your Android project.

Expand All @@ -16,14 +18,14 @@ In your app-level `build.gradle` file:
Groovy:
```groovy
plugins {
id 'com.google.secrets_plugin' version '0.1'
id 'com.google.secrets_gradle_plugin' version '0.1'
}
```

Kotlin:
```groovy
plugins {
id("com.google.secrets_plugin") version "0.1"
id("com.google.secrets_gradle_plugin") version "0.1"
}
```

Expand Down
10 changes: 5 additions & 5 deletions plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ gradlePlugin {
}

pluginBundle {
website = "https://github.com/google/secrets-plugin"
vcsUrl = "https://github.com/google/secrets-plugin"
website = "https://github.com/google/secrets-gradle-plugin"
vcsUrl = "https://github.com/google/secrets-gradle-plugin"
description = "A Gradle plugin for providing secrets securely to an Android project."
version = PluginInfo.version

Expand All @@ -70,8 +70,8 @@ publishing {

object PluginInfo {
const val group = "com.google"
const val artifactId = "secrets_plugin"
const val name = "secretsPlugin"
const val artifactId = "secrets_gradle_plugin"
const val name = "secretsGradlePlugin"
const val version = "0.1"
const val implementationClass = "com.google.secrets_plugin.SecretsPlugin"
const val implementationClass = "com.google.secrets_gradle_plugin.SecretsPlugin"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.secrets_plugin
package com.google.secrets_gradle_plugin

import com.android.build.gradle.AppExtension
import com.android.build.gradle.api.ApplicationVariant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.secrets_plugin
package com.google.secrets_gradle_plugin

import org.gradle.api.Plugin
import org.gradle.api.Project
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.secrets_plugin
package com.google.secrets_gradle_plugin

/**
* Configuration object for [SecretsPlugin].
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.secrets_plugin
package com.google.secrets_gradle_plugin

import com.android.build.gradle.api.ApplicationVariant
import com.android.build.gradle.internal.core.InternalBaseVariant
Expand Down Expand Up @@ -58,7 +58,7 @@ class SecretsPluginTest {
variant = mock() {
on { mergedFlavor } doReturn flavor
}
project.pluginManager.apply("com.google.secrets_plugin")
project.pluginManager.apply("com.google.secrets_gradle_plugin")
}

@Test(expected = ProjectConfigurationException::class)
Expand Down
20 changes: 10 additions & 10 deletions sample-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ plugins {
id("kotlin-android")

// 1. Include the plugin
id("com.google.secrets_plugin") version "0.1"
// id("com.google.secrets_gradle_plugin") version "0.1"
}

android {
Expand All @@ -44,12 +44,12 @@ dependencies {
}

// 2. Optionally configure the plugin
secrets {
// Optionally specify a different file name containing your secrets.
// The plugin defaults to "local.properties"
propertiesFileName = "secrets.properties"

// Add keys that the plugin should ignore from the properties file
ignoreList.add("keyToIgnore")
ignoreList.add("ignore*")
}
//secrets {
// // Optionally specify a different file name containing your secrets.
// // The plugin defaults to "local.properties"
// propertiesFileName = "secrets.properties"
//
// // Add keys that the plugin should ignore from the properties file
// ignoreList.add("keyToIgnore")
// ignoreList.add("ignore*")
//}
4 changes: 2 additions & 2 deletions sample-app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
android:theme="@style/Theme.MyApplication">
<meta-data
android:name="com.google.android.geo.API_KEY"
android:value="${gmpApiKey}" />
android:value="gmpApiKey" />
<activity
android:name=".MainActivity"
android:name="com.google.secrets_gradle_plugin.sample.MainActivity"
android:label="@string/app_name"
android:theme="@style/Theme.MyApplication.NoActionBar">
<intent-filter>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.secrets_plugin.sample
package com.google.secrets_gradle_plugin.sample

import androidx.appcompat.app.AppCompatActivity

Expand Down

0 comments on commit 55323e4

Please sign in to comment.