Skip to content
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
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: GitHub Actions
name: Continuous Integration

on:
workflow_dispatch:
Expand Down Expand Up @@ -31,11 +31,12 @@ jobs:
- name: Code Coverage
run: bundle exec fastlane coverage

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

- name: Send to Sonarcloud
run: bundle exec fastlane sonarqube
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
#- name: Send to Sonarcloud
# run: bundle exec fastlane sonarqube
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
35 changes: 35 additions & 0 deletions .github/workflows/publish-android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Publish Native Android Library

on: workflow_dispatch

jobs:
publish-android:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- name: set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'adopt'
- name: Grant execute permission for gradlew
run: chmod +x ./gradlew
- name: Grant execute permission for publishing script
run: chmod +x ./scripts/publish-android.sh
- name: Make local props
run: |
cat << EOF > "local.properties"
ossrhUsername=${{ secrets.ANDROID_OSSRH_USERNAME }}
ossrhPassword=${{ secrets.ANDROID_OSSRH_PASSWORD }}
sonatypeStagingProfileId=${{ secrets.ANDROID_SONATYPE_STAGING_PROFILE_ID }}
signing.keyId=${{ secrets.ANDROID_SIGNING_KEY_ID }}
signing.password=${{ secrets.ANDROID_SIGNING_PASSWORD }}
signing.key=${{ secrets.ANDROID_SIGNING_KEY }}
EOF
echo "local.properties file has been created successfully."
- name: Run publish script
working-directory: ./scripts
run: ./publish-android.sh
8 changes: 4 additions & 4 deletions docs/CHANGELOG.md → CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

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

### 2022-04-12
Create repository.
### 2025-03-31

- Implement native library with methods `downloadFile` and `uploadFile`.
4 changes: 2 additions & 2 deletions docs/LICENSE → LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022 OutSystems
Copyright (c) 2025 Ionic

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand All @@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
SOFTWARE.
79 changes: 58 additions & 21 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,27 +1,49 @@
buildscript {
ext.kotlin_version = "1.5.21"
ext.jacocoVersion = '0.8.7'
ext.kotlin_version = "1.9.24"
ext.jacocoVersion = '0.8.9'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
if (System.getenv("SHOULD_PUBLISH") == "true") {
classpath("io.github.gradle-nexus:publish-plugin:1.1.0")
}
classpath 'com.android.tools.build:gradle:8.7.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jacoco:org.jacoco.core:$jacocoVersion"
}
}

plugins {
id "org.sonarqube" version "3.5.0.2730"
}

sonarqube {
// TODO update this information once ionic Sonarqube is available
properties {
property "sonar.projectKey", "OutSystems_IONFileTransferLib-Android"
property "sonar.organization", "outsystemsrd"
property "sonar.host.url", "https://sonarcloud.io"
}
}

if (System.getenv("SHOULD_PUBLISH") == "true") {
apply plugin: "io.github.gradle-nexus.publish-plugin"
apply from: file("./scripts/publish-root.gradle")
}

apply plugin: "com.android.library"
apply plugin: "kotlin-android"
apply plugin: "jacoco"

