Gradel源码入门二
来源:互联网 发布:淘宝系统繁忙什么鬼 编辑:程序博客网 时间:2024/06/05 02:39
在org.gradle.launcher.bootstrap ProcessBootstrap.java中
private void runNoExit(String mainClassName, String[] args) throws Exception {//new DefaultModuleRegistry, 做了大量初始化的工作,查找classpath结构 ClassPathRegistry classPathRegistry = new DefaultClassPathRegistry(new DefaultClassPathProvider(new DefaultModuleRegistry())); ClassLoaderFactory classLoaderFactory = new DefaultClassLoaderFactory();//找到Ant相关的jar包, 分析jar包里面的 META-INF/MANIFEST.MF 属性 ClassPath antClasspath = classPathRegistry.getClassPath("ANT");//找gradle相关的包,分析gradle-launcher-2.x.jar 包里面的gradle-launcher-classpath.properties ClassPath runtimeClasspath = classPathRegistry.getClassPath("GRADLE_RUNTIME"); ClassLoader antClassLoader = classLoaderFactory.createIsolatedClassLoader(antClasspath); ClassLoader runtimeClassLoader = new MutableURLClassLoader(antClassLoader, runtimeClasspath); Thread.currentThread().setContextClassLoader(runtimeClassLoader); Class<?> mainClass = runtimeClassLoader.loadClass(mainClassName); Object entryPoint = mainClass.newInstance(); Method mainMethod = mainClass.getMethod("run", String[].class); mainMethod.invoke(entryPoint, new Object[]{args}); }
mainMethod
org.gradle.launcher.bootstrap.EntryPoint 的run函数这是由于public class Main extends EntryPoint
0 0
- Gradel源码入门二
- build.gradel
- linux gradel安装
- Android入门笔记之源码解析二
- 快速入门二 SSH2附带源码
- Rxjava2从入门到源码(二)
- Gradel文件配置(多渠道打包)
- 入门源码
- Gradel文件配置(自定义APK名称)
- 在Eclipse中导入gradel项目
- (二)入门
- 企业级Hadoop 2.x入门系列之二Hadoop 2.2.0源码编译
- Spring Web Flow 入门demo(二)与业务结合 附源码
- Spring Web Flow 入门demo(二)与业务结合 附源码
- TensorFlow 从入门到精通(二):MNIST 例程源码分析
- Spring Web Flow 入门demo(二)与业务结合 附源码
- Android Studio 的NDK 有关gradel的问题
- PHP入门源码
- tcp 3秒 timeout
- Linux - 如何查看USB设备信息
- hive中的外表EXTERNAL TABLE
- JAVA 单例模式与hashmap结合实现缓存
- Cocos2D-x之开发环境配置
- Gradel源码入门二
- 插值
- heartbeat+ldirectord+lvs nat
- web1800从远程到协同的服务一体化
- 黑马程序员——Java面向对象之一继承
- spring web.xml之servlet
- JAVA基础(三) web.xml 中的listener、 filter、servlet 加载顺序及其详解
- iOS给UIButton添加类别,批量添加Button
- 炒老板鱿鱼?提前转正~14k基础再加2K