Skip to content
Permalink
Browse files

fix: no effects while building with java8

  • Loading branch information...
firefly1126 committed Dec 13, 2017
1 parent 16b1fc4 commit ceab2726c0a574f6df28382eb5e75d7ecfc512ee
@@ -1,3 +1,7 @@
### v1.1.1(2017-12-12)
* fix: no effects while building with java8
* this version disable `includeJarFilter` and `excludeJarFilter`configuration, and will be fixed in the next version.

### v1.1.0(2017-11-02)
* fix: exception occurs on android plugin 3.0.0: "Unexpected scopes found in folder xx, Required: PROJECT, SUB_PROJECTS, EXTERNAL_LIBRARIES. Found: EXTERNAL_LIBRARIES, PROJECT, PROJECT_LOCAL_DEPS, SUB_PROJECTS, SUB_PROJECTS_LOCAL_DEPS

@@ -25,6 +25,7 @@ import com.android.build.api.transform.Transform
import com.android.build.api.transform.TransformException
import com.android.build.api.transform.TransformInput
import com.android.build.api.transform.TransformOutputProvider
import com.android.build.gradle.internal.pipeline.TransformTask
import com.google.common.collect.ImmutableSet
import org.aspectj.util.FileUtil
import org.gradle.api.Project
@@ -38,9 +39,6 @@ import org.gradle.api.tasks.compile.JavaCompile
* @since 2016-03-29
*/
class AspectTransform extends Transform {

static final ASPECTJRT = "aspectjrt"

Project project
String encoding
String bootClassPath
@@ -107,25 +105,42 @@ class AspectTransform extends Transform {
, TransformOutputProvider outputProvider
, boolean isIncremental) throws IOException, TransformException, InterruptedException {

def hasAjRt = false
for (TransformInput transformInput : inputs) {
for (JarInput jarInput : transformInput.jarInputs) {
if (jarInput.file.absolutePath.contains(ASPECTJRT)) {
hasAjRt = true
break
}
TransformTask transformTask = (TransformTask)context

println "task name:" + transformTask.variantName
println("isIncremental:" + isIncremental)
for (TransformInput input : inputs) {
println "inputs-jar>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
for (JarInput jInput : input.jarInputs) {
println(jInput.file.absolutePath)
}

println "inputs-dir>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
for (DirectoryInput dInput : input.directoryInputs) {
println(dInput.file.absolutePath)
}
}

for (TransformInput input : referencedInputs) {
println "referenced Input jar>>>>>>>>>>>>>>>>>>>>>>>>>>>"
for (JarInput jInput : input.jarInputs) {
println(jInput.file.absolutePath)
}

println "referenced Input dir>>>>>>>>>>>>>>>>>>>>>>>>>>>"
for (DirectoryInput dInput : input.directoryInputs) {
println(dInput.file.absolutePath)
}
if (hasAjRt) break
}

println "inputs end<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<"

//clean
if (!isIncremental){
outputProvider.deleteAll()
}

if (hasAjRt){
doAspectTransform(outputProvider, inputs)
} else {
if (transformTask.variantName.contains("AndroidTest")){
println "there is no aspectjrt dependencies in classpath, do nothing "
inputs.each {TransformInput input ->
input.directoryInputs.each {DirectoryInput directoryInput->
@@ -145,6 +160,8 @@ class AspectTransform extends Transform {
println "jarInput = ${jarInput.name}"
}
}
} else {
doAspectTransform(outputProvider, inputs)
}
}

@@ -17,15 +17,19 @@ allprojects {
repositories {
mavenLocal()
mavenCentral()
jcenter()
jcenter {
url 'http://jcenter.bintray.com'
}
}
}

dependencies {
repositories {
mavenLocal()
mavenCentral()
jcenter()
jcenter {
url 'http://jcenter.bintray.com'
}
}
}

@@ -1,6 +1,6 @@
LIB_GROUP=com.hujiang.aspectjx
LIB_ARTIFACT = gradle-android-plugin-aspectjx
LIB_VERSION=1.1.0
LIB_VERSION=1.1.1
LIB_DES=A Gradle plugin which enables AspectJ for Android builds. supports Kotlin, aar, jar aspect
LIB_ISRELEASE=true

Binary file not shown.

2 comments on commit ceab272

@greedbell

This comment has been minimized.

Copy link

greedbell replied Apr 3, 2018

cool

@wangzhzh

This comment has been minimized.

Copy link

wangzhzh replied Apr 4, 2018

你好!

我们 merge 这个修改之后,会报如下错误:
java.lang.ClassCastException: org.aspectj.apache.bcel.classfile.ConstantClass cannot be cast to org.aspectj.apache.bcel.classfile.ConstantUtf8

请问一下知道是什么原因导致的吗?

谢谢

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.