Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何运行Demo #1

Open
nicai1900 opened this issue Feb 24, 2019 · 4 comments
Open

如何运行Demo #1

nicai1900 opened this issue Feb 24, 2019 · 4 comments

Comments

@nicai1900
Copy link

nicai1900 commented Feb 24, 2019

如何运行Demo

  1. ASMSample项目先注释掉
// apply plugin: 'com.geektime.asm-plugin'
// classpath ("com.geektime.asm:asm-gradle-plugin:1.0") { changing = true }`
  1. 编译和发布asm-gradle-plugin 到本地maven
./gradlew buildAndPublishToLocalMaven
  1. 还原第1步注释掉的插件依赖,即可运行Demo
./gradlew installDebug
@yangpeiyong
Copy link

yangpeiyong commented Feb 26, 2019

  1. 还需要把根目录的classpath注释掉
    // classpath ("com.geektime.asm:asm-gradle-plugin:1.0") { changing = true }

@blank-space
Copy link

上面的第三步这样做也行:用As单独打开工程 ASMSample,编译运行

@SourceAdFlt
Copy link

如何运行Demo

  1. ASMSample项目先注释掉
// apply plugin: 'com.geektime.asm-plugin'
// classpath ("com.geektime.asm:asm-gradle-plugin:1.0") { changing = true }`
  1. 编译和发布asm-gradle-plugin 到本地maven
./gradlew buildAndPublishToLocalMaven
  1. 还原第1步注释掉的插件依赖,即可运行Demo
./gradlew installDebug

我的,还要修改以下3点,才能编译通过:
1 把项目的改为 distributionUrl=https://services.gradle.org/distributions/gradle-5.6.4-all.zip
2 项目的 buildscript{ dependencies { classpath 'com.android.tools.build:gradle:3.6.1' } }
3 asm-gradle-plugin module中的
dependencies {
compile 'com.android.tools.build:gradle:3.6.1' //从2.1.0改为3.6.1,否则com.android.build.gradle.internal.pipeline和com.android.build.api.transform包找不到
}

@PengleiYu
Copy link

1,project的build.gradle中注释掉自定义插件依赖
// classpath ("com.geektime.asm:asm-gradle-plugin:1.0") { changing = true }
2,project的setting.gradle中注释掉ASMSample项目
//include ':ASMSample'
3,执行
./gradlew buildAndPublishToLocalMaven
4,还原1、2的注释

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants