ahmad
ahmad

Reputation: 2209

Android gradle project directory variable

I am trying to write a script in gradle that requires opening up a file. I am trying to find the current directory where the project is installed. so I can open a file in my "raw" directory.

Note: I am aware that I can use a temporary file to find the current location of the application. However, I am trying to stay away from that solution.

I am trying to find out if gradle has a buildDir variable that I can use in my task instead.

Upvotes: 5

Views: 12166

Answers (1)

Jeff Brateman
Jeff Brateman

Reputation: 3277

See the Gradle docs. Specifically, you're interested in projectDir (The directory containing the build script) or buildDir (projectDir/build).

Upvotes: 12

Related Questions