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

Release 7.0.0 #45

Merged
merged 10 commits into from
Jul 2, 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
11 changes: 1 addition & 10 deletions .github/ci-gradle.properties
Original file line number Diff line number Diff line change
@@ -1,11 +1,2 @@
org.gradle.daemon=false
org.gradle.parallel=false
org.gradle.caching=false
org.gradle.workers.max=1

org.gradle.jvmargs=-Xmx4G -XX:MaxPermSize=512m

kapt.includeCompileClasspath=false

kotlin.incremental=false
kotlin.compiler.execution.strategy=in-process
org.gradle.jvmargs=-Xmx4G
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ jobs:
steps:
- uses: actions/checkout@v4

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

- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: Build and Test SDK
run: |
cd android
bash ./gradlew airship-framework-proxy:assembleDebug airship-framework-proxy:testDebugUnitTest --info --stacktrace
bash ./gradlew assembleDebug testDebugUnitTest --info --stacktrace
cd -

- name: publish unit test reports
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@ jobs:
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT

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

java-version: '17'
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

- name: Build
run: |
cd android
./gradlew airship-framework-proxy:assembleRelease --stacktrace
./gradlew assembleRelease --stacktrace
cd -

- name: Publish to Maven Central
Expand Down
4 changes: 2 additions & 2 deletions AirshipFrameworkProxy.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

Pod::Spec.new do |s|
s.version = "6.3.1"
s.version = "7.0.0"
s.name = "AirshipFrameworkProxy"
s.summary = "Airship iOS mobile framework proxy"
s.documentation_url = "https://docs.airship.com/platform/mobile"
Expand All @@ -15,5 +15,5 @@ Pod::Spec.new do |s|
s.requires_arc = true
s.swift_version = "5.0"
s.source_files = "ios/AirshipFrameworkProxy/**/*.{h,m,swift}"
s.dependency 'Airship', "18.4.1"
s.dependency 'Airship', "18.5.0"
end
36 changes: 36 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// swift-tools-version:5.9

// Copyright Airship and Contributors

import PackageDescription

let package = Package(
name: "AirshipFrameworkProxy",
defaultLocalization: "en",
platforms: [.macOS(.v10_15), .iOS(.v14), .tvOS(.v14), .visionOS(.v1)],
products: [
.library(
name: "AirshipFrameworkProxy",
targets: ["AirshipFrameworkProxy"]
)
],
dependencies: [
.package(url: "https://github.com/urbanairship/ios-library.git", from: "18.5.0")
],
targets: [
.target(
name: "AirshipFrameworkProxy",
dependencies: [
.product(name: "AirshipCore", package: "ios-library"),
.product(name: "AirshipMessageCenter", package: "ios-library"),
.product(name: "AirshipPreferenceCenter", package: "ios-library"),
.product(name: "AirshipAutomation", package: "ios-library"),
.product(name: "AirshipFeatureFlags", package: "ios-library"),
],
path: "ios/AirshipFrameworkProxy",
exclude: [
"AirshipFrameworkProxy.h"
]
)
]
)
1 change: 1 addition & 0 deletions android/airship-framework-proxy-hms/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
108 changes: 108 additions & 0 deletions android/airship-framework-proxy-hms/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
plugins {
alias libs.plugins.android.library
id 'maven-publish'
id 'signing'
}

group = 'com.urbanairship.android'
description = "Airship Mobile Framework Proxy HMS"
version = libs.versions.airshipProxy.get()

