API to detect gradle offline mode

(Raymond Augé) #1

Is there an API to detect gradle is executed in offline mode? I’d rather this than using raw Java network detection because one can force gradle offline mode while still having network access (very slow connection or data capped connection, or testing etc.) Furthermore I’m working with a project which provides it’s own repository paradigm and these are not aware of the gradle program args.


(James Justinic) #2

The information about offline mode is available from StartParameter. You can get access to the instance of StartParameter from the Gradle instance, which can be obtained from the Project.

The full path from a project is:

It’s not clear to me whether you’re asking something additional about the own repository paradigm.

(Raymond Augé) #3

Thank you! This is precisely what I was looking for! I searched and could
not find it.