Skip to content

Commit

Permalink
Upgrade targetSdk and compileSdk to 34
Browse files Browse the repository at this point in the history
  • Loading branch information
xmaihh committed Aug 11, 2023
1 parent c07dab4 commit 1952fb7
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 27 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<!--<img src="https://github.com/xmaihh/Android-Serialport/raw/master/art/compile_env.png" width="80%" height="80%" align="middle" alt="编译环境"/>-->
<img src ="https://github.com/xmaihh/Android-Serialport/blob/master/art/logo.svg" height = 150 alt ="Android-Serialport"/>

[![GitHub forks](https://img.shields.io/github/forks/xmaihh/Android-Serialport.svg)](https://github.com/xmaihh/Android-Serialport/network)[![GitHub issues](https://img.shields.io/github/issues/xmaihh/Android-Serialport.svg)](https://github.com/xmaihh/Android-Serialport/issues)[![GitHub stars](https://img.shields.io/github/stars/xmaihh/Android-Serialport.svg)](https://github.com/xmaihh/Android-Serialport/stargazers)[![Source persent](https://img.shields.io/badge/Java-73.2%25-brightgreen.svg)](https://github.com/xmaihh/Android-Serialport/search?l=C)[![Jcenter2.1](https://img.shields.io/badge/jcenter-2.1-brightgreen.svg)](https://bintray.com/xmaihh/maven/serialport)![Maven Central](https://img.shields.io/maven-central/v/io.github.xmaihh/serialport)[![Demo apk download](https://img.shields.io/crates/dv/rustc-serialize.svg)](https://fir.im/lcuy)
[![AppVeyor branch](https://img.shields.io/appveyor/ci/:user/:repo/:branch.svg)](https://github.com/xmaihh/Android-Serialport/tree/master)[![GitHub license](https://img.shields.io/github/license/xmaihh/Android-Serialport.svg)](https://github.com/xmaihh/Android-Serialport)
[![GitHub forks](https://img.shields.io/github/forks/xmaihh/Android-Serialport.svg)](https://github.com/xmaihh/Android-Serialport/network)[![GitHub issues](https://img.shields.io/github/issues/xmaihh/Android-Serialport.svg)](https://github.com/xmaihh/Android-Serialport/issues)[![GitHub stars](https://img.shields.io/github/stars/xmaihh/Android-Serialport.svg)](https://github.com/xmaihh/Android-Serialport/stargazers)[![Source persent](https://img.shields.io/badge/Java-73.2%25-brightgreen.svg)](https://github.com/xmaihh/Android-Serialport/search?l=C)[![Jcenter2.1](https://img.shields.io/badge/jcenter-2.1-brightgreen.svg)](https://bintray.com/xmaihh/maven/serialport)![Maven Central](https://img.shields.io/maven-central/v/io.github.xmaihh/serialport)
[![GitHub license](https://img.shields.io/github/license/xmaihh/Android-Serialport.svg)](https://github.com/xmaihh/Android-Serialport)

# 文档

Expand Down Expand Up @@ -131,6 +131,6 @@ PC端调试工具 [友善串口调试工具](https://github.com/xmaihh/Android-S

# FAQ
* 此library不提供ROOT权限,请自行打开串口`666`权限
```
```shell
adb shell chmod 666 /dev/ttyS1
```
9 changes: 6 additions & 3 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ Porting Google's official serial port library [android-serialport-api](https://c
<!--<img src="https://github.com/xmaihh/Android-Serialport/raw/master/art/compile_env.png" width="80%" height="80%" align="middle" alt="编译环境"/>-->
<img src ="https://github.com/xmaihh/Android-Serialport/blob/master/art/logo.svg" height = 150 alt ="Android-Serialport"/>

[![GitHub forks](https://img.shields.io/github/forks/xmaihh/Android-Serialport.svg)](https://github.com/xmaihh/Android-Serialport/network)[![GitHub issues](https://img.shields.io/github/issues/xmaihh/Android-Serialport.svg)](https://github.com/xmaihh/Android-Serialport/issues)[![GitHub stars](https://img.shields.io/github/stars/xmaihh/Android-Serialport.svg)](https://github.com/xmaihh/Android-Serialport/stargazers)[![Source persent](https://img.shields.io/badge/Java-73.2%25-brightgreen.svg)](https://github.com/xmaihh/Android-Serialport/search?l=C)[![Jcenter2.1](https://img.shields.io/badge/jcenter-2.1-brightgreen.svg)](https://bintray.com/xmaihh/maven/serialport)![Maven Central](https://img.shields.io/maven-central/v/io.github.xmaihh/serialport)[![Demo apk download](https://img.shields.io/crates/dv/rustc-serialize.svg)](https://fir.im/lcuy)
[![AppVeyor branch](https://img.shields.io/appveyor/ci/:user/:repo/:branch.svg)](https://github.com/xmaihh/Android-Serialport/tree/master)[![GitHub license](https://img.shields.io/github/license/xmaihh/Android-Serialport.svg)](https://github.com/xmaihh/Android-Serialport)
[![GitHub forks](https://img.shields.io/github/forks/xmaihh/Android-Serialport.svg)](https://github.com/xmaihh/Android-Serialport/network)[![GitHub issues](https://img.shields.io/github/issues/xmaihh/Android-Serialport.svg)](https://github.com/xmaihh/Android-Serialport/issues)[![GitHub stars](https://img.shields.io/github/stars/xmaihh/Android-Serialport.svg)](https://github.com/xmaihh/Android-Serialport/stargazers)[![Source persent](https://img.shields.io/badge/Java-73.2%25-brightgreen.svg)](https://github.com/xmaihh/Android-Serialport/search?l=C)[![Jcenter2.1](https://img.shields.io/badge/jcenter-2.1-brightgreen.svg)](https://bintray.com/xmaihh/maven/serialport)![Maven Central](https://img.shields.io/maven-central/v/io.github.xmaihh/serialport)
[![GitHub license](https://img.shields.io/github/license/xmaihh/Android-Serialport.svg)](https://github.com/xmaihh/Android-Serialport)

# Document

Expand Down Expand Up @@ -114,7 +114,7 @@ PC-side debugging tools [Serial debugging tool for Win](https://github.com/xmai
## [2.1.2](https://github.com/xmaihh/Android-Serialport/tree/v2.1.2)
### Added
- Add support for setting parity: 0 parity(SPACE), 1 parity(MARK)
- Added support for setting custom baud rate [issues#26](https://github.com/xmaihh/Android-Serialport/issues/26)
- Added support for setting custom baud rate [issues#26](https://github.com/xmaihh/Android-Serialport/issues/26)

## [2.1.1](https://github.com/xmaihh/Android-Serialport/tree/v2.1.1)
### Fixed
Expand All @@ -135,6 +135,9 @@ PC-side debugging tools [Serial debugging tool for Win](https://github.com/xmai


# FAQ

![Watch out](https://img.shields.io/badge/Watch%20out%20-FF4081)

* This library does not provide ROOT permissions, please open the serial port '666' permissions yourself.
```
adb shell chmod 666 /dev/ttyS1
Expand Down
26 changes: 16 additions & 10 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 32
compileSdk 34
defaultConfig {
applicationId "com.ex.serialport"
minSdkVersion 14
targetSdkVersion 32
versionCode 1
versionName "1.0"

minSdk 14
targetSdk 34
versionCode gitVersionCode
versionName gitVersionName
}
buildTypes {
release {
minifyEnabled false
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
android.applicationVariants.configureEach { variant ->
variant.outputs.configureEach { output ->
def fileName = "AndroidSerialportSample-${defaultConfig.versionCode}_${defaultConfig.versionName}.apk"
outputFileName = fileName
}
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.4.2'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.recyclerview:recyclerview:1.3.1'
implementation 'com.github.CymChad:BaseRecyclerViewAdapterHelper:3.0.7'
implementation project(path: ':serialport')
// implementation 'io.github.xmaihh:serialport:2.1.1'
// implementation 'io.github.xmaihh:serialport:2.1.2'
}

25 changes: 21 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,27 +1,44 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {

repositories {
mavenLocal()
google()
mavenCentral()
maven { url 'https://jitpack.io' }
gradlePluginPortal()
maven {
url = uri("https://plugins.gradle.org/m2/")
}
maven { url = uri("https://jitpack.io") }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.android.tools.build:gradle:7.4.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'org.ajoberstar.grgit:grgit-gradle:5.2.0'
}
}

allprojects {
repositories {
mavenLocal()
google()
mavenCentral()
maven { url 'https://jitpack.io' }
gradlePluginPortal()
maven {
url = uri("https://plugins.gradle.org/m2/")
}
maven { url = uri("https://jitpack.io") }
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

ext {
Grgit = org.ajoberstar.grgit.Grgit
}

apply from: 'versions.gradle'
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 @@
#Tue Jun 21 10:59:24 CST 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
10 changes: 4 additions & 6 deletions serialport/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 32
compileSdk 34

defaultConfig {
minSdkVersion 14
targetSdkVersion 32
versionCode 11
minSdk 14
targetSdk 34
versionCode 13
versionName "2.1.2"

}

buildTypes {
Expand All @@ -23,6 +22,5 @@ android {
path "CMakeLists.txt"
}
}

}

49 changes: 49 additions & 0 deletions versions.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
ext {
git = rootProject.ext.Grgit.open(currentDir: projectDir)
gitBranchName = git.branch.current().name
gitVersionName = git.describe(tags: true)
gitVersionCode = git.tag.list().size()
gitVersionCodeTime = git.head().dateTime.toEpochSecond().intValue()

task printVersion() {
println("Version Name: $gitVersionName")
println("Version Code: $gitVersionCode")
println("Version Code Time: $gitVersionCodeTime")
}
}

def buildTime() {
def date = new Date()
def formattedDate = date.format('yyyyMMdd_HHmm')
return formattedDate
}

ext.gitBranchName = {
def branch = ""
def proc = "git rev-parse --abbrev-ref HEAD".execute()
proc.in.eachLine { line -> branch = line }
proc.err.eachLine { line -> println line }
proc.waitFor()
return branch
}

ext.getGitHeadRefsSuffix = {
try {
def headFile = new File(rootDir.getParent(), '.git/HEAD')
if (headFile.exists()) {
String[] strings = headFile.getText('UTF-8').split(" ")
if (strings.size() > 1) {
def refHeadFile = new File(rootDir.getParent(), '.git/' + strings[1])
String refFilePath = refHeadFile.getPath()
def refFile = new File(refFilePath.replace("\n", ""))
return refFile.getText('UTF-8').substring(0, 7)
}
} else {
return "headFile"
}
} catch (Exception e) {
logger.log(LogLevel.ERROR, e.getMessage())
return "error"
}
return "default_version"
}

0 comments on commit 1952fb7

Please sign in to comment.