Skip to content

Commit

Permalink
Merge pull request #183 from stytchauth/jordan/k2
Browse files Browse the repository at this point in the history
Version updates and testing with K2 enabled
  • Loading branch information
jhaven-stytch authored Jan 13, 2025
2 parents 25edd3a + b35e9d6 commit d351413
Show file tree
Hide file tree
Showing 41 changed files with 922 additions and 865 deletions.
13 changes: 6 additions & 7 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -68,17 +68,16 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v2
#uses: github/codeql-action/autobuild@v3

# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh
run: |
echo "Run, Build Application using script"
./gradlew --no-daemon assemble
env:
STYTCH_PUBLIC_TOKEN: 'abc123'
GOOGLE_OAUTH_CLIENT_ID: 'abc123'
Expand All @@ -88,6 +87,6 @@ jobs:
UI_GOOGLE_CLIENT_ID: 'abc123'

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
132 changes: 0 additions & 132 deletions build.gradle

This file was deleted.

121 changes: 121 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
import java.util.Properties

buildscript {
dependencies {
classpath(libs.gradle)
classpath(libs.kotlin.gradle.plugin)
classpath(libs.dokka.gradle.plugin)
classpath(libs.versioning.plugin)
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files

constraints {
// Force upgrades of AGP dependencies
classpath(libs.commonsCompress)
classpath(libs.jose4j)
classpath(libs.netty.handler)
classpath(libs.netty.handler.proxy)
classpath(libs.netty.codec.http)
classpath(libs.netty.codec.http2)
classpath(libs.bcpkix.jdk18on)
classpath(libs.jimfs)
classpath(libs.grpcNetty)
classpath(libs.guava)
}
}
}

plugins {
alias(libs.plugins.nexusPublishPlugin) apply (true)
alias(libs.plugins.ktlint)
alias(libs.plugins.detekt)
alias(libs.plugins.dokka)
alias(libs.plugins.androidLibrary) apply (false)
alias(libs.plugins.androidApplication) apply (false)
alias(libs.plugins.kotlinPluginCompose) apply (false)
alias(libs.plugins.hilt.android) apply (false)
alias(libs.plugins.ksp) apply (false)
}

apply("$rootDir/scripts/publish-root.gradle")

subprojects {
tasks.withType<Javadoc>().all { enabled = false }
apply(
plugin =
rootProject.libs.plugins.ktlint
.get()
.pluginId,
)
apply(
plugin =
rootProject.libs.plugins.detekt
.get()
.pluginId,
)
}

allprojects {
repositories {
google()
mavenCentral()
}
// Optionally configure plugin
ktlint {
android = true
version = "1.2.1"
}
configurations.all {
resolutionStrategy {
force(rootProject.libs.woodstox)
force(rootProject.libs.grpcNetty)
force(rootProject.libs.guava)
force(rootProject.libs.netty.codec.http)
}
}
}

tasks.register<Delete>("clean") {
delete(rootProject.layout.buildDirectory)
}

tasks.register("runOnGitHub") {
dependsOn(
":source:sdk:lint",
":source:sdk:ktlintCheck",
":source:sdk:testDebugUnitTest",
)
group = "custom"
description = "\$ ./gradlew runOnGitHub # runs on GitHub Action"
}

tasks.dokkaHtmlMultiModule.configure {
outputDirectory.set(file("$projectDir/docs"))
}

// Create variables with empty default values
extra["STYTCH_PUBLIC_TOKEN"] = ""
extra["GOOGLE_OAUTH_CLIENT_ID"] = ""
extra["STYTCH_B2B_PUBLIC_TOKEN"] = ""
extra["STYTCH_B2B_ORG_ID"] = ""
extra["UI_GOOGLE_CLIENT_ID"] = ""
extra["PASSKEYS_DOMAIN"] = ""

val localProperties = project.rootProject.file("local.properties")
if (localProperties.exists()) {
val p = Properties()
localProperties.inputStream().use {
p.load(it)
}
p.forEach { name, value ->
extra[name as String] = value as String
}
} else {
// Use envvars
extra["STYTCH_PUBLIC_TOKEN"] = System.getenv("STYTCH_PUBLIC_TOKEN")
extra["GOOGLE_OAUTH_CLIENT_ID"] = System.getenv("GOOGLE_OAUTH_CLIENT_ID")
extra["STYTCH_B2B_PUBLIC_TOKEN"] = System.getenv("STYTCH_B2B_PUBLIC_TOKEN")
extra["STYTCH_B2B_ORG_ID"] = System.getenv("STYTCH_B2B_ORG_ID")
extra["UI_GOOGLE_CLIENT_ID"] = System.getenv("UI_GOOGLE_CLIENT_ID")
extra["PASSKEYS_DOMAIN"] = System.getenv("PASSKEYS_DOMAIN")
}
49 changes: 0 additions & 49 deletions example-apps/javademoapp/build.gradle

This file was deleted.

49 changes: 49 additions & 0 deletions example-apps/javademoapp/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
plugins {
alias(libs.plugins.androidApplication)
}
val publicToken = rootProject.ext["STYTCH_PUBLIC_TOKEN"] as String

android {
namespace = "com.stytch.javademoapp"
compileSdk = 35

defaultConfig {
applicationId = "com.stytch.javademoapp"
minSdk = 24
targetSdk = 35
versionCode = 1
versionName = "1.0"

testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"

manifestPlaceholders["stytchOAuthRedirectScheme"] = "stytchjavademoapp"
manifestPlaceholders["stytchOAuthRedirectHost"] = "oauth"
manifestPlaceholders["STYTCH_PUBLIC_TOKEN"] = publicToken
manifestPlaceholders["STYTCH_B2B_PUBLIC_TOKEN"] = ""

buildConfigField("String", "STYTCH_PUBLIC_TOKEN", "\"$publicToken\"")
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
}
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
buildFeatures {
buildConfig = true
}
}

dependencies {
implementation(project(":source:sdk"))
implementation(libs.appcompat)
implementation(libs.material)
implementation(libs.activity)
implementation(libs.constraintlayout)
implementation(libs.lifecycle.viewmodel)
}
Loading

0 comments on commit d351413

Please sign in to comment.