android {
compileSdk 32
namespace "io.ionic.libs.ionfiletransferlib"
compileSdk 35

defaultConfig {
minSdk 26
targetSdk 32
minSdk 23
targetSdk 35
versionCode 1
versionName "1.0"

Expand All @@ -35,31 +57,42 @@ android {
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = '1.8'
jvmTarget = '17'
}

task jacocoTestReport(type: JacocoReport, dependsOn: ['testDebugUnitTest']) {
tasks.register('jacocoTestReport', JacocoReport) {
dependsOn['testDebugUnitTest']

reports {
xml.enabled = true
html.enabled = true
xml.getRequired().set(true)
html.getRequired().set(true)
}

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

sourceDirectories.setFrom(files([mainSrc]))
classDirectories.setFrom(files([debugTree]))
executionData.setFrom(fileTree(dir: "$buildDir", includes: [
executionData.setFrom(fileTree(dir: "${layout.buildDirectory}", includes: [
"jacoco/testDebugUnitTest.exec",
"outputs/code-coverage/connected/*coverage.ec"
]))
}

packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}

publishing {
singleVariant("release")
}
}

repositories {
Expand All @@ -69,11 +102,15 @@ repositories {

dependencies {

implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.core:core-ktx:1.15.0'
implementation 'androidx.activity:activity-ktx:1.10.1'

testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
}

if (System.getenv("SHOULD_PUBLISH") == "true") {
apply from: file("./scripts/publish-module.gradle")
}
50 changes: 0 additions & 50 deletions docs/README.md

This file was deleted.

Binary file removed docs/assets/createRepositoryButton.png
Binary file not shown.
Binary file removed docs/assets/repositoryNameExample.png
Binary file not shown.
Binary file removed docs/assets/useThisTemplateButton.png
Binary file not shown.
2 changes: 1 addition & 1 deletion fastlane/Appfile
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
json_key_file("") # Path to the json secret file - Follow https://docs.fastlane.tools/actions/supply/#setup to get one
package_name("io.ionic.libs.ionfiletransferlib.ion-android") # e.g. com.krausefx.app
package_name("io.ionic.libs.ionfiletransferlib") # e.g. com.krausefx.app
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 @@
#Fri Apr 08 08:58:08 WEST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
10 changes: 10 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>io.ionic.libs</groupId>
<artifactId>ionfiletransfer-android</artifactId>
<version>0.0.1</version>
</project>
13 changes: 1 addition & 12 deletions docs/pull_request_template.md → pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
## Description
<!--- Describe your changes in detail -->

## Context
<!--- Why is this change required? What problem does it solve? -->
<!--- Place the link to the issue here -->

## Type of changes
<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply -->
- [ ] Fix (non-breaking change which fixes an issue)
- [ ] Feature (non-breaking change which adds functionality)
- [ ] Refactor (cosmetic changes)
- [ ] Breaking change (change that would cause existing functionality to not work as expected)

## Platforms affected
- [ ] Android
- [ ] iOS
- [ ] JavaScript

## Tests
<!--- Describe how you tested your changes in detail -->
<!--- Include details of your test environment if relevant -->
Expand All @@ -25,8 +16,6 @@

## Checklist
<!--- Go over all the following items and put an `x` in all the boxes that apply -->
- [ ] Pull request title follows the format `RNMT-XXXX <title>`
- [ ] Code follows code style of this project
- [ ] CHANGELOG.md file is correctly updated
- [ ] Changes require an update to the documentation
- [ ] Documentation has been updated accordingly
- [ ] Documentation has been updated accordingly
38 changes: 38 additions & 0 deletions scripts/publish-android.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/usr/bin/env bash

ANDROID_PATH=../
LOG_OUTPUT=./tmp/publish-android.txt
THE_VERSION=`sed -n 's/.*<version>\(.*\)<\/version>.*/\1/p' ../pom.xml`

# Get latest io.ionic:portals XML version info
PUBLISHED_URL="https://repo1.maven.org/maven2/io/ionic/libs/ionfiletransfer-android/maven-metadata.xml"
PUBLISHED_DATA=$(curl -s $PUBLISHED_URL)
PUBLISHED_VERSION="$(perl -ne 'print and last if s/.*<latest>(.*)<\/latest>.*/\1/;' <<< $PUBLISHED_DATA)"

if [[ "$THE_VERSION" == "$PUBLISHED_VERSION" ]]; then
printf %"s\n\n" "Duplicate: a published version exists for $THE_VERSION, skipping..."
else
# Make log dir if doesnt exist
mkdir -p ./tmp

# Export ENV variable used by Gradle for Versioning
export THE_VERSION
export SHOULD_PUBLISH=true

printf %"s\n" "Attempting to build and publish version $THE_VERSION"
# Publish a release to the Maven repo
"$ANDROID_PATH"/gradlew clean build publishReleasePublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository --no-daemon --max-workers 1 -b "$ANDROID_PATH"/build.gradle -Pandroid.useAndroidX=true > $LOG_OUTPUT 2>&1
# Stage a version
# "$ANDROID_PATH"/gradlew clean build publishReleasePublicationToSonatypeRepository --no-daemon --max-workers 1 -b "$ANDROID_PATH"/build.gradle -Pandroid.useAndroidX=true > $LOG_OUTPUT 2>&1

echo $RESULT

if grep --quiet "BUILD SUCCESSFUL" $LOG_OUTPUT; then
printf %"s\n" "Success: Published to MavenCentral."
else
printf %"s\n" "Error publishing, check $LOG_OUTPUT for more info! Manually review and release from the Sonatype Repository Manager may be necessary https://s01.oss.sonatype.org/"
cat $LOG_OUTPUT
exit 1
fi

fi
Loading