Skip to content
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/Semgrep.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
issues: write
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Semgrep and jq
run: |
Expand All @@ -33,7 +33,7 @@ jobs:
cat pretty-results.json

- name: Add comment on PR if findings are found
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
// Ensure the context has a pull_request
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/beta_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,17 @@ jobs:
build-sdk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PAT_ACTIONS }}

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

- name: Get the current branch
id: check_step
run: |
Expand Down Expand Up @@ -50,7 +56,7 @@ jobs:
git push origin

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
uses: gradle/wrapper-validation-action@v3
- name: Publish package
run: |
chmod +x gradlew
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/internal_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
token: ${{ secrets.PAT_ACTIONS }}
fetch-depth: 0

- name: Set up JDK 12
uses: actions/setup-java@v1
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 12
distribution: 'temurin'
java-version: '17'

- name: Get Previous tag
id: previoustag
Expand Down Expand Up @@ -55,7 +56,7 @@ jobs:
git push origin

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
uses: gradle/wrapper-validation-action@v3
- name: Publish package
run: |
chmod +x gradlew
Expand Down
26 changes: 14 additions & 12 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,31 @@ jobs:
check-code-quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: set up JDK
uses: actions/setup-java@v1
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 12
distribution: 'temurin'
java-version: '17'
- name: Grant permissions to gradlew
run: chmod +x gradlew
- name: Run Android Linter
run: ./gradlew lint
run: ./gradlew :Skyflow:lint
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: set up JDK
uses: actions/setup-java@v1
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 12
distribution: 'temurin'
java-version: '17'
- name: Grant permissions to gradlew
run: chmod +x gradlew
- name: Build SDK
run: ./gradlew build
run: ./gradlew :Skyflow:build
- name: Run Tests
id: tests
run: ./gradlew test
run: ./gradlew :Skyflow:test
9 changes: 7 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@ jobs:
build-sdk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
token: ${{ secrets.PAT_ACTIONS }}

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

- name: Get Previous tag
id: previoustag
Expand All @@ -35,7 +40,7 @@ jobs:
git push origin

- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b
uses: gradle/wrapper-validation-action@v3
- name: Publish package
run: |
chmod +x gradlew
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@
.externalNativeBuild
.cxx
local.properties
/android
50 changes: 22 additions & 28 deletions Skyflow/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
plugins {
id 'com.android.library'
id 'kotlin-android'
id 'maven-publish'
}
apply plugin: 'kotlin-android'
//group='com.github.skyflowapi'
//version = rootProject.ext.versionName
ext {
Expand All @@ -17,11 +15,12 @@ ext {

}
android {
compileSdk 31
namespace "com.skyflow_android"
compileSdk 35

defaultConfig {
minSdk 21
targetSdk 31
targetSdk 35
versionCode 1
versionName "1.0"

Expand All @@ -36,6 +35,10 @@ android {

}

buildFeatures {
buildConfig true
}

buildTypes {
release {
minifyEnabled false
Expand All @@ -51,17 +54,20 @@ android {

}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '1.8'
publishing {
singleVariant('release') {
withSourcesJar()
}
}
}

task androidSourcesJar(type: Jar) {
archiveClassifier.set('sources')
from android.sourceSets.main.java.srcDirs
kotlin {
compilerOptions {
jvmTarget.set(org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17)
}
}

def isBeta = project.hasProperty('beta') ? project.getProperty('beta') : false
Expand All @@ -77,7 +83,6 @@ afterEvaluate {
version mVersionName

from components.release
artifact androidSourcesJar

pom {
name = mLibraryName
Expand All @@ -91,7 +96,6 @@ afterEvaluate {
version mVersionName

from components.release
artifact androidSourcesJar

pom {
name = mLibraryName
Expand All @@ -105,7 +109,6 @@ afterEvaluate {
version mVersionName

from components.release
artifact androidSourcesJar

pom {
name = mLibraryName
Expand All @@ -127,22 +130,13 @@ afterEvaluate {
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
implementation 'androidx.core:core-ktx:1.16.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
testImplementation 'junit:junit:4.13.2'
testImplementation 'org.mockito:mockito-core:4.0.0'
testImplementation 'org.robolectric:robolectric:4.14.1'
testImplementation 'io.mockk:mockk:1.14.11'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.squareup.okhttp3:okhttp:4.9.0'
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.9")
implementation 'com.google.code.gson:gson:2.8.7'
implementation "androidx.core:core-ktx:1.6.0"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation "org.robolectric:robolectric:4.6.1"
testImplementation 'io.mockk:mockk:1.8.5'
androidTestImplementation "org.robolectric:robolectric:4.6.1"
}
publish.dependsOn assemble

3 changes: 1 addition & 2 deletions Skyflow/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.skyflow_android">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
Expand Down
8 changes: 4 additions & 4 deletions Skyflow/src/main/kotlin/Skyflow/TextField.kt
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ class TextField @JvmOverloads constructor(
private fun changeExpireDateValidations() {
validationRules.rules.clear()
val expireDateList = mutableListOf("mm/yy", "mm/yyyy", "yy/mm", "yyyy/mm")
if (expireDateList.contains(options.format.toLowerCase())) {
expiryDateFormat = options.format.toLowerCase()
if (expireDateList.contains(options.format.lowercase())) {
expiryDateFormat = options.format.lowercase()
validationRules.add(SkyflowValidateExpireDate(format = expiryDateFormat))
} else {
Logger.warn(tag, "invalid format for EXPIRATION_DATE", optionsForLogging.logLevel)
Expand All @@ -270,8 +270,8 @@ class TextField @JvmOverloads constructor(
private fun changeYearValidations() {
validationRules.rules.clear()
val yearList = mutableListOf("yy", "yyyy")
if (yearList.contains(options.format.toLowerCase())) {
yearFormat = options.format.toLowerCase()
if (yearList.contains(options.format.lowercase())) {
yearFormat = options.format.lowercase()
validationRules.add(SkyflowValidateYear(format = yearFormat))
} else {
Logger.warn(tag, "invalid format for EXPIRATION_YEAR", optionsForLogging.logLevel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ internal class SkyflowValidateExpireDate(var format:String ="mm/yy", override va

var monthString = ""
var yearString = ""
if(format.toLowerCase().startsWith("m")) {
if(format.lowercase().startsWith("m")) {
monthString = text.substring(0, monthChars)
yearString = text.substring(text.length - yearChars, text.length)
}
Expand Down
23 changes: 3 additions & 20 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,26 +1,9 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.6.0-M1'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.0"
classpath "com.github.dcendents:android-maven-gradle-plugin:2.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
plugins {
id 'com.android.library' version '9.2.0' apply false
id 'com.android.application' version '9.2.0' apply false
}

//ext {
// compileSdkVersion = 29
// buildToolsVersion = '29.0.2'
// versionName = '1.0.0'
//}

task clean(type: Delete) {
delete rootProject.buildDir
}
Expand Down
4 changes: 1 addition & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,5 @@ org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
# Android operating system, and which are packaged with your app"s APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true
# Kotlin code style for this project: "official" or "obsolete":
kotlin.code.style=official
kotlin.code.style=official
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading