Skip to content

Commit ba0d327

Browse files
author
wanjian
committed
no message
1 parent 9bb7357 commit ba0d327

File tree

3 files changed

+50
-7
lines changed

3 files changed

+50
-7
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
## TinyPng Plugin
2+
3+
* 兼容Android Gradle Plugin 2.x-3.x
4+
* 自动识别sourceSets,无需为tinypng plugin配置资源路径
5+
* 可配置若干api key,压缩失败自动更换api key,避免每月500上限
6+
* 自动忽略9.png图片
7+
* 可配置图片白名单
8+

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ buildscript {
1010
jcenter()
1111
}
1212
dependencies {
13-
classpath 'com.android.tools.build:gradle:3.1.4'
13+
classpath 'com.android.tools.build:gradle:3.0.0'
1414
classpath "com.wanjian.plugin:tinypng:1.0.0-SNAPSHOT"
15-
15+
classpath 'com.novoda:bintray-release:0.8.0'
1616

1717
// NOTE: Do not place your application dependencies here; they belong
1818
// in the individual module build.gradle files

tinypng/build.gradle

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
apply plugin: 'groovy'
22
apply plugin: 'maven'
3+
apply plugin: 'com.novoda.bintray-release'
34
repositories {
45
mavenLocal()
56
jcenter()
67
}
8+
buildscript {
9+
repositories {
10+
mavenCentral()
11+
jcenter()
12+
google()
13+
}
14+
dependencies {
15+
classpath 'com.android.tools.build:gradle:3.0.0'
16+
classpath 'com.novoda:bintray-release:0.8.0'
17+
}
18+
}
719

820
dependencies {
921
compile gradleApi()
@@ -14,11 +26,34 @@ group 'com.wanjian.plugin'
1426
version '1.0.0-SNAPSHOT'
1527

1628
sourceCompatibility = 1.8
29+
//
30+
//uploadArchives {
31+
// repositories {
32+
// mavenDeployer {
33+
// repository(url: uri('./repo'))
34+
// }
35+
// }
36+
//}
1737

18-
uploadArchives {
19-
repositories {
20-
mavenDeployer {
21-
repository(url: uri('./repo'))
22-
}
38+
def getKey() {
39+
Properties properties = new Properties()
40+
File propertyFile = new File(rootDir.getAbsolutePath() + "/local.properties")
41+
if (propertyFile.exists()) {
42+
properties.load(propertyFile.newDataInputStream())
43+
return properties.getProperty("jcenter_key")
2344
}
2445
}
46+
// clean -- build --- generatePomFileForReleasePublication---publishReleasePublicationToMabenLocal---bintrayUpload---publishing
47+
publish {
48+
groupId = 'com.wanjian.plugin'
49+
artifactId = 'tinypng'
50+
publishVersion = '0.0.1'
51+
desc = 'tiny png plugin 4 android'
52+
website = 'https://github.com/android-notes'
53+
54+
bintrayUser = 'wanjian' // 账户名
55+
bintrayKey = getKey() // 就是API key
56+
dryRun = false
57+
58+
}
59+

0 commit comments

Comments
 (0)