[GRADLE-1524] Cannot call method from buildscript { } closure Created: 11/May/11  Updated: 04/Jan/13  Resolved: 11/May/11

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-3
Fix Version/s: None

Type: Bug
Reporter: Alexander Kitaev Assignee: Peter Niederwieser
Resolution: Not A Bug Votes: 0


The following does not work:


{ initDefaultProperties() // ... }

def initDefaultProperties()

{ // lot of default properties set here. }

The workaround is:


{ apply from: 'build.defaults.gradle' // .. }

and to put all defaults initialization into build.defaults.gradle.

Comment by Peter Niederwieser [ 11/May/11 ]

It isn't supposed to work. Think of the buildscript {} section as a separate script that gets executed before the surrounding script.

Generated at Wed Jun 30 11:57:41 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.