Skip to content

Commit

Permalink
Feature: fix win support
Browse files Browse the repository at this point in the history
  • Loading branch information
owenlongbo committed Mar 31, 2020
1 parent b38918e commit a41d7a0
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
3 changes: 2 additions & 1 deletion README-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ McImage是无侵入式的全量压缩资源图片插件
### Update Log

> v0.0.2以后的用户更新到0.0.2以上需要升级你的mctools文件夹,已经上传到release。
- 1.5.1 : 修改对win的支持
- 1.5.0 : 更新gradle plugin 到 3.5.0 ,更新获取android资源方式,修复了不支持缩写(assembleDebug 缩写 aD)的问题
- 1.4.0 : 区分优化类型,可选择ConvertWep或Compress, 默认选择Compress. 使用ConvertWep需要min sdk >= 18.但是压缩效果更好
- 1.3.0 : 支持多线程压缩,缩短执行时间
Expand Down Expand Up @@ -61,7 +62,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.smallsoho.mobcase:McImage:1.5.0'
classpath 'com.smallsoho.mobcase:McImage:1.5.1'
}
}
```
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ The version 1.0.1 now support all build.gradle version!
### Update Log

> The user use v0.0.2 update plugin need update your mctools dir together.
- 1.5.1 : Fix windows support
- 1.5.0 : Update gradle plugin to 3.5.0 , change the get android resources way,fix not support abbreviation(such as assembleDebug use aD) bug.
- 1.4.0 : Feature, Support for selecting different optimization types,"ConvertWebp" or "Compress" can be chosen.Default "Compress". "CompressWebp" is a better compression ratio but it don't support api < 18
- 1.3.0 : Feature, Support multi-thread processing
Expand Down Expand Up @@ -61,7 +62,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.smallsoho.mobcase:McImage:1.5.0'
classpath 'com.smallsoho.mobcase:McImage:1.5.1'
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion bintray.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ apply plugin: 'com.jfrog.bintray'
def siteUrl = 'https://github.com/smallSohoSolo/McImage'
def gitUrl = 'https://github.com/smallSohoSolo/McImage.git'
group = "com.smallsoho.mobcase"
version = "1.5.0"
version = "1.5.1"

Properties properties = new Properties()
properties.load(project.rootProject.file('local.properties').newDataInputStream())
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {

dependencies {
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.71"
}
}

Expand Down
11 changes: 5 additions & 6 deletions src/main/java/com/smallsoho/mcplugin/image/utils/Tools.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ class Tools {
val cmdStr = if (isCmdExist(cmd)) {
"$cmd $params"
} else {
val system = System.getProperty("os.name")
when (system) {
"Mac OS X" ->
when {
isMac() ->
FileUtil.getToolsDirPath() + "mac/" + "$cmd $params"
"Linux" ->
isLinux() ->
FileUtil.getToolsDirPath() + "linux/" + "$cmd $params"
"Windows" ->
isWindows() ->
FileUtil.getToolsDirPath() + "windows/" + "$cmd $params"
else -> ""
}
Expand All @@ -43,7 +42,7 @@ class Tools {

fun isWindows(): Boolean {
val system = System.getProperty("os.name")
return system.startsWith("Windows")
return system.toLowerCase().contains("win")
}

fun chmod() {
Expand Down

0 comments on commit a41d7a0

Please sign in to comment.