Skip to content

Commit 9ed8a4f

Browse files
feat!: initial implementation
Co-authored-by: OS-pedrogustavobilro <[email protected]>
1 parent a431761 commit 9ed8a4f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1173
-430
lines changed

.github/workflows/github_actions.yml renamed to .github/workflows/continuous_integration.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: GitHub Actions
1+
name: Continuous Integration
22

33
on:
44
workflow_dispatch:
@@ -31,11 +31,12 @@ jobs:
3131
- name: Code Coverage
3232
run: bundle exec fastlane coverage
3333

34-
- name: Setup sonarqube
35-
uses: warchant/setup-sonar-scanner@v8
34+
# Commenting Sonarqube steps for now, until we are able to configure Sonarqube in Ionic repos
35+
#- name: Setup sonarqube
36+
# uses: warchant/setup-sonar-scanner@v8
3637

37-
- name: Send to Sonarcloud
38-
run: bundle exec fastlane sonarqube
39-
env:
40-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41-
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
38+
#- name: Send to Sonarcloud
39+
# run: bundle exec fastlane sonarqube
40+
# env:
41+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Publish Native Android Library
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
publish-android:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: read
10+
packages: write
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: set up JDK 17
14+
uses: actions/setup-java@v4
15+
with:
16+
java-version: '17'
17+
distribution: 'adopt'
18+
- name: Grant execute permission for gradlew
19+
run: chmod +x ./gradlew
20+
- name: Grant execute permission for publishing script
21+
run: chmod +x ./scripts/publish-android.sh
22+
- name: Make local props
23+
run: |
24+
cat << EOF > "local.properties"
25+
ossrhUsername=${{ secrets.ANDROID_OSSRH_USERNAME }}
26+
ossrhPassword=${{ secrets.ANDROID_OSSRH_PASSWORD }}
27+
sonatypeStagingProfileId=${{ secrets.ANDROID_SONATYPE_STAGING_PROFILE_ID }}
28+
signing.keyId=${{ secrets.ANDROID_SIGNING_KEY_ID }}
29+
signing.password=${{ secrets.ANDROID_SIGNING_PASSWORD }}
30+
signing.key=${{ secrets.ANDROID_SIGNING_KEY }}
31+
EOF
32+
echo "local.properties file has been created successfully."
33+
- name: Run publish script
34+
working-directory: ./scripts
35+
run: ./publish-android.sh

