OFBIz中build.gradle文件中关键词解释

import org.apache.tools.ant.filters.ReplaceTokens 导入一个类

apply plugin: 'java' 引入插件

apply from: 'common.gradle'引入gradle文件

ext.os = System.getProperty('os.name').toLowerCase() 

ext.pluginsDir = "${rootDir}/specialpurpose"

全局属性,”ext.XXX“

def jvmArguments = ['-Xms128M', '-Xmx1024M'] 这个应该是局部变零吧

ext.ofbizMainClass = 'org.apache.ofbiz.base.start.Start' 这个比较重要,启动类大笑


// Java compile options, syntax gradlew -PXlint build

tasks.withType(JavaCompile) {

    options.encoding = 'UTF-8'

    if (project.hasProperty('Xlint')) {

        options.compilerArgs << "-Xlint"

    }

}

编译时,设置的编码类型。task.withType 任务类型


def File gitFooterFile = file("${rootDir}/runtime/GitInfo.ftl")

def File svnFooterFile = file("${rootDir}/runtime/SvnInfo.ftl") 

def Object xxx 这也是一种定义类型

defaultTasks 'build' 默认任务

、、、、、、、、、、、、、、、、、、华丽的分割线、、、、、、、、、、、、、、、

allprojects {

    repositories{

        jcenter()

        mavenLocal()

    }

}


subprojects {

    configurations {

        // compile-time plugin libraries

        pluginLibsCompile

        // runtime plugin libraries

        pluginLibsRuntime

        //compile-only libraries

        pluginLibsCompileOnly

    }

}


configurations {

    junitReport {

        description = 'libraries needed to run junitreport for OFBiz unit tests'

    }

    ofbizPlugins {

        description = 'ofbiz plugin dependencies configuration'

        transitive = true

    }

}


这里风格陡然一变。

理解为仍然定义属性 ,理解为数组形式呗,也可以立即为json。比如取值:

configurations.

junitReport.

description = 

'ofbiz plugin dependencies configuration'

dependencies {

    // ofbiz compile libs

    compile 'apache-xerces:xercesImpl:2.9.1'

.....

    // ofbiz runtime libs

    runtime 'de.odysseus.juel:juel-spi:2.2.7'

。。。。


这里就是依赖jar包了。


def activateAndInstallPlugin(pluginId) {

    activatePlugin pluginId

    def gradleRunner = os.contains('windows') ? 'gradlew.bat' : './gradlew'

    exec { commandLine gradleRunner, 'installPlugin', "-PpluginId=${pluginId}" }

}

定义函数


build.gradle里常见格式,都见过面了,慢慢细细研究吧







评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值