Android Gradle 远程脚本使用'apply from:' 有什么作用 [英] Android Gradle remote scripts using 'apply from:' what does it do

查看:107
本文介绍了Android Gradle 远程脚本使用'apply from:' 有什么作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是关于一个安卓项目.我有一个安全的 gradle 代码,我想在本地运行,但我希望它托管在其他地方的 https 服务器上.因此,在我的 android build.gradle 文件中,我声明了如下内容:

This is about an android project. I have a secure gradle code i'd like to run locally but i want it to be hosted on https server somehwere else. Thus in my android build.gradle file i have declared something like this:

apply from: 'http://server-url/nexus/service/local/get_MY_SCRIPT?locale=en&country=USA

我的问题是这里到底会发生什么,这会在本地运行还是会从 https 服务器机器上运行?我想要的是让远程脚本命令在我调用的本地机器上运行.我在android中这样做

My question is what exactly is going to happen here, will this run locally or will the script run from the https servers machine ? What i want is for the remote script commands to run on the local machine where i am calling from. I am doing this in android

推荐答案

使用该命令,gradle 将简单地复制脚本并在本地执行所有内容.

With that command gradle will simply copy the script over and execute everything locally.

我的意思是复制",它会在一些临时的、内存中的东西中,如果脚本在远程发生变化,你可以预期在未来的本地执行中,这些变化将被反映.

By "copy" I mean, it will be in some temporary, in-memory thing, if the script changes on the remote, you can expect that on future executions locally the changes will be reflected.

一个很好的例子可以在这里看到:https://github.com/克里斯班斯/gradle-mvn-push

A good example of that being used can be seen here: https://github.com/chrisbanes/gradle-mvn-push

此脚本托管在 github.com 服务器中,并由潜在的数千名开发人员本地机器或 CI 服务器执行.

This script is hosted in github.com servers and gets executed by potentially thousands of developers local machines or CI servers.

这篇关于Android Gradle 远程脚本使用'apply from:' 有什么作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