public ExtraPropertiesExtension getDynamicProperties() { return convention.getExtraProperties(); }
public ExtensibleDynamicObject(Object delegate, AbstractDynamicObject dynamicDelegate, Convention convention) { this.dynamicDelegate = dynamicDelegate; this.convention = convention; this.extraPropertiesDynamicObject = new ExtraPropertiesDynamicObjectAdapter(delegate.getClass(), convention.getExtraProperties()); updateDelegates(); }
private void configureTestTask() { Class<?> testExecuter = null; Method method = null; try { testExecuter = Class.forName("org.gradle.api.internal.tasks.testing.detection.TestExecuter"); method = Test.class.getDeclaredMethod("setTestExecuter", testExecuter); } catch (NoSuchMethodException ne) { try { testExecuter = Class.forName("org.gradle.api.internal.tasks.testing.TestExecuter"); method = Test.class.getDeclaredMethod("setTestExecuter", testExecuter); } catch (NoSuchMethodException e) { project.getLogger().info("Unable to find method with name 'setTestExecuter' in class org.gradle.api.tasks.testing.Test."); } catch (ClassNotFoundException e) { project.getLogger().info("Unable to find class org.gradle.api.tasks.testing.detection.TestExecuter"); } } catch (ClassNotFoundException cne) { project.getLogger().info("Unable to find class org.gradle.api.tasks.testing.detection.TestExecuter"); } if (method == null || testExecuter == null) return; method.setAccessible(true); final Method setTestExecuterMethod = method; final Class<?> testExecuterClass = testExecuter; project.getTasks().withType (Test.class, test -> test.getConvention().getExtraProperties() .set("useEtaTest", new SetTestExecuterClosure (test, setTestExecuterMethod, testExecuterClass))); }