It is definitely not odd to do these sorts of things via the Gradle 
wrapper. See: http://www.gradle.org/docs/current/userguide/init_scripts.html

...

   - 
   
   Put a file that ends with .gradle in the *GRADLE_HOME*/init.d/ directory, 
   in the Gradle distribution. This allows you to package up a custom Gradle 
   distribution containing some custom build logic and plugins. You can 
   combine this with the Gradle wrapper 
   <http://www.gradle.org/docs/current/userguide/gradle_wrapper.html> as a 
   way to make custom logic available to all builds in your enterprise.
   
We have done this for years at ReadyTalk and were encouraged to do so by 
Gradleware themselves.

The current behavior in Android Studio breaks one of the major enterprise 
features of Gradle. Please consider reverting back to the expected behavior 
/ default behavior as seen / used in IntelliJ IDEA.

It seems odd to do this sort of thing from the Gradle wrapper, since 
> ideally the wrapper ought to be an optional optimization but not required: 
> if you're building from the command line you should be able to bypass the 
> wrapper and run from a locally installed version of Gradle.
>

You misunderstand the purpose of the Gradle Wrapper. It is not really an 
"optional optimization", it is the only way to control the build 
environment your build runs in. Running a build with a different version of 
Gradle than what is defined in the wrapper can break your build, sometimes 
in sometimes subtle, sometimes not-so-subtle ways due to changes in 
packaged plugins or interfaces/ behaviors plugins may use (especially 
incubating features).
 

> It also makes it harder to understand what's going on in the build because 
> it's not obvious to someone unfamiliar with the environment where these 
> extra build pieces are coming from since the wrapper is hidden.
>

That depends wholly on your context. In a company setting, there is no 
better way to setup / bootstrap private repository settings, custom build 
logic, etc. than by putting those features into a custom wrapper / 
distribution. 
 

>
> What you're doing sounds like something that would be more suitable for 
> using a boilerplate external script (see 
> http://www.gradle.org/docs/current/userguide/tutorial_this_and_that.html)
>

We set up similar initialization scripts through the wrapper. Again, see 
the quote from 
http://www.gradle.org/docs/current/userguide/init_scripts.html above.
 

>
> On Wed, Dec 3, 2014 at 11:44 AM, Pete Winterscheidt <[email protected] 
> <javascript:>> wrote:
>
>>
>> <https://lh6.googleusercontent.com/-nDZrIFDeCCU/VH9l7yZvhaI/AAAAAAABJmc/THMD6k3DeV4/s1600/Screen%2BShot%2B2014-12-03%2Bat%2B2.33.37%2BPM.png>
>> My company has a standard gradle wrapper that does a variety of things: 
>> adds utility tasks, sets up our local artifactory repository, and such.
>>
>> Without using my local gradle wrapper none of my dependencies will load, 
>> artifacts are not published.
>>
>> This has certainly changed from 0.9 to 1.0 as previously when I selected 
>> "Use customizable gradle wrapper" it would stay selected across gradle 
>> syncs. Now every time I do a gradle sync it resets to use local gradle 
>> distribution and breaks my build.
>>
>>
>> On Wednesday, December 3, 2014 11:18:26 AM UTC-5, Pete Winterscheidt 
>> wrote:
>>>
>>> Hello all,
>>> I am running a customized gradle wrapper, and Android Studio keeps 
>>> trying to ignore it.
>>> Since upgrading to the new 1.0 RC 2 every time I do a gradle sync I have 
>>> to go to the preferences to reset the configuration to indicate that I am 
>>> using a customized wrapper.
>>>
>>> Is there something I can set in a config to prevent this from happening?
>>> Thanks,
>>> Pete
>>>
>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "adt-dev" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to