Gradle 依赖项管理

defaultTasks "hello"

configurations {
    starling
    //不进行依赖传递,否则要下载很多依赖项
    //例如 flex-framework
    starling.transitive = false
}

repositories {
    //注册starling-framework.swc所在的远程仓库
    maven {
        url "http://repository-trylogic.forge.cloudbees.com/snapshot"
    }
}

dependencies {
    //group : artifactId : version
    starling 'com.gamua:starling-framework:1.2-SNAPSHOT'
}

task hello << {
    //测试
    copy {
        from configurations.starling
        into "temp"
    }
    //打印starling-framework.swc下载到本地的路径
    println configurations.starling.asPath
}

你可能感兴趣的:(gradle)