Skip to content

Commit 4542659

Browse files
authored
Merge branch 'main' into deb-packages
2 parents 90c75fd + d070806 commit 4542659

File tree

146 files changed

+5215
-3731
lines changed

Some content is hidden

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

146 files changed

+5215
-3731
lines changed

.editorconfig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,17 @@ charset = utf-8
88
end_of_line = lf
99
insert_final_newline = true
1010
trim_trailing_whitespace = true
11+
max_line_length = 120
1112

1213
[*.{bat,cmd}]
1314
end_of_line = crlf
1415

1516
[*.py]
1617
indent_style = space
1718
indent_size = 4
18-
max_line_length = 120
1919

20-
[CODEOWNERS]
20+
[{CODEOWNERS,Makefile}]
2121
indent_style = tab
22+
23+
[*.mustache]
24+
insert_final_newline = false

.github/workflows/check-codegen.yml

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,44 @@
1-
# This is a basic workflow to help you get started with Actions
2-
31
name: CI
42

53
# Controls when the action will run. Triggers the workflow on push or pull request
64
# events but only for the main branch
75
on:
86
push:
9-
branches: [ master, main ]
7+
branches: [main]
108
pull_request:
11-
branches: [ master, main ]
9+
branches: [main]
1210

13-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1411
jobs:
15-
# This workflow contains a single job called "build"
1612
check-submodules:
17-
# The type of runner that the job will run on
1813
runs-on: ubuntu-latest
1914

20-
# Steps represent a sequence of tasks that will be executed as part of the job
2115
steps:
22-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
23-
- uses: actions/checkout@v3
24-
with:
25-
submodules: recursive
16+
- uses: actions/checkout@v3
17+
with:
18+
submodules: recursive
2619

27-
- name: Check all submodules up-to-date
28-
run: git diff --exit-code
20+
- name: Check all submodules up-to-date
21+
run: |
22+
git submodule update --recursive --remote
23+
git diff --exit-code
2924
30-
check-master:
25+
check-urls:
3126
runs-on: ubuntu-latest
32-
needs: [check-submodules]
3327
steps:
3428
- uses: actions/checkout@v3
3529
with:
3630
submodules: recursive
3731

