Skip to content
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

Various updates and modernizations #47

Merged
merged 6 commits into from
Sep 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions .github/workflows/gradle-build.yml

This file was deleted.

10 changes: 0 additions & 10 deletions .github/workflows/gradle-wrapper-validation.yml

This file was deleted.

33 changes: 33 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Main CI
on: [ push ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
spotless:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Run Spotless
run: ./gradlew spotlessCheck

build:
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
- name: Setup Android problem matchers
uses: jonasb/android-problem-matchers-action@v1
- name: Build with Gradle
run: ./gradlew build
33 changes: 33 additions & 0 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Security
on: [push]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
mobfs:
permissions:
contents: read # for actions/checkout to fetch code
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Run mobsfscan
uses: MobSF/[email protected]
with:
args: . --sarif --output results.sarif || true
- name: Upload mobsfscan report
uses: github/codeql-action/upload-sarif@v2
with:
sarif_file: results.sarif

gradle-validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1
9 changes: 9 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions .idea/deploymentTargetSelector.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions .idea/runConfigurations.xml

This file was deleted.

3 changes: 3 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ buildscript {
google()
}
dependencies {
classpath("com.android.tools.build:gradle:4.1.1")
classpath("com.android.tools.build:gradle:8.5.2")
}
}

plugins {
id("com.diffplug.spotless") version "5.12.4"
id("com.github.ben-manes.versions") version "0.38.0"
kotlin("jvm") version "1.5.0"
kotlin("jvm") version "1.6.20"
}

repositories {
Expand Down
32 changes: 0 additions & 32 deletions buildSrc/build.gradle.kts

This file was deleted.

Binary file removed buildSrc/src/main/kotlin/Secrets.kt.enc
Binary file not shown.
9 changes: 4 additions & 5 deletions customtabs-example/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@ repositories {
}

android {
compileSdkVersion(29)
namespace = "com.example.saschpe.customtabs"

defaultConfig {
applicationId = "com.example.saschpe.customtabs"
minSdkVersion(17)
targetSdkVersion(29)
compileSdk = 33
minSdk = 17
targetSdk = 33
versionCode = 170030003
versionName = "3.0.3"
base.archivesBaseName = "$applicationId-$versionName"
Expand All @@ -54,8 +55,6 @@ android {
}

kotlinOptions.jvmTarget = "1.8"

sourceSets.forEach { it.java.srcDir("src/${it.name}/kotlin") }
}

dependencies {
Expand Down
6 changes: 3 additions & 3 deletions customtabs-example/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
~ limitations under the License.
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.saschpe.customtabs">
xmlns:tools="http://schemas.android.com/tools">

<application
android:name=".Application"
Expand All @@ -29,6 +28,7 @@

<activity
android:name=".activity.MainActivity"
android:exported="true"
android:theme="@style/AppTheme.NoActionBar">

<intent-filter>
Expand All @@ -40,4 +40,4 @@

</application>

</manifest>
</manifest>
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import androidx.appcompat.app.AppCompatDelegate
import saschpe.android.customtabs.CustomTabsActivityLifecycleCallbacks

/**
* Optional pre-loading for improved performance
* Optional preloading for improved performance
*/
class Application : android.app.Application() {
override fun onCreate() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ import saschpe.android.customtabs.WebViewFallback

class MainActivity : AppCompatActivity() {
/**
* Apply some sane defaults across a single app.
* Apply some sensible defaults across a single app.
* Not strictly necessary but simplifies code when having many different
* custom tab intents in one app.
*
Expand All @@ -62,7 +62,7 @@ class MainActivity : AppCompatActivity() {
}

/**
* Start GitHub project custom tab
* Start a GitHub project custom tab
*
* See https://developer.chrome.com/multidevice/android/customtabs
*/
Expand Down
28 changes: 15 additions & 13 deletions customtabs/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,16 @@ repositories {
}

android {
compileSdkVersion(29)
namespace = "saschpe.android.customtabs"

defaultConfig {
minSdkVersion(16)
targetSdkVersion(29)
versionName = "3.0.3"
compileSdk = 33
minSdk = 16
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
named("release") {
release {
isMinifyEnabled = true
proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro")
}
Expand All @@ -61,7 +60,7 @@ dependencies {

testImplementation("androidx.test:core:1.3.0")
testImplementation("androidx.test.ext:junit:1.1.2")
testImplementation("org.robolectric:robolectric:4.5.1")
testImplementation("org.robolectric:robolectric:4.7.1")
testImplementation("org.mockito:mockito-core:3.9.0")
}

Expand All @@ -85,6 +84,7 @@ publishing {
publications {
register<MavenPublication>("mavenAndroid") {
artifactId = "android-customtabs"
version = "3.0.3"

afterEvaluate { artifact(tasks.getByName("bundleReleaseAar")) }
artifact(tasks.getByName("javadocJar"))
Expand Down Expand Up @@ -139,14 +139,16 @@ publishing {
}
}

repositories {
maven {
name = "sonatype"
credentials {
username = Secrets.Sonatype.user
password = Secrets.Sonatype.apiKey
if (hasProperty("sonatypeUser") && hasProperty("sonatypePass")) {
repositories {
maven {
name = "sonatype"
credentials {
username = property("sonatypeUser") as String
password = property("sonatypePass") as String
}
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2")
}
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2")
}
}
}
Expand Down
Loading
Loading