File tree Expand file tree Collapse file tree 3 files changed +50
-7
lines changed Expand file tree Collapse file tree 3 files changed +50
-7
lines changed Original file line number Diff line number Diff line change
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
+
Original file line number Diff line number Diff line change @@ -10,9 +10,9 @@ buildscript {
10
10
jcenter()
11
11
}
12
12
dependencies {
13
- classpath ' com.android.tools.build:gradle:3.1.4 '
13
+ classpath ' com.android.tools.build:gradle:3.0.0 '
14
14
classpath " com.wanjian.plugin:tinypng:1.0.0-SNAPSHOT"
15
-
15
+ classpath ' com.novoda:bintray-release:0.8.0 '
16
16
17
17
// NOTE: Do not place your application dependencies here; they belong
18
18
// in the individual module build.gradle files
Original file line number Diff line number Diff line change 1
1
apply plugin : ' groovy'
2
2
apply plugin : ' maven'
3
+ apply plugin : ' com.novoda.bintray-release'
3
4
repositories {
4
5
mavenLocal()
5
6
jcenter()
6
7
}
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
+ }
7
19
8
20
dependencies {
9
21
compile gradleApi()
@@ -14,11 +26,34 @@ group 'com.wanjian.plugin'
14
26
version ' 1.0.0-SNAPSHOT'
15
27
16
28
sourceCompatibility = 1.8
29
+ //
30
+ // uploadArchives {
31
+ // repositories {
32
+ // mavenDeployer {
33
+ // repository(url: uri('./repo'))
34
+ // }
35
+ // }
36
+ // }
17
37
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" )
23
44
}
24
45
}
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
+
You can’t perform that action at this time.
0 commit comments