38-
- name: Check master points to main
39-
run: |
40-
for s in ./submodules/*/ ; do
41-
pushd "$s"
42-
rem_master_hash=$(git ls-remote --exit-code --quiet --heads origin master | awk '{ print $1}')
43-
git diff --exit-code ${rem_master_hash} || (echo "Broken Master in $s" ; exit 1)
44-
popd > /dev/null
45-
done
32+
- name: Check all URLs
33+
run: ./scripts/check_all_urls.sh
4634

47-
check-urls:
35+
check-swagger:
4836
runs-on: ubuntu-latest
37+
needs: [check-submodules]
4938
steps:
50-
- uses: actions/checkout@v3
51-
52-
- name: Check all URLs
53-
run: ./scripts/check_all_urls.sh
39+
- uses: actions/checkout@v3
40+
with:
41+
submodules: recursive
5442

55-
- name: Check existing swagger specification is up-to-date
56-
run: curl https://api.aspose.cloud/v3.0/barcode/swagger/spec | diff --strip-trailing-cr -y --suppress-common-lines spec/aspose-barcode-cloud.json -
43+
- name: Check existing swagger specification is up-to-date
44+
run: curl https://api.aspose.cloud/v3.0/barcode/swagger/spec | diff --strip-trailing-cr -y --suppress-common-lines spec/aspose-barcode-cloud.json -

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
*.suo
22
*.user
33
_ReSharper.*
4-
bin
5-
obj
6-
.vs
4+
bin/
5+
obj/
6+
.vs/
77
codegen/.generated/
88
codegen/debug*.json
9+
.idea/
10+
.vscode/

Makefile

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
.PHONY: all
2+
all: sdk
3+
4+
.PHONY: format
5+
format: format-black
6+
7+
.PHONY: format-black
8+
format-black:
9+
python -m black --line-length=120 -v .
10+
11+
.PHONY: swagger
12+
swagger:
13+
./scripts/update_swagger_spec.bash
14+
15+
.PHONY: openapi
16+
openapi:
17+
curl "https://converter.swagger.io/api/convert?url=https://api.aspose.cloud/v3.0/barcode/swagger/spec" | jq '.' > spec/aspose-barcode-cloud-openapi.json
18+
19+
# Mark parameters as deprecated
20+
.PHONY: deprecated
21+
deprecated: openapi
22+
jq '.paths[][].parameters? |= map(if .description and (.description | startswith("DEPRECATED:")) then . + {"deprecated": true} else . end)' spec/aspose-barcode-cloud-openapi.json > spec/aspose-barcode-cloud-with-deprecated.json
23+
24+
25+
# Making all SDKs
26+
.PHONY: sdk
27+
sdk: android dart dotnet go java node php python
28+
29+
.PHONY: android
30+
android:
31+
cd codegen && ./generate-android.bash
32+
33+
.PHONY: dart
34+
dart:
35+
cd codegen && ./generate-dart.bash
36+
37+
.PHONY: dotnet
38+
dotnet:
39+
cd codegen && ./generate-dotnet.bash
40+
41+
.PHONY: go
42+
go:
43+
cd codegen && ./generate-go.bash
44+
45+
.PHONY: java
46+
java:
47+
cd codegen && ./generate-java.bash
48+
49+
.PHONY: node
50+
node:
51+
cd codegen && ./generate-node.bash
52+
53+
.PHONY: php
54+
php:
55+
cd codegen && ./generate-php.bash
56+
57+
.PHONY: python
58+
python:
59+
cd codegen && ./generate-python.bash

codegen/Templates/LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2022 Aspose Pty Ltd
3+
Copyright (c) 2023 Aspose Pty Ltd
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

codegen/Templates/android/README.mustache

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# {{artifactId}}
22

3+
[![Build Android App](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-android/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-android/actions/workflows/build.yml)
34
![API version: {{appVersion}}](https://img.shields.io/badge/api-v{{appVersion}}-lightgrey)
45
[![GitHub license](https://img.shields.io/github/license/aspose-barcode-cloud/aspose-barcode-cloud-android)](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-android)
56

@@ -101,4 +102,4 @@ All Aspose.BarCode for Cloud SDKs, helper scripts and templates are licensed und
101102
| [GitHub](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-dotnet) | [GitHub](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-java) | [GitHub](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-php) | [GitHub](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-python) | [GitHub](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-node) | [GitHub](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-android) |[GitHub](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-go)|
102103
| [NuGet](https://www.nuget.org/packages/Aspose.barcode-Cloud/) | [Maven](https://repository.aspose.cloud/webapp/#/artifacts/browse/tree/General/repo/com/aspose/aspose-barcode-cloud) | [Composer](https://packagist.org/packages/aspose/barcode-cloud-php) | [PIP](https://pypi.org/project/aspose-barcode-cloud/) | [NPM](https://www.npmjs.com/package/aspose-barcode-cloud-node) | [Maven](https://repository.aspose.cloud/webapp/#/artifacts/browse/tree/General/repo/com/aspose/aspose-barcode-cloud) |[Go.Dev](https://pkg.go.dev/github.com/aspose-barcode-cloud/aspose-barcode-cloud-go/) |
103104

104-
[Product Page](https://products.aspose.cloud/barcode/) | [Documentation](https://docs.aspose.cloud/display/barcodecloud/Home) | [API Reference](https://apireference.aspose.cloud/barcode/) | [Code Samples](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-android) | [Blog](https://blog.aspose.cloud/category/barcode/) | [Free Support](https://forum.aspose.cloud/c/barcode) | [Free Trial](https://dashboard.aspose.cloud/#/apps)
105+
[Product Page](https://products.aspose.cloud/barcode/) | [Documentation](https://docs.aspose.cloud/display/barcodecloud/Home) | [API Reference](https://apireference.aspose.cloud/barcode/) | [Code Samples](https://github.com/aspose-barcode-cloud/aspose-barcode-cloud-android) | [Blog](https://blog.aspose.cloud/categories/aspose.barcode-cloud-product-family/) | [Free Support](https://forum.aspose.cloud/c/barcode) | [Free Trial](https://dashboard.aspose.cloud/#/apps)

codegen/Templates/android/apiException.mustache

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import java.io.File
3131
import java.io.FileOutputStream
3232
import kotlin.math.floor
3333

34+
3435
class MainActivity : AppCompatActivity() {
3536
companion object {
3637
const val PERMISSION_REQUEST_CALLBACK_CODE = 1
@@ -125,11 +126,12 @@ class MainActivity : AppCompatActivity() {
125126
requestCode: Int,
126127
permissions: Array<String>, grantResults: IntArray
127128
) {
129+
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
128130
when (requestCode) {
129131
PERMISSION_REQUEST_CALLBACK_CODE -> {
130132
// If request is cancelled, the result arrays are empty.
131133
if ((grantResults.isNotEmpty() &&
132-
grantResults[0] == PackageManager.PERMISSION_GRANTED)
134+
grantResults[0] == PackageManager.PERMISSION_GRANTED)
133135
) {
134136
// Permission is granted. Continue the action or workflow
135137
// in your app.
@@ -153,6 +155,7 @@ class MainActivity : AppCompatActivity() {
153155
}
154156
}
155157

158+
156159
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
157160
super.onActivityResult(requestCode, resultCode, data)
158161
@@ -169,15 +172,16 @@ class MainActivity : AppCompatActivity() {
169172
if (resultCode == RESULT_OK) {
170173
val bmpImage = data?.extras?.get("data") as Bitmap
171174
recognizeBarcode(bmpImage)
175+
}
172176
}
173-
}
174177

175178
else -> {
176179
showErrorMessage("No file selected")
177180
}
178181
}
179182
}
180183

184+
181185
private fun recognizeBarcode(image: Bitmap) {
182186
try {
183187
val smallerBmp = reduceBitmapSize(image)
@@ -215,7 +219,7 @@ class MainActivity : AppCompatActivity() {
215219
stopRecognizeAnimation()
216220
217221
var message = e.message + ": " + e.details
218-
if (e.code == 0) {
222+
if (e.httpCode == 0) {
219223
message = "Check ClientId and ClientSecret in ApiClient $message"
220224
}
221225
showErrorMessage(message)
@@ -260,7 +264,7 @@ class MainActivity : AppCompatActivity() {
260264
} catch (e: ApiException) {
261265
runOnUiThread {
262266
var message = e.message + ": " + e.details
263-
if (e.code == 0) {
267+
if (e.httpCode == 0) {
264268
message = "Check ClientId and ClientSecret in ApiClient $message"
265269
}
266270
showErrorMessage(message)
@@ -287,8 +291,12 @@ class MainActivity : AppCompatActivity() {
287291
private fun pickFile() {
288292
val getContentIntent = Intent(Intent.ACTION_GET_CONTENT)
289293
getContentIntent.type = "image/*"
290-
if (getContentIntent.resolveActivity(packageManager) != null) {
291-
startActivityForResult(getContentIntent, ACTION_GET_CONTENT_CALLBACK_CODE)
294+
getContentIntent.addCategory(Intent.CATEGORY_OPENABLE)
295+
try {
296+
startActivityForResult(Intent.createChooser(getContentIntent, "Select an Image to Recognize"), ACTION_GET_CONTENT_CALLBACK_CODE)
297+
} catch (ex: java.lang.Exception) {
298+
showErrorMessage("Unable to start file selector")
292299
}
300+
293301
}
294302
}
Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,7 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2-
buildscript {
3-
ext.kotlin_version = '1.4.31'
4-
repositories {
5-
google()
6-
mavenCentral()
7-
}
8-
dependencies {
9-
classpath 'com.android.tools.build:gradle:{{{androidGradleVersion}}}'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
12-
// NOTE: Do not place your application dependencies here; they belong
13-
// in the individual module build.gradle files
14-
}
15-
}
16-
17-
allprojects {
18-
repositories {
19-
google()
20-
mavenCentral()
21-
}
22-
}
23-
24-
task clean(type: Delete) {
25-
delete rootProject.buildDir
2+
plugins {
3+
id 'com.android.application' version '7.4.0' apply false
4+
id 'com.android.library' version '7.4.0' apply false
5+
id 'org.jetbrains.kotlin.android' version '1.7.21' apply false
266
}
7+
ext.kotlin_version = '1.7.21'

codegen/Templates/android/git_push.sh.mustache

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,18 @@
77
# http://www.gradle.org/docs/current/userguide/build_environment.html
88
# Specifies the JVM arguments used for the daemon process.
99
# The setting is particularly useful for tweaking memory settings.
10-
org.gradle.jvmargs=-Xmx2048m
10+
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
1111
# When configured, Gradle will run in incubating parallel mode.
1212
# This option should only be used with decoupled projects. More details, visit
1313
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1414
# org.gradle.parallel=true
1515
# AndroidX package structure to make it clearer which packages are bundled with the
16-
# Android operating system, and which are packaged with your app"s APK
16+
# Android operating system, and which are packaged with your app's APK
1717
# https://developer.android.com/topic/libraries/support-library/androidx-rn
1818
android.useAndroidX=true
19-
# Automatically convert third-party libraries to use AndroidX
20-
android.enableJetifier=true
2119
# Kotlin code style for this project: "official" or "obsolete":
2220
kotlin.code.style=official
21+
# Enables namespacing of each library's R class so that its R class includes only the
22+
# resources declared in the library itself and none from the library's dependencies,
23+
# thereby reducing the size of the R class for that library
24+
android.nonTransitiveRClass=true
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# macOS
2+
.DS_Store
3+
4+
# Built application files
5+
*.apk
6+
*.ap_
7+
8+
# Files for the Dalvik VM
9+
*.dex
10+
11+
# Java class files
12+
*.class
13+
14+
# Generated files
15+
bin/
16+
gen/
17+
out/
18+
19+
# Gradle files
20+
.gradle/
21+
build/
22+
23+
# Local configuration file (sdk path, etc)
24+
local.properties
25+
26+
# Proguard folder generated by Eclipse
27+
proguard/
28+
29+
# Log Files
30+
*.log
31+
32+
# Android Studio Navigation editor temp files
33+
.navigation/
34+
35+
# Android Studio captures folder
36+
captures/
37+
38+
# Intellij
39+
.idea/
40+
*.iml
41+
42+
# Keystore files
43+
*.jks

0 commit comments

Comments
 (0)