Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
沉迷打码的小凳子
glide
提交
a0e388e2
G
glide
项目概览
沉迷打码的小凳子
/
glide
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
glide
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
a0e388e2
编写于
9月 09, 2017
作者:
R
Robert Papp
提交者:
Sam Judd
9月 14, 2017
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Repackage annotation compiler dependencies to prevent conflicts
Fixes #2059
上级
ec9f7a32
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
105 addition
and
2 deletion
+105
-2
annotation/compiler/build.gradle
annotation/compiler/build.gradle
+83
-2
annotation/compiler/libs/jarjar-1.4.jar
annotation/compiler/libs/jarjar-1.4.jar
+0
-0
annotation/compiler/proguard.pro
annotation/compiler/proguard.pro
+22
-0
未找到文件。
annotation/compiler/build.gradle
浏览文件 @
a0e388e2
import
org.gradle.internal.jvm.Jvm
import
java.nio.file.Files
import
static
java
.
nio
.
file
.
StandardCopyOption
.*
apply
plugin:
'java'
configurations
{
// adapted from https://android.googlesource.com/platform/frameworks/testing/+/976c423/espresso/espresso-lib/build.gradle
// compileOnly dependencies will be repackaged, see rules in jarjar ant task below
jarjar
}
dependencies
{
compile
'com.squareup:javapoet:1.9.0'
compile
'com.google.auto.service:auto-service:1.0-rc3'
// from https://code.google.com/archive/p/jarjar/downloads
jarjar
files
(
'libs/jarjar-1.4.jar'
)
compileOnly
'com.squareup:javapoet:1.9.0'
compileOnly
'com.google.auto.service:auto-service:1.0-rc3'
compile
'com.google.code.findbugs:jsr305:3.0.1'
compile
project
(
':annotation'
)
// This is to support com.sun.tootls.javac.util.List, currently used in RootModuleGenerator.
...
...
@@ -14,4 +26,73 @@ dependencies {
testCompile
'com.google.testing.compile:compile-testing:0.10'
}
afterEvaluate
{
// generate file names for each step
def
resultingClassesJar
=
tasks
.
jar
.
archivePath
def
originalClassifier
=
tasks
.
jar
.
classifier
tasks
.
jar
.
classifier
=
'compiled'
def
compiledClassesJar
=
tasks
.
jar
.
archivePath
tasks
.
jar
.
classifier
=
'repackaged'
def
repackagedClassesJar
=
tasks
.
jar
.
archivePath
tasks
.
jar
.
classifier
=
'proguarded'
def
proguardedClassesJar
=
tasks
.
jar
.
archivePath
tasks
.
jar
.
classifier
=
originalClassifier
tasks
.
jar
.
doLast
{
Files
.
copy
(
resultingClassesJar
.
toPath
(),
compiledClassesJar
.
toPath
(),
REPLACE_EXISTING
)
}
// Inject a jarjar task after jar into the assemble chain.
// afterEvaluate is needed to get the resolved version name for the jar artifact.
task
jarjar
(
dependsOn:
[
tasks
.
jar
,
configurations
.
compileOnly
])
{
tasks
.
assemble
.
dependsOn
it
// Set up inputs and outputs to only rebuild when necessary (code change, dependency change).
inputs
.
file
compiledClassesJar
inputs
.
files
configurations
.
compileOnly
outputs
.
file
repackagedClassesJar
doFirst
{
ant
{
taskdef
name:
'jarjar'
,
classname:
'com.tonicsystems.jarjar.JarJarTask'
,
classpath:
configurations
.
jarjar
.
asPath
// Generate the original JAR output where it was originally expected.
jarjar
(
jarfile:
repackagedClassesJar
)
{
configurations
.
compileOnly
.
resolve
().
each
{
zipfileset
(
src:
it
.
absolutePath
,
excludes:
[
'META-INF/maven/**'
,
'META-INF/services/javax.annotation.processing.Processor'
].
join
(
','
))
}
zipfileset
(
src:
tasks
.
jar
.
archivePath
)
def
repackageIntoGlide
=
'com.bumptech.glide.repackaged.@0'
rule
result:
repackageIntoGlide
,
pattern:
'com.squareup.javapoet.**'
rule
result:
repackageIntoGlide
,
pattern:
'com.google.auto.**'
rule
result:
repackageIntoGlide
,
pattern:
'com.google.common.**'
rule
result:
repackageIntoGlide
,
pattern:
'com.google.thirdparty.publicsuffix.**'
}
}
}
doLast
{
Files
.
copy
(
repackagedClassesJar
.
toPath
(),
resultingClassesJar
.
toPath
(),
REPLACE_EXISTING
)
}
}
task
proguard
(
type:
proguard
.
gradle
.
ProGuardTask
,
dependsOn:
tasks
.
jarjar
)
{
tasks
.
assemble
.
dependsOn
it
configuration
'proguard.pro'
injars
repackagedClassesJar
outjars
proguardedClassesJar
libraryjars
files
(
configurations
.
compile
.
collect
())
libraryjars
"${System.getProperty('java.home')}/lib/rt.jar"
doLast
{
Files
.
copy
(
proguardedClassesJar
.
toPath
(),
resultingClassesJar
.
toPath
(),
REPLACE_EXISTING
)
}
}
}
apply
from:
"${rootProject.projectDir}/scripts/upload.gradle"
annotation/compiler/libs/jarjar-1.4.jar
0 → 100644
浏览文件 @
a0e388e2
文件已添加
annotation/compiler/proguard.pro
0 → 100644
浏览文件 @
a0e388e2
-
verbose
#
Use
ProGuard
only
to
get
rid
of
unused
classes
-
dontobfuscate
-
dontoptimize
-
keepattributes
*
-
keep
class
!
com
.
bumptech
.
glide
.
repackaged
.
**,
com
.
bumptech
.
glide
.
**
#
Keep
the
entry
point
to
this
library
,
see
META
-
INF
\
services
\
javax
.
annotation
.
processing
.
Processor
-
keep
class
com
.
bumptech
.
glide
.
annotation
.
compiler
.
GlideAnnotationProcessor
#
"duplicate definition of library class"
-
dontnote
sun
.
applet
.
**
#
"duplicate definition of library class"
-
dontnote
sun
.
tools
.
jar
.
**
#
Reflective
accesses
in
com
.
google
.
common
.
util
.
concurrent
.
*
and
some
others
-
dontnote
com
.
bumptech
.
glide
.
repackaged
.
com
.
google
.
common
.
**
#
com
.
google
.
common
.
collect
.
*
and
some
others
(
…
.
common
.
*.*
)
-
dontwarn
com
.
google
.
j2objc
.
annotations
.
Weak
#
com
.
google
.
common
.
util
.
concurrent
.
FuturesGetChecked
$
GetCheckedTypeValidatorHolder
$
ClassValueValidator
-
dontwarn
org
.
codehaus
.
mojo
.
animal_sniffer
.
IgnoreJRERequirement
#-
dontwarn
**
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录