docs/CHANGELOG.md renamed to CHANGELOG.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
### 2024-02-01
8-
- Fix: Update `github_actions.yml` file steps versions (https://outsystemsrd.atlassian.net/browse/RMET-2568).
7+
## [Unreleased]
98

10-
### 2022-04-12
11-
Create repository.
9+
### 2025-03-31
10+
11+
- Implement native library with methods `downloadFile` and `uploadFile`.

docs/LICENSE renamed to LICENSE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 OutSystems
3+
Copyright (c) 2025 Ionic
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2020
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
21+
SOFTWARE.

build.gradle

Lines changed: 58 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,49 @@
11
buildscript {
2-
ext.kotlin_version = "1.5.21"
3-
ext.jacocoVersion = '0.8.7'
2+
ext.kotlin_version = "1.9.24"
3+
ext.jacocoVersion = '0.8.9'
44
repositories {
55
google()
66
mavenCentral()
77
}
88
dependencies {
9-
classpath 'com.android.tools.build:gradle:7.1.2'
9+
if (System.getenv("SHOULD_PUBLISH") == "true") {
10+
classpath("io.github.gradle-nexus:publish-plugin:1.1.0")
11+
}
12+
classpath 'com.android.tools.build:gradle:8.7.3'
1013
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1114
classpath "org.jacoco:org.jacoco.core:$jacocoVersion"
1215
}
1316
}
1417

18+
plugins {
19+
id "org.sonarqube" version "3.5.0.2730"
20+
}
21+
22+
sonarqube {
23+
// TODO update this information once ionic Sonarqube is available
24+
properties {
25+
property "sonar.projectKey", "OutSystems_IONFileTransferLib-Android"
26+
property "sonar.organization", "outsystemsrd"
27+
property "sonar.host.url", "https://sonarcloud.io"
28+
}
29+
}
30+
31+
if (System.getenv("SHOULD_PUBLISH") == "true") {
32+
apply plugin: "io.github.gradle-nexus.publish-plugin"
33+
apply from: file("./scripts/publish-root.gradle")
34+
}
35+
1536
apply plugin: "com.android.library"
1637
apply plugin: "kotlin-android"
1738
apply plugin: "jacoco"
1839

1940
android {
20-
compileSdk 32
41+
namespace "io.ionic.libs.ionfiletransferlib"
42+
compileSdk 35
2143

2244
defaultConfig {
23-
minSdk 26
24-
targetSdk 32
45+
minSdk 23
46+
targetSdk 35
2547
versionCode 1
2648
versionName "1.0"
2749

@@ -35,31 +57,42 @@ android {
3557
}
3658
}
3759
compileOptions {
38-
sourceCompatibility JavaVersion.VERSION_1_8
39-
targetCompatibility JavaVersion.VERSION_1_8
60+
sourceCompatibility JavaVersion.VERSION_17
61+
targetCompatibility JavaVersion.VERSION_17
4062
}
4163
kotlinOptions {
42-
jvmTarget = '1.8'
64+
jvmTarget = '17'
4365
}
4466

45-
task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) {
67+
tasks.register('jacocoTestReport', JacocoReport) {
68+
dependsOn['testDebugUnitTest']
4669

4770
reports {
48-
xml.enabled = true
49-
html.enabled = true
71+
xml.getRequired().set(true)
72+
html.getRequired().set(true)
5073
}
5174

5275
def fileFilter = ['**/BuildConfig.*', '**/Manifest*.*']
53-
def debugTree = fileTree(dir: "${buildDir}/tmp/kotlin-classes/debugUnitTest", excludes: fileFilter)
54-
def mainSrc = "${project.projectDir}/src/main/java"
76+
def debugTree = fileTree(dir: "${layout.buildDirectory}/tmp/kotlin-classes/debugUnitTest", excludes: fileFilter)
77+
def mainSrc = "${project.projectDir}/src/main/kotlin"
5578

5679
sourceDirectories.setFrom(files([mainSrc]))
5780
classDirectories.setFrom(files([debugTree]))
58-
executionData.setFrom(fileTree(dir: "$buildDir", includes: [
81+
executionData.setFrom(fileTree(dir: "${layout.buildDirectory}", includes: [
5982
"jacoco/testDebugUnitTest.exec",
6083
"outputs/code-coverage/connected/*coverage.ec"
6184
]))
6285
}
86+
87+
packagingOptions {
88+
resources {
89+
excludes += '/META-INF/{AL2.0,LGPL2.1}'
90+
}
91+
}
92+
93+
publishing {
94+
singleVariant("release")
95+
}
6396
}
6497

6598
repositories {
@@ -69,11 +102,15 @@ repositories {
69102

70103
dependencies {
71104

72-
implementation 'androidx.core:core-ktx:1.7.0'
73-
implementation 'androidx.appcompat:appcompat:1.4.1'
74-
implementation 'com.google.android.material:material:1.5.0'
75-
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
105+
implementation 'androidx.core:core-ktx:1.15.0'
106+
implementation 'androidx.activity:activity-ktx:1.10.1'
107+
76108
testImplementation 'junit:junit:4.13.2'
77-
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
78-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
109+
110+
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
111+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
79112
}
113+
114+
if (System.getenv("SHOULD_PUBLISH") == "true") {
115+
apply from: file("./scripts/publish-module.gradle")
116+
}

docs/README.md

Lines changed: 0 additions & 50 deletions
This file was deleted.
-13.3 KB
Binary file not shown.
-25.6 KB
Binary file not shown.
-6.24 KB
Binary file not shown.

fastlane/Appfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
json_key_file("") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one
2-
package_name("io.ionic.libs.ionfiletransferlib.ion-android") # e.g. com.krausefx.app
2+
package_name("io.ionic.libs.ionfiletransferlib") # e.g. com.krausefx.app

0 commit comments

Comments
 (0)