有没有办法执行./gradlew运行--developer = true并在属性文件中设置true值?

时间:2019-01-18 15:56:21

标签: gradle javafx groovy

我正在研究javafx项目, 我想用以下方式启动应用程序: ./gradlew运行-developer = true

此任务将在资源文件(config.properties)中设置true值,该字段developerMode已经存在,

我不知道该怎么办

我到达了以读取属性文件 文件file = new File(); 但是当我写时,属性文件的内容消失了……

buildscript {
    dependencies {
        classpath group: 'de.dynamicfiles.projects.gradle.plugins', name: 'javafx-gradle-plugin', version: '8.8.2'
    }

    repositories {
        mavenLocal()
        mavenCentral()
    }
}

plugins {
    id 'java'
}

repositories {
    mavenLocal()
    mavenCentral()
}

apply plugin: 'application'

mainClassName = 'com.joffrey.MainApp'

// Here will be the task
run {
    def test = false
    File propertiesFile = new File('config.properties')


}


apply plugin: 'javafx-gradle-plugin'


jfx {
    mainClass = 'com.joffrey.MainApp'
    vendor = 'JoffreyB'
}

dependencies {
    compile group: 'org.apache.logging.log4j', name: 'log4j-api', version: '2.11.1'
    compile group: 'org.apache.logging.log4j', name: 'log4j-core', version: '2.11.1'
}

0 个答案:

没有答案