android {
namespace 'com.urbanairship.android.framework.proxy.hms'

defaultConfig {
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
minSdkVersion rootProject.minSdkVersion
targetSdkVersion rootProject.targetSdkVersion
compileSdk rootProject.compileSdkVersion
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

testOptions {
unitTests {
includeAndroidResources = true
returnDefaultValues = true
}
}
}

dependencies {
api(libs.airship.hms)
}



// Create the pom configuration:
def pomConfig = {
licenses {
license {
name 'The Apache Software License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
distribution 'repo'
}
}

developers {
developer {
name 'Airship'
}
}

scm {
connection 'https://github.com/urbanairship/airship-mobile-framework-proxy.git'
url 'https://github.com/urbanairship/airship-mobile-framework-proxy'
}
}

publishing {
publications {
Production(MavenPublication) {
groupId project.group
artifactId project.name
version project.version

artifact("$buildDir/outputs/aar/" + project.name + "-release.aar")

pom.withXml {
def root = asNode()

def dependenciesNode = root.appendNode('dependencies')
configurations.implementation.allDependencies.each {
def dependencyNode = dependenciesNode.appendNode('dependency')
dependencyNode.appendNode('groupId', it.group)
dependencyNode.appendNode('artifactId', it.name)
dependencyNode.appendNode('version', it.version)
}

root.appendNode('description', project.description)
root.appendNode('name', project.name)
root.appendNode('url', 'https://airship.com')
root.children().last() + pomConfig
}
}
}
}

signing {
// secretKey and password are required for signing.
def secretKey = System.getenv("SIGNING_KEY") ?: findProperty("signing.key")
def password = System.getenv("SIGNING_PASSWORD") ?: findProperty("signing.password")
// keyId is optional.
def keyId = System.getenv("SIGNING_KEY_ID") ?: findProperty("signing.keyId")
if (secretKey != null) {
required = true
sign(publishing.publications)
if (keyId != null) {
useInMemoryPgpKeys(keyId, secretKey, password)
} else {
useInMemoryPgpKeys(secretKey, password)
}
} else {
logger.info("Missing signing key! Signing will not be configured.")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application>

</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sdk=28
23 changes: 13 additions & 10 deletions android/airship-framework-proxy/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ android {
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = JavaVersion.VERSION_1_8
jvmTarget = JavaVersion.VERSION_17
freeCompilerArgs = ["-Xexplicit-api=strict"]
}
testOptions {
Expand All @@ -46,7 +46,7 @@ dependencies {
api(libs.airship.feature.flag)

implementation(libs.kotlinx.coroutines.android)
implementation 'androidx.preference:preference-ktx:1.2.0'
implementation(libs.androidx.preference.ktx)

testImplementation(libs.junit)
testImplementation(libs.androidx.test.core)
Expand All @@ -57,11 +57,6 @@ dependencies {
testImplementation(libs.mockk)
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets["main"].java.srcDirs
}

// Create the pom configuration:
def pomConfig = {
licenses {
Expand All @@ -84,15 +79,23 @@ def pomConfig = {
}
}

//task sourceJar(type: Jar) {
// archiveClassifier.set("sources")
// from(android.sourceSets["main"].java.srcDirs)
//}

publishing {
publications {
Production(MavenPublication) {



groupId project.group
artifactId project.name
version project.version

artifact("$buildDir/outputs/aar/" + project.name + "-release.aar")
artifact(sourcesJar)
// artifact(sourcesJar)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I dont think we need this but if we know the replacement i can add it. @jyaganeh

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fine for now. It should only impact the team, and only when we're using IDEs smart enough to pull in the sources for docs. We can revisit if that ends up being a pain point.


pom.withXml {
def root = asNode()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public data class ProxyConfig(
val urlAllowListScopeOpenUrl: List<String>? = null,
val isChannelCaptureEnabled: Boolean? = null,
val isChannelCreationDelayEnabled: Boolean? = null,
@Feature val enabledFeatures: Int? = null,
val enabledFeatures: Feature? = null,
val autoPauseInAppAutomationOnLaunch: Boolean? = null,
val androidConfig: Android? = null
) : JsonSerializable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,6 @@ import com.urbanairship.util.UAStringUtil
* Module utils.
*/
public object Utils {
internal val featureMap: Map<String, Int> = mapOf(
"none" to PrivacyManager.FEATURE_NONE,
"in_app_automation" to PrivacyManager.FEATURE_IN_APP_AUTOMATION,
"message_center" to PrivacyManager.FEATURE_MESSAGE_CENTER,
"push" to PrivacyManager.FEATURE_PUSH,
"analytics" to PrivacyManager.FEATURE_ANALYTICS,
"tags_and_attributes" to PrivacyManager.FEATURE_TAGS_AND_ATTRIBUTES,
"contacts" to PrivacyManager.FEATURE_CONTACTS,
"all" to PrivacyManager.FEATURE_ALL
)

public fun parseLogLevel(logLevel: String): Int {
return when (logLevel.lowercase().trim()) {
Expand Down Expand Up @@ -57,13 +47,11 @@ public object Utils {
}
}

@PrivacyManager.Feature
public fun parseFeatures(value: JsonValue): Int {
var result = PrivacyManager.FEATURE_NONE
for (value in value.optList()) {
result = result or parseFeature(value.optString())
public fun parseFeatures(value: JsonValue): PrivacyManager.Feature {
if (value.isJsonList) {
return PrivacyManager.Feature.fromJson(value) ?: PrivacyManager.Feature.NONE
}
return result
return PrivacyManager.Feature.NONE
}

@AirshipConfigOptions.Site
Expand Down Expand Up @@ -129,43 +117,9 @@ public object Utils {
return defaultColor
}

@PrivacyManager.Feature
@JvmStatic
public fun parseFeature(feature: String): Int {
val value = featureMap[feature]
value?.let {
return it
}

throw IllegalArgumentException("Invalid feature: $feature")
}

@JvmStatic
public fun featureNames(@PrivacyManager.Feature features: Int): List<String> {
val result: MutableList<String> = ArrayList()

if (features == PrivacyManager.FEATURE_ALL) {
return featureMap.keys.filter {
it != "none" && it != "all"
}.toList()
}

if (features == PrivacyManager.FEATURE_NONE) {
return emptyList()
}

for ((key, value) in featureMap) {
if (value == PrivacyManager.FEATURE_ALL) {
continue
}
if (value == PrivacyManager.FEATURE_NONE) {
continue
}
if (value and features == value) {
result.add(key)
}
}
return result
public fun featureNames(features: PrivacyManager.Feature): List<String> {
return features.toJsonValue().optList().mapNotNull { it.string }
}

private fun getNotificationId(notificationId: Int, notificationTag: String?): String {
Expand Down
Loading
Loading