mirror of
https://github.com/gradle/actions.git
synced 2025-04-23 03:09:20 +08:00
Set both old and new external application marker properties
This commit is contained in:
parent
5ebc5d3853
commit
e36e909388
@ -301,8 +301,11 @@ if (GradleVersion.current() < GradleVersion.version('6.0')) {
|
|||||||
|
|
||||||
void applyPluginExternally(def pluginManager, String pluginClassName) {
|
void applyPluginExternally(def pluginManager, String pluginClassName) {
|
||||||
def externallyApplied = 'develocity.externally-applied'
|
def externallyApplied = 'develocity.externally-applied'
|
||||||
|
def externallyAppliedDeprecated = 'gradle.enterprise.externally-applied'
|
||||||
def oldValue = System.getProperty(externallyApplied)
|
def oldValue = System.getProperty(externallyApplied)
|
||||||
|
def oldValueDeprecated = System.getProperty(externallyAppliedDeprecated)
|
||||||
System.setProperty(externallyApplied, 'true')
|
System.setProperty(externallyApplied, 'true')
|
||||||
|
System.setProperty(externallyAppliedDeprecated, 'true')
|
||||||
try {
|
try {
|
||||||
pluginManager.apply(initscript.classLoader.loadClass(pluginClassName))
|
pluginManager.apply(initscript.classLoader.loadClass(pluginClassName))
|
||||||
} finally {
|
} finally {
|
||||||
@ -311,6 +314,11 @@ void applyPluginExternally(def pluginManager, String pluginClassName) {
|
|||||||
} else {
|
} else {
|
||||||
System.setProperty(externallyApplied, oldValue)
|
System.setProperty(externallyApplied, oldValue)
|
||||||
}
|
}
|
||||||
|
if (oldValueDeprecated == null) {
|
||||||
|
System.clearProperty(externallyAppliedDeprecated)
|
||||||
|
} else {
|
||||||
|
System.setProperty(externallyAppliedDeprecated, oldValueDeprecated)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user