Skip to content

Commit

Permalink
Merge pull request #15 from OutSystems/development
Browse files Browse the repository at this point in the history
RMET-3028 OSBarcodeLib-Android - Prepare release of version 1.0.0
  • Loading branch information
alexgerardojacinto authored Jan 10, 2024
2 parents 9fa911f + 1b316c5 commit 1424fac
Show file tree
Hide file tree
Showing 61 changed files with 2,799 additions and 419 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/github_actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
java-version: '17'

- name: Bundle Install
run: bundle install
Expand All @@ -32,7 +32,7 @@ jobs:
run: bundle exec fastlane coverage

- name: Setup sonarqube
uses: warchant/setup-sonar-scanner@v3
uses: warchant/setup-sonar-scanner@v7

- name: Send to Sonarcloud
run: bundle exec fastlane sonarqube
Expand Down
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Changelog
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).

The changes documented here do not include those from the original repository.

## [Unreleased]

## [1.0.0]

### 09-01-2024
Android - Udpate error codes and messages (https://outsystemsrd.atlassian.net/browse/RMET-3037)

### 19-12-2023
Android - Run image analysis outside of the main/UI thread (https://outsystemsrd.atlassian.net/browse/RMET-2912)

### 06-12-2023
Android - Implement scanning only the frame area (Portrait, Landscape, Adaptive) (https://outsystemsrd.atlassian.net/browse/RMET-2912)

### 06-12-2023
Android - Implement Scanner screen for Tablets (Portrait, Landscape, Adaptive) (https://outsystemsrd.atlassian.net/browse/RMET-2912)

### 30-11-2023
Android - Implement Scanner screen for Phones (Portrait, Landscape, Adaptive) (https://outsystemsrd.atlassian.net/browse/RMET-2770)

### 17-11-2023
Android - Implement Scan Orientation (Portrait, Landscape, Adaptive) (https://outsystemsrd.atlassian.net/browse/RMET-2763)

### 16-11-2023
Android - Implement Scan Button (https://outsystemsrd.atlassian.net/browse/RMET-2762)

### 15-11-2023
Android - Implement Scan Instructions (https://outsystemsrd.atlassian.net/browse/RMET-2761)

### 14-11-2023
Android - Implement Torch Button to settings (https://outsystemsrd.atlassian.net/browse/RMET-2759)

### 13-11-2023
Android - Implement AlertDialog to settings (https://outsystemsrd.atlassian.net/browse/RMET-2764)

### 13-11-2023
Android - Select Camera (Back or Front) (https://outsystemsrd.atlassian.net/browse/RMET-2764)

### 10-11-2023
Android - Use both libraries dynamically (https://outsystemsrd.atlassian.net/browse/RMET-2895)

### 09-11-2023
Android - Scan barcode feature using ML Kit (https://outsystemsrd.atlassian.net/browse/RMET-2894)

### 06-11-2023
Android - First implementation of the scan barcode feature using zxing (https://outsystemsrd.atlassian.net/browse/RMET-2758)
60 changes: 60 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Android
# Build your Android project with Gradle.
# Add steps that test, sign, and distribute the APK, save build artifacts, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/android

parameters:
- name: publishBuild
displayName: Publish new build?
type: boolean
default: false

trigger:
- main

pool:
vmImage: ubuntu-latest

steps:
- task: SonarCloudPrepare@1
inputs:
SonarCloud: 'SonarCloud'
organization: 'outsystemsrd'
scannerMode: 'CLI'
configMode: 'file'
- task: Gradle@2
displayName: Build Project
inputs:
workingDirectory: ''
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx4096M'
javaHomeOption: 'JDKVersion'
jdkVersionOption: '1.17'
jdkArchitectureOption: 'x64'
publishJUnitResults: true
testResultsFiles: '**/TEST-*.xml'
tasks: 'clean build'
- task: CmdLine@2
displayName: Validate pom.xml
inputs:
script: |
/usr/bin/mvn -version
/usr/bin/mvn -f /home/vsts/work/1/s/pom.xml help:effective-pom
- task: MavenAuthenticate@0
displayName: Authenticate in public repo
condition: or(${{parameters.publishBuild}}, eq(variables['Build.SourceBranch'], 'refs/heads/main'))
inputs:
artifactsFeeds: 'PublicArtifactRepository'
- task: Bash@3
displayName: Deploy file
condition: or(${{parameters.publishBuild}}, eq(variables['Build.SourceBranch'], 'refs/heads/main'))
inputs:
targetType: 'inline'
script: |
/usr/bin/mvn deploy:deploy-file \
-DpomFile=/home/vsts/work/1/s/pom.xml \
-DgeneratePom=true \
-Dfile=build/outputs/aar/OSBarcodeLib-release.aar \
-Dpackaging=aar \
-DrepositoryId=PublicArtifactRepository \
-Durl=https://pkgs.dev.azure.com/OutSystemsRD/9e79bc5b-69b2-4476-9ca5-d67594972a52/_packaging/PublicArtifactRepository/maven/v1
73 changes: 62 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,27 +1,41 @@
buildscript {
ext.kotlin_version = "1.5.21"
ext.kotlin_version = "1.6.20"
ext.jacocoVersion = '0.8.7'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
classpath 'com.android.tools.build:gradle:8.1.1'
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 {
properties {
property "sonar.projectKey", "OutSystems_OSBarcodeLib-Android"
property "sonar.organization", "outsystemsrd"
property "sonar.host.url", "https://sonarcloud.io"
}
}

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

android {
compileSdk 32

namespace "com.outsystems.plugins.barcode"
compileSdk 34

defaultConfig {
minSdk 26
targetSdk 32
targetSdk 34
versionCode 1
versionName "1.0"

Expand All @@ -45,13 +59,13 @@ android {
task jacocoTestReport(type: 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: "${buildDir}/tmp/kotlin-classes/debug", excludes: fileFilter)
def mainSrc = "${project.projectDir}/src/main/kotlin"

sourceDirectories.setFrom(files([mainSrc]))
classDirectories.setFrom(files([debugTree]))
Expand All @@ -60,6 +74,22 @@ android {
"outputs/code-coverage/connected/*coverage.ec"
]))
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.2.0-alpha08'
}

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

testOptions {
unitTests.returnDefaultValues = true
}
}

repositories {
Expand All @@ -68,12 +98,33 @@ 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.compose.ui:ui:1.0.5"
implementation "androidx.compose.material:material:1.0.5"
implementation "androidx.compose.ui:ui-tooling-preview:1.0.5"
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.4.0'
implementation "androidx.activity:activity-compose:1.4.0"
implementation 'androidx.compose.material3:material3:1.0.0'
implementation 'androidx.compose.material3:material3-window-size-class:1.0.0'

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.compose.ui:ui-test-junit4:1.0.5"
debugImplementation "androidx.compose.ui:ui-tooling:1.0.5"

implementation "androidx.camera:camera-camera2:1.0.2"
implementation 'androidx.camera:camera-lifecycle:1.0.2'
implementation 'androidx.camera:camera-view:1.0.0-alpha31'
implementation 'androidx.camera:camera-core:1.0.0'
implementation 'com.google.zxing:core:3.4.1'
implementation 'com.google.mlkit:barcode-scanning:17.2.0'

testImplementation "org.mockito:mockito-core:4.3.0"
testImplementation 'org.mockito:mockito-inline:4.3.0'
testImplementation 'org.mockito.kotlin:mockito-kotlin:4.0.0'
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.2"
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.2"
}
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("organizationidplaceholder.libtemplateplaceholder") # e.g. com.krausefx.app
package_name("com.outsystems.plugins.barcode.osbarcodelib") # 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.3-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
11 changes: 11 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?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>com.github.outsystems</groupId>
<artifactId>osbarcode-android</artifactId>
<version>1.0.0</version>
</project>
57 changes: 0 additions & 57 deletions scripts/generator_script.sh

This file was deleted.

2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rootProject.name = "LibTemplatePlaceholder"
rootProject.name = "OSBarcodeLib"
10 changes: 8 additions & 2 deletions sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# Organization and project keys are displayed in the right sidebar of the project homepage
sonar.organization=outsystemsrd
sonar.projectKey=OutSystems_LibTemplatePlaceholder-Android
sonar.projectKey=OutSystems_OSBarcodeLib-Android
sonar.host.url=https://sonarcloud.io

sonar.language=kotlin

# Defining path to coverage file
sonar.coverage.jacoco.xmlReportPaths=**/jacocoTestReport/jacocoTestReport.xml
sonar.junit.reportPaths=**/test-results/**/*.xml
sonar.junit.reportPaths=**/test-results/**/*.xml

# Removing tests, mocks and code not testable by unit tests from the coverage estimation
sonar.coverage.exclusions=**/*Tests.kt,**/*Mock.kt,**/model/*.kt,**/view/*.kt,**/*Theme.kt,**/ui.theme/*.kt,**/*Interface.kt,**/helper/*.kt

# Removing tests from code duplication checks
sonar.cpd.exclusions=**/*Tests.kt
Loading

0 comments on commit 1424fac

Please sign in to comment.