diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml new file mode 100644 index 0000000..681f41a --- /dev/null +++ b/.idea/codeStyles/Project.xml @@ -0,0 +1,116 @@ + + + + + + + +
+ + + + xmlns:android + + ^$ + + + +
+
+ + + + xmlns:.* + + ^$ + + + BY_NAME + +
+
+ + + + .*:id + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + .*:name + + http://schemas.android.com/apk/res/android + + + +
+
+ + + + name + + ^$ + + + +
+
+ + + + style + + ^$ + + + +
+
+ + + + .* + + ^$ + + + BY_NAME + +
+
+ + + + .* + + http://schemas.android.com/apk/res/android + + + ANDROID_ATTRIBUTE_ORDER + +
+
+ + + + .* + + .* + + + BY_NAME + +
+
+
+
+
+
\ No newline at end of file diff --git a/.idea/compiler.xml b/.idea/compiler.xml new file mode 100644 index 0000000..312bf2e --- /dev/null +++ b/.idea/compiler.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.idea/deploymentTargetDropDown.xml b/.idea/deploymentTargetDropDown.xml new file mode 100644 index 0000000..9bea4a5 --- /dev/null +++ b/.idea/deploymentTargetDropDown.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..15a15b2 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml new file mode 100644 index 0000000..081375d --- /dev/null +++ b/.idea/gradle.xml @@ -0,0 +1,20 @@ + + + + + + + \ No newline at end of file diff --git a/.idea/jarRepositories.xml b/.idea/jarRepositories.xml new file mode 100644 index 0000000..a5f05cd --- /dev/null +++ b/.idea/jarRepositories.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..8f789e9 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,12 @@ + + + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/.tmp/gradle2551496837170798927.bin b/.tmp/gradle2551496837170798927.bin new file mode 100644 index 0000000..b7e99b2 Binary files /dev/null and b/.tmp/gradle2551496837170798927.bin differ diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png new file mode 100644 index 0000000..898f3ed Binary files /dev/null and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/caches/5.1.1/scripts/3taaqggq9uqxt1induc1n7r48/init/init13bba240a07c562d578336deed5b2fbf/classes/_BuildScript_.class b/caches/5.1.1/scripts/3taaqggq9uqxt1induc1n7r48/init/init13bba240a07c562d578336deed5b2fbf/classes/_BuildScript_.class new file mode 100644 index 0000000..d6d65ed Binary files /dev/null and b/caches/5.1.1/scripts/3taaqggq9uqxt1induc1n7r48/init/init13bba240a07c562d578336deed5b2fbf/classes/_BuildScript_.class differ diff --git a/caches/5.1.1/scripts/3taaqggq9uqxt1induc1n7r48/init/init13bba240a07c562d578336deed5b2fbf/metadata/metadata.bin b/caches/5.1.1/scripts/3taaqggq9uqxt1induc1n7r48/init/init13bba240a07c562d578336deed5b2fbf/metadata/metadata.bin new file mode 100644 index 0000000..bdc955b Binary files /dev/null and b/caches/5.1.1/scripts/3taaqggq9uqxt1induc1n7r48/init/init13bba240a07c562d578336deed5b2fbf/metadata/metadata.bin differ diff --git a/caches/5.1.1/scripts/e1tutkwvd05kkzat8c4hackqb/proj/proj6d4362610b01d1a70ff23aea4fd6433a/proj6d4362610b01d1a70ff23aea4fd6433a.lock b/caches/5.1.1/scripts/e1tutkwvd05kkzat8c4hackqb/proj/proj6d4362610b01d1a70ff23aea4fd6433a/proj6d4362610b01d1a70ff23aea4fd6433a.lock new file mode 100644 index 0000000..4d37699 Binary files /dev/null and b/caches/5.1.1/scripts/e1tutkwvd05kkzat8c4hackqb/proj/proj6d4362610b01d1a70ff23aea4fd6433a/proj6d4362610b01d1a70ff23aea4fd6433a.lock differ diff --git a/caches/6.7.1/scripts/f0w7113ullje60he8ahavds5i/proj/_BuildScript_$_run_closure1.class b/caches/6.7.1/scripts/f0w7113ullje60he8ahavds5i/proj/_BuildScript_$_run_closure1.class new file mode 100644 index 0000000..f67c117 Binary files /dev/null and b/caches/6.7.1/scripts/f0w7113ullje60he8ahavds5i/proj/_BuildScript_$_run_closure1.class differ diff --git a/caches/jars-8/0f3519881933f2aba12203e6ec9f6a16/cp_init.jar b/caches/jars-8/0f3519881933f2aba12203e6ec9f6a16/cp_init.jar new file mode 100644 index 0000000..626a3e8 Binary files /dev/null and b/caches/jars-8/0f3519881933f2aba12203e6ec9f6a16/cp_init.jar differ diff --git a/caches/jars-8/5cbfcb92711851e9570ec673b41715bc/apksig-4.2.2.jar b/caches/jars-8/5cbfcb92711851e9570ec673b41715bc/apksig-4.2.2.jar new file mode 100644 index 0000000..cea7bca Binary files /dev/null and b/caches/jars-8/5cbfcb92711851e9570ec673b41715bc/apksig-4.2.2.jar differ diff --git a/caches/jars-8/o_bed40a7026e2ddf2fd098d6365c706e9/gradle-tooling-extension-impl.jar b/caches/jars-8/o_bed40a7026e2ddf2fd098d6365c706e9/gradle-tooling-extension-impl.jar new file mode 100644 index 0000000..bab7628 Binary files /dev/null and b/caches/jars-8/o_bed40a7026e2ddf2fd098d6365c706e9/gradle-tooling-extension-impl.jar differ diff --git a/caches/jars-9/0f770cde46e7f947e8fe1034d396eca2/jsoup-1.13.1.jar b/caches/jars-9/0f770cde46e7f947e8fe1034d396eca2/jsoup-1.13.1.jar new file mode 100644 index 0000000..9fd1dcb Binary files /dev/null and b/caches/jars-9/0f770cde46e7f947e8fe1034d396eca2/jsoup-1.13.1.jar differ diff --git a/caches/jars-9/482927581fffa7608b868c18e5cd96cb/android-test-plugin-result-listener-gradle-proto-30.1.2.jar.lock.lock b/caches/jars-9/482927581fffa7608b868c18e5cd96cb/android-test-plugin-result-listener-gradle-proto-30.1.2.jar.lock.lock new file mode 100644 index 0000000..35a0387 Binary files /dev/null and b/caches/jars-9/482927581fffa7608b868c18e5cd96cb/android-test-plugin-result-listener-gradle-proto-30.1.2.jar.lock.lock differ diff --git a/caches/jars-9/5e09b9ab66b2bcc183a5273053f94a39/commons-logging-1.2.jar.lock.lock b/caches/jars-9/5e09b9ab66b2bcc183a5273053f94a39/commons-logging-1.2.jar.lock.lock new file mode 100644 index 0000000..35a0387 Binary files /dev/null and b/caches/jars-9/5e09b9ab66b2bcc183a5273053f94a39/commons-logging-1.2.jar.lock.lock differ diff --git a/caches/jars-9/5f7561e068ab4f62f7b22ecb3d0bed0a/android-test-plugin-host-coverage-proto-30.1.2.jar.receipt b/caches/jars-9/5f7561e068ab4f62f7b22ecb3d0bed0a/android-test-plugin-host-coverage-proto-30.1.2.jar.receipt new file mode 100644 index 0000000..e69de29 diff --git a/caches/jars-9/729d85ec9b942633942724975de87255/FastInfoset-1.2.16.jar b/caches/jars-9/729d85ec9b942633942724975de87255/FastInfoset-1.2.16.jar new file mode 100644 index 0000000..b8a9165 Binary files /dev/null and b/caches/jars-9/729d85ec9b942633942724975de87255/FastInfoset-1.2.16.jar differ diff --git a/caches/jars-9/7a05473684849c1b52395db14105b861/cp_proj.jar b/caches/jars-9/7a05473684849c1b52395db14105b861/cp_proj.jar new file mode 100644 index 0000000..15cb0ec Binary files /dev/null and b/caches/jars-9/7a05473684849c1b52395db14105b861/cp_proj.jar differ diff --git a/caches/jars-9/838cf3dbc34a5360aad8763e4220229c/gradle-api-7.1.2.jar b/caches/jars-9/838cf3dbc34a5360aad8763e4220229c/gradle-api-7.1.2.jar new file mode 100644 index 0000000..b9abf1c Binary files /dev/null and b/caches/jars-9/838cf3dbc34a5360aad8763e4220229c/gradle-api-7.1.2.jar differ diff --git a/caches/jars-9/85fc8d3661690466ae391431e2662aef/dvlib-30.1.2.jar b/caches/jars-9/85fc8d3661690466ae391431e2662aef/dvlib-30.1.2.jar new file mode 100644 index 0000000..b8c3255 Binary files /dev/null and b/caches/jars-9/85fc8d3661690466ae391431e2662aef/dvlib-30.1.2.jar differ diff --git a/caches/jars-9/b92ba79b8fb69cb30946f860561b0efb/repository-30.1.2.jar.receipt b/caches/jars-9/b92ba79b8fb69cb30946f860561b0efb/repository-30.1.2.jar.receipt new file mode 100644 index 0000000..e69de29 diff --git a/caches/jars-9/c1f9f490fb031e5f4580c497dfc7cba0/failureaccess-1.0.1.jar b/caches/jars-9/c1f9f490fb031e5f4580c497dfc7cba0/failureaccess-1.0.1.jar new file mode 100644 index 0000000..851349a Binary files /dev/null and b/caches/jars-9/c1f9f490fb031e5f4580c497dfc7cba0/failureaccess-1.0.1.jar differ diff --git a/caches/jars-9/c95b496ece1b1ce16565438797b4fecf/javax.activation-1.2.0.jar.lock.lock b/caches/jars-9/c95b496ece1b1ce16565438797b4fecf/javax.activation-1.2.0.jar.lock.lock new file mode 100644 index 0000000..35a0387 Binary files /dev/null and b/caches/jars-9/c95b496ece1b1ce16565438797b4fecf/javax.activation-1.2.0.jar.lock.lock differ diff --git a/caches/jars-9/e045ebd62abffc1b912e31ecc7864bf1/baseLibrary-7.1.2.jar b/caches/jars-9/e045ebd62abffc1b912e31ecc7864bf1/baseLibrary-7.1.2.jar new file mode 100644 index 0000000..f7687a5 Binary files /dev/null and b/caches/jars-9/e045ebd62abffc1b912e31ecc7864bf1/baseLibrary-7.1.2.jar differ diff --git a/caches/jars-9/e045ebd62abffc1b912e31ecc7864bf1/baseLibrary-7.1.2.jar.lock.lock b/caches/jars-9/e045ebd62abffc1b912e31ecc7864bf1/baseLibrary-7.1.2.jar.lock.lock new file mode 100644 index 0000000..35a0387 Binary files /dev/null and b/caches/jars-9/e045ebd62abffc1b912e31ecc7864bf1/baseLibrary-7.1.2.jar.lock.lock differ diff --git a/caches/jars-9/eae5cf363623aac3a739a905baa81a34/protobuf-java-3.10.0.jar.lock.lock b/caches/jars-9/eae5cf363623aac3a739a905baa81a34/protobuf-java-3.10.0.jar.lock.lock new file mode 100644 index 0000000..35a0387 Binary files /dev/null and b/caches/jars-9/eae5cf363623aac3a739a905baa81a34/protobuf-java-3.10.0.jar.lock.lock differ diff --git a/caches/jars-9/ebbab0fd578ac9560fc98647c3066219/layoutlib-api-30.1.2.jar.receipt b/caches/jars-9/ebbab0fd578ac9560fc98647c3066219/layoutlib-api-30.1.2.jar.receipt new file mode 100644 index 0000000..e69de29 diff --git a/caches/modules-2/files-2.1/androidx.annotation/annotation/1.1.0/404526f88e3a7efa04f1c99074dfc10aff9061ee/annotation-1.1.0.pom b/caches/modules-2/files-2.1/androidx.annotation/annotation/1.1.0/404526f88e3a7efa04f1c99074dfc10aff9061ee/annotation-1.1.0.pom new file mode 100644 index 0000000..9297522 --- /dev/null +++ b/caches/modules-2/files-2.1/androidx.annotation/annotation/1.1.0/404526f88e3a7efa04f1c99074dfc10aff9061ee/annotation-1.1.0.pom @@ -0,0 +1,28 @@ + + + 4.0.0 + androidx.annotation + annotation + 1.1.0 + Android Support Library Annotations + The Support Library is a static library that you can add to your Android application in order to use APIs that are either not available for older platform versions or utility APIs that aren't a part of the framework APIs. + http://developer.android.com/tools/extras/support-library.html + 2013 + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + The Android Open Source Project + + + + scm:git:https://android.googlesource.com/platform/frameworks/support + http://source.android.com + + diff --git a/caches/modules-2/files-2.1/androidx.databinding/databinding-common/7.1.2/9539d0510a9bb65a375bc872ef51a29d9f2e3f5/databinding-common-7.1.2-sources.jar b/caches/modules-2/files-2.1/androidx.databinding/databinding-common/7.1.2/9539d0510a9bb65a375bc872ef51a29d9f2e3f5/databinding-common-7.1.2-sources.jar new file mode 100644 index 0000000..d784737 Binary files /dev/null and b/caches/modules-2/files-2.1/androidx.databinding/databinding-common/7.1.2/9539d0510a9bb65a375bc872ef51a29d9f2e3f5/databinding-common-7.1.2-sources.jar differ diff --git a/caches/modules-2/files-2.1/androidx.legacy/legacy-support-core-utils/1.0.0/9b9570042115da8629519090dfeb71df75da59fc/legacy-support-core-utils-1.0.0.aar b/caches/modules-2/files-2.1/androidx.legacy/legacy-support-core-utils/1.0.0/9b9570042115da8629519090dfeb71df75da59fc/legacy-support-core-utils-1.0.0.aar new file mode 100644 index 0000000..2980f60 Binary files /dev/null and b/caches/modules-2/files-2.1/androidx.legacy/legacy-support-core-utils/1.0.0/9b9570042115da8629519090dfeb71df75da59fc/legacy-support-core-utils-1.0.0.aar differ diff --git a/caches/modules-2/files-2.1/androidx.test.espresso/espresso-core/3.2.0/a5535101659456b4e8e395d3671d1448aa48f6c7/espresso-core-3.2.0.pom b/caches/modules-2/files-2.1/androidx.test.espresso/espresso-core/3.2.0/a5535101659456b4e8e395d3671d1448aa48f6c7/espresso-core-3.2.0.pom new file mode 100644 index 0000000..23aadb9 --- /dev/null +++ b/caches/modules-2/files-2.1/androidx.test.espresso/espresso-core/3.2.0/a5535101659456b4e8e395d3671d1448aa48f6c7/espresso-core-3.2.0.pom @@ -0,0 +1,70 @@ + + + 4.0.0 + androidx.test.espresso + espresso-core + 3.2.0 + aar + AndroidX Test Library + The AndroidX Test Library provides an extensive framework for testing Android apps + https://developer.android.com/testing + 2015 + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + The Android Open Source Project + + + + + androidx.test + runner + 1.2.0 + compile + + + androidx.test.espresso + espresso-idling-resource + 3.2.0 + compile + + + com.squareup + javawriter + 2.1.1 + compile + + + javax.inject + javax.inject + 1 + compile + + + org.hamcrest + hamcrest-library + 1.3 + compile + + + org.hamcrest + hamcrest-integration + 1.3 + compile + + + com.google.code.findbugs + jsr305 + 2.0.1 + compile + + + diff --git a/caches/modules-2/files-2.1/androidx.test.espresso/espresso-idling-resource/3.2.0/565422b0951cfb8de4888853e4859d6a47a72d39/espresso-idling-resource-3.2.0-sources.jar b/caches/modules-2/files-2.1/androidx.test.espresso/espresso-idling-resource/3.2.0/565422b0951cfb8de4888853e4859d6a47a72d39/espresso-idling-resource-3.2.0-sources.jar new file mode 100644 index 0000000..12a1c1c Binary files /dev/null and b/caches/modules-2/files-2.1/androidx.test.espresso/espresso-idling-resource/3.2.0/565422b0951cfb8de4888853e4859d6a47a72d39/espresso-idling-resource-3.2.0-sources.jar differ diff --git a/caches/modules-2/files-2.1/com.android.tools.analytics-library/crash/27.2.2/45bec8679c05cf44356fa3b8abf7f2fcb769b65e/crash-27.2.2.pom b/caches/modules-2/files-2.1/com.android.tools.analytics-library/crash/27.2.2/45bec8679c05cf44356fa3b8abf7f2fcb769b65e/crash-27.2.2.pom new file mode 100644 index 0000000..bf4b4ed --- /dev/null +++ b/caches/modules-2/files-2.1/com.android.tools.analytics-library/crash/27.2.2/45bec8679c05cf44356fa3b8abf7f2fcb769b65e/crash-27.2.2.pom @@ -0,0 +1,63 @@ + + + + + + + + 4.0.0 + com.android.tools.analytics-library + crash + 27.2.2 + + + com.android.tools + annotations + 27.2.2 + compile + + + com.google.guava + guava + 28.1-jre + compile + + + org.apache.httpcomponents + httpmime + 4.5.6 + compile + + + org.apache.httpcomponents + httpcore + 4.4.10 + compile + + + org.apache.httpcomponents + httpclient + 4.5.6 + compile + + + Helper Library for uploading crash reports. + http://tools.android.com/ + com.android.tools.analytics-library.crash + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + The Android Open Source Project + + + + git://android.googlesource.com/platform/tools/base.git + https://android.googlesource.com/platform/tools/base + + diff --git a/caches/modules-2/files-2.1/com.android.tools.build/builder/7.1.2/a0abd0e3a9fd9de30d3376a7ed2962d2edfd5169/builder-7.1.2.jar b/caches/modules-2/files-2.1/com.android.tools.build/builder/7.1.2/a0abd0e3a9fd9de30d3376a7ed2962d2edfd5169/builder-7.1.2.jar new file mode 100644 index 0000000..42b04bf Binary files /dev/null and b/caches/modules-2/files-2.1/com.android.tools.build/builder/7.1.2/a0abd0e3a9fd9de30d3376a7ed2962d2edfd5169/builder-7.1.2.jar differ diff --git a/caches/modules-2/files-2.1/com.android.tools.build/manifest-merger/27.2.2/7b38999badb39e406d7da04a98ab2c36af76eae8/manifest-merger-27.2.2.pom b/caches/modules-2/files-2.1/com.android.tools.build/manifest-merger/27.2.2/7b38999badb39e406d7da04a98ab2c36af76eae8/manifest-merger-27.2.2.pom new file mode 100644 index 0000000..8222049 --- /dev/null +++ b/caches/modules-2/files-2.1/com.android.tools.build/manifest-merger/27.2.2/7b38999badb39e406d7da04a98ab2c36af76eae8/manifest-merger-27.2.2.pom @@ -0,0 +1,69 @@ + + + + + + + + 4.0.0 + com.android.tools.build + manifest-merger + 27.2.2 + + + com.android.tools + common + 27.2.2 + compile + + + com.android.tools + sdklib + 27.2.2 + compile + + + com.android.tools + sdk-common + 27.2.2 + compile + + + com.google.code.gson + gson + 2.8.6 + compile + + + org.jetbrains.kotlin + kotlin-stdlib-jdk8 + 1.4.31 + compile + + + net.sf.kxml + kxml2 + 2.3.0 + compile + + + A Library to merge Android manifests. + http://tools.android.com/ + com.android.tools.build.manifest-merger + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + The Android Open Source Project + + + + git://android.googlesource.com/platform/tools/base.git + https://android.googlesource.com/platform/tools/base + + diff --git a/caches/modules-2/files-2.1/com.android.tools.ddms/ddmlib/26.4.2/c32c6851155f8f3594ca5d1d14fe1c0fe4e0497a/ddmlib-26.4.2.pom b/caches/modules-2/files-2.1/com.android.tools.ddms/ddmlib/26.4.2/c32c6851155f8f3594ca5d1d14fe1c0fe4e0497a/ddmlib-26.4.2.pom new file mode 100644 index 0000000..168048b --- /dev/null +++ b/caches/modules-2/files-2.1/com.android.tools.ddms/ddmlib/26.4.2/c32c6851155f8f3594ca5d1d14fe1c0fe4e0497a/ddmlib-26.4.2.pom @@ -0,0 +1,42 @@ + + + 4.0.0 + com.android.tools.ddms + ddmlib + 26.4.2 + Android Tools ddmlib + Library providing APIs to talk to Android devices + https://developer.android.com/studio + 2007 + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + The Android Open Source Project + + + + git://android.googlesource.com/platform/tools/base.git + https://android.googlesource.com/platform/tools/base + + + + com.android.tools + common + 26.4.2 + compile + + + net.sf.kxml + kxml2 + 2.3.0 + compile + + + diff --git a/caches/modules-2/files-2.1/com.android.tools.layoutlib/layoutlib-api/27.2.2/42b2824247a172944977f45ec80410f74bcd11d9/layoutlib-api-27.2.2.module b/caches/modules-2/files-2.1/com.android.tools.layoutlib/layoutlib-api/27.2.2/42b2824247a172944977f45ec80410f74bcd11d9/layoutlib-api-27.2.2.module new file mode 100644 index 0000000..d3bdded --- /dev/null +++ b/caches/modules-2/files-2.1/com.android.tools.layoutlib/layoutlib-api/27.2.2/42b2824247a172944977f45ec80410f74bcd11d9/layoutlib-api-27.2.2.module @@ -0,0 +1,161 @@ +{ + "formatVersion": "1.1", + "component": { + "group": "com.android.tools.layoutlib", + "module": "layoutlib-api", + "version": "27.2.2", + "attributes": { + "org.gradle.status": "release" + } + }, + "createdBy": { + "gradle": { + "version": "6.7.1", + "buildId": "zz53gouv6nfztoi24j3d3xklai" + } + }, + "variants": [ + { + "name": "apiElements", + "attributes": { + "org.gradle.category": "library", + "org.gradle.dependency.bundling": "external", + "org.gradle.jvm.version": 8, + "org.gradle.libraryelements": "jar", + "org.gradle.usage": "java-api" + }, + "dependencies": [ + { + "group": "com.android.tools", + "module": "common", + "version": { + "requires": "27.2.2" + } + }, + { + "group": "net.sf.kxml", + "module": "kxml2", + "version": { + "requires": "2.3.0" + } + }, + { + "group": "com.android.tools", + "module": "annotations", + "version": { + "requires": "27.2.2" + } + }, + { + "group": "org.jetbrains", + "module": "annotations", + "version": { + "requires": "13.0" + } + } + ], + "files": [ + { + "name": "layoutlib-api-27.2.2.jar", + "url": "layoutlib-api-27.2.2.jar", + "size": 112743, + "sha512": "028a2f501e6aaa8c32b2e510d676c9b15c211c4233f940fc06d0947920b4e2bc84b14cd928585ddd6b8ce62e47594657a5a43431d12c1461f86a648fd8386911", + "sha256": "f0901f2295d814e82ad95850ea2103dd89d8489e01727fafa55ccccc0dccd163", + "sha1": "591e9a6853d599248a7655bd4dffd4ab7fe5299c", + "md5": "f95cedd4a5b1785cb662cb74cf7c4652" + } + ] + }, + { + "name": "runtimeElements", + "attributes": { + "org.gradle.category": "library", + "org.gradle.dependency.bundling": "external", + "org.gradle.jvm.version": 8, + "org.gradle.libraryelements": "jar", + "org.gradle.usage": "java-runtime" + }, + "dependencies": [ + { + "group": "com.android.tools", + "module": "common", + "version": { + "requires": "27.2.2" + } + }, + { + "group": "net.sf.kxml", + "module": "kxml2", + "version": { + "requires": "2.3.0" + } + }, + { + "group": "com.android.tools", + "module": "annotations", + "version": { + "requires": "27.2.2" + } + }, + { + "group": "org.jetbrains", + "module": "annotations", + "version": { + "requires": "13.0" + } + } + ], + "files": [ + { + "name": "layoutlib-api-27.2.2.jar", + "url": "layoutlib-api-27.2.2.jar", + "size": 112743, + "sha512": "028a2f501e6aaa8c32b2e510d676c9b15c211c4233f940fc06d0947920b4e2bc84b14cd928585ddd6b8ce62e47594657a5a43431d12c1461f86a648fd8386911", + "sha256": "f0901f2295d814e82ad95850ea2103dd89d8489e01727fafa55ccccc0dccd163", + "sha1": "591e9a6853d599248a7655bd4dffd4ab7fe5299c", + "md5": "f95cedd4a5b1785cb662cb74cf7c4652" + } + ] + }, + { + "name": "javadocElements", + "attributes": { + "org.gradle.category": "documentation", + "org.gradle.dependency.bundling": "external", + "org.gradle.docstype": "javadoc", + "org.gradle.usage": "java-runtime" + }, + "files": [ + { + "name": "layoutlib-api-27.2.2-javadoc.jar", + "url": "layoutlib-api-27.2.2-javadoc.jar", + "size": 336587, + "sha512": "6b858a608b9a0a95ee3d12a2b22db816226a36295925f4b4cf329861c7582c3e1faa78be5cdca7c4c829c7ae23eed1f14c2a42032633ea65687c3beb81798057", + "sha256": "b90b8f2f04e34a6de96602cb408de13b19f3304c978c27ff5a4260c6d089f7dc", + "sha1": "35e37a3cb690f0077a4434855b4c59312efe1f34", + "md5": "94813de42ed58fec2146932c2c7d2a5c" + } + ] + }, + { + "name": "sourcesElements", + "attributes": { + "org.gradle.category": "documentation", + "org.gradle.dependency.bundling": "external", + "org.gradle.docstype": "sources", + "org.gradle.usage": "java-runtime" + }, + "files": [ + { + "name": "layoutlib-api-27.2.2-sources.jar", + "url": "layoutlib-api-27.2.2-sources.jar", + "size": 106546, + "sha512": "5f0bd182678938232e70df9cc35db448510640cbc7a9f5fe8a9c172024b049cdef51e72b6d260acb011563328eac4059af71ea7224fa0c3f6fbeae33b6fa0d3f", + "sha256": "1dddb09b0146bbc9cfaf542ea985362310a8e76c2dcbc2050627976d41912c13", + "sha1": "c1dd38ec3ea29be1259551a2179fb15a9c236ca1", + "md5": "589cd19de8b5a42b9a8c50ae17788d7c" + } + ] + } + ] +} diff --git a/caches/modules-2/files-2.1/com.android/signflinger/4.2.2/581450f3f7815675877ad9528f83a1361f21daac/signflinger-4.2.2.pom b/caches/modules-2/files-2.1/com.android/signflinger/4.2.2/581450f3f7815675877ad9528f83a1361f21daac/signflinger-4.2.2.pom new file mode 100644 index 0000000..aaff611 --- /dev/null +++ b/caches/modules-2/files-2.1/com.android/signflinger/4.2.2/581450f3f7815675877ad9528f83a1361f21daac/signflinger-4.2.2.pom @@ -0,0 +1,45 @@ + + + + + + + + 4.0.0 + com.android + signflinger + 4.2.2 + + + com.android.tools.build + apksig + 4.2.2 + compile + + + com.android + zipflinger + 4.2.2 + compile + + + Library used to sign APKs + http://tools.android.com/ + com.android.signflinger + + + The Apache Software License, Version 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + + + The Android Open Source Project + + + + git://android.googlesource.com/platform/tools/base.git + https://android.googlesource.com/platform/tools/base + + diff --git a/caches/modules-2/files-2.1/com.android/signflinger/7.1.2/32152eb6e784b65d71bf3e23a78b1c617249c6d4/signflinger-7.1.2.module b/caches/modules-2/files-2.1/com.android/signflinger/7.1.2/32152eb6e784b65d71bf3e23a78b1c617249c6d4/signflinger-7.1.2.module new file mode 100644 index 0000000..a6bd8db --- /dev/null +++ b/caches/modules-2/files-2.1/com.android/signflinger/7.1.2/32152eb6e784b65d71bf3e23a78b1c617249c6d4/signflinger-7.1.2.module @@ -0,0 +1,123 @@ +{ + "formatVersion": "1.1", + "component": { + "group": "com.android", + "module": "signflinger", + "version": "7.1.2", + "attributes": { + "org.gradle.status": "release" + } + }, + "createdBy": { + "gradle": { + "version": "7.2" + } + }, + "variants": [ + { + "name": "apiElements", + "attributes": { + "org.gradle.category": "library", + "org.gradle.dependency.bundling": "external", + "org.gradle.jvm.version": 8, + "org.gradle.libraryelements": "jar", + "org.gradle.usage": "java-api" + }, + "files": [ + { + "name": "signflinger-7.1.2.jar", + "url": "signflinger-7.1.2.jar", + "size": 15058, + "sha512": "e24c22ffea01cd084f94a7fdb9a25fe571da39a4d69f6cd1567c40afd6f4736355147b2245c092d27d7f92e42df0aa6678a1ce822308e82f662746430aaf9034", + "sha256": "95dc1bf5fd81a8870223fd2d4706aa046b4044c4ba95dfc038ae703f204a58d6", + "sha1": "a05078872e7f98dcf233befb16f86f5c75d17f86", + "md5": "efce261456930a67990908de6bd5ccf3" + } + ] + }, + { + "name": "runtimeElements", + "attributes": { + "org.gradle.category": "library", + "org.gradle.dependency.bundling": "external", + "org.gradle.jvm.version": 8, + "org.gradle.libraryelements": "jar", + "org.gradle.usage": "java-runtime" + }, + "dependencies": [ + { + "group": "com.android.tools.build", + "module": "apksig", + "version": { + "requires": "7.1.2" + } + }, + { + "group": "com.android", + "module": "zipflinger", + "version": { + "requires": "7.1.2" + } + }, + { + "group": "com.android.tools", + "module": "annotations", + "version": { + "requires": "30.1.2" + } + } + ], + "files": [ + { + "name": "signflinger-7.1.2.jar", + "url": "signflinger-7.1.2.jar", + "size": 15058, + "sha512": "e24c22ffea01cd084f94a7fdb9a25fe571da39a4d69f6cd1567c40afd6f4736355147b2245c092d27d7f92e42df0aa6678a1ce822308e82f662746430aaf9034", + "sha256": "95dc1bf5fd81a8870223fd2d4706aa046b4044c4ba95dfc038ae703f204a58d6", + "sha1": "a05078872e7f98dcf233befb16f86f5c75d17f86", + "md5": "efce261456930a67990908de6bd5ccf3" + } + ] + }, + { + "name": "javadocElements", + "attributes": { + "org.gradle.category": "documentation", + "org.gradle.dependency.bundling": "external", + "org.gradle.docstype": "javadoc", + "org.gradle.usage": "java-runtime" + }, + "files": [ + { + "name": "signflinger-7.1.2-javadoc.jar", + "url": "signflinger-7.1.2-javadoc.jar", + "size": 405348, + "sha512": "a71f255a0d9f29dc370edcb0225a0381832ea8da675ee7d7f200971ccb2157bc04f9641e7914c3218e006ecf30a0e55d69aeb86d85094fa8284531b0831198fb", + "sha256": "eefc5efdac83d426d0f155ff8a7ed2c5062f46f61d32ee6e3db1e1354e466442", + "sha1": "1063921657a6442a281a9be90e4602d06e9e1e4d", + "md5": "782726a4f3797207c81380062d961e32" + } + ] + }, + { + "name": "sourcesElements", + "attributes": { + "org.gradle.category": "documentation", + "org.gradle.dependency.bundling": "external", + "org.gradle.docstype": "sources", + "org.gradle.usage": "java-runtime" + }, + "files": [ + { + "name": "signflinger-7.1.2-sources.jar", + "url": "signflinger-7.1.2-sources.jar", + "size": 9434, + "sha512": "b186c693cb68e2392b2038302ddff31076d84db825ba882a788bb33436c2f5e24e90db593c538a3bcc0d9327a0ee5f3e81f38a4854eacc93da96d713a71a30f1", + "sha256": "e5d767372413ed758e4a65b0c1d1d9aea903f94c9ba0314e2a20362afe5ade2a", + "sha1": "621208737f7d6e0d82a5c348655258b6768aef63", + "md5": "0e636f8a0dca88ac03111123e26cfb72" + } + ] + } + ] +} diff --git a/caches/modules-2/files-2.1/com.android/zipflinger/7.1.2/777da4b57c315f49b6ffe04494e900b699584065/zipflinger-7.1.2.module b/caches/modules-2/files-2.1/com.android/zipflinger/7.1.2/777da4b57c315f49b6ffe04494e900b699584065/zipflinger-7.1.2.module new file mode 100644 index 0000000..00cf82f --- /dev/null +++ b/caches/modules-2/files-2.1/com.android/zipflinger/7.1.2/777da4b57c315f49b6ffe04494e900b699584065/zipflinger-7.1.2.module @@ -0,0 +1,109 @@ +{ + "formatVersion": "1.1", + "component": { + "group": "com.android", + "module": "zipflinger", + "version": "7.1.2", + "attributes": { + "org.gradle.status": "release" + } + }, + "createdBy": { + "gradle": { + "version": "7.2" + } + }, + "variants": [ + { + "name": "apiElements", + "attributes": { + "org.gradle.category": "library", + "org.gradle.dependency.bundling": "external", + "org.gradle.jvm.version": 8, + "org.gradle.libraryelements": "jar", + "org.gradle.usage": "java-api" + }, + "files": [ + { + "name": "zipflinger-7.1.2.jar", + "url": "zipflinger-7.1.2.jar", + "size": 61235, + "sha512": "853fb63b50779241412dc3cfc2eb6b36a347aee038a72410668862e174cb7a7d563fe7405ca544359fbfad83f2c7178c5ce6638b27ab380c4130a7c8d7116c28", + "sha256": "e86522b409a85beb90553ea97a1dd9737cefec8efa1b2416cc65ded4901b12b2", + "sha1": "aed1909c91621c324e48cef223d63e894f74e579", + "md5": "ebc8a694dcbf3dd05b70a238cbcf358b" + } + ] + }, + { + "name": "runtimeElements", + "attributes": { + "org.gradle.category": "library", + "org.gradle.dependency.bundling": "external", + "org.gradle.jvm.version": 8, + "org.gradle.libraryelements": "jar", + "org.gradle.usage": "java-runtime" + }, + "dependencies": [ + { + "group": "com.android.tools", + "module": "annotations", + "version": { + "requires": "30.1.2" + } + } + ], + "files": [ + { + "name": "zipflinger-7.1.2.jar", + "url": "zipflinger-7.1.2.jar", + "size": 61235, + "sha512": "853fb63b50779241412dc3cfc2eb6b36a347aee038a72410668862e174cb7a7d563fe7405ca544359fbfad83f2c7178c5ce6638b27ab380c4130a7c8d7116c28", + "sha256": "e86522b409a85beb90553ea97a1dd9737cefec8efa1b2416cc65ded4901b12b2", + "sha1": "aed1909c91621c324e48cef223d63e894f74e579", + "md5": "ebc8a694dcbf3dd05b70a238cbcf358b" + } + ] + }, + { + "name": "javadocElements", + "attributes": { + "org.gradle.category": "documentation", + "org.gradle.dependency.bundling": "external", + "org.gradle.docstype": "javadoc", + "org.gradle.usage": "java-runtime" + }, + "files": [ + { + "name": "zipflinger-7.1.2-javadoc.jar", + "url": "zipflinger-7.1.2-javadoc.jar", + "size": 476997, + "sha512": "f667533a32b0191ee687447060e56da3af53fcf797096dac96bd31066276d18d443dcf72125ef64bc7a2e17059df4c32697191b4ab4543fbc7245440725ac63b", + "sha256": "8420c3f3072ed62183a6ae08d9576b308ecded68d36c38752a744e7c807e614a", + "sha1": "993d11913bd01c000ed044b6d723c8d9a43dd14d", + "md5": "551a2e2f6419a68ff5b0d66eca834913" + } + ] + }, + { + "name": "sourcesElements", + "attributes": { + "org.gradle.category": "documentation", + "org.gradle.dependency.bundling": "external", + "org.gradle.docstype": "sources", + "org.gradle.usage": "java-runtime" + }, + "files": [ + { + "name": "zipflinger-7.1.2-sources.jar", + "url": "zipflinger-7.1.2-sources.jar", + "size": 48649, + "sha512": "ceff502a0518431e2423c21f92f7cc99c6a5f8e5b8cbf9ee52263179592a1bb342a9c9378c07a1d0c98f358250695f699dcbf19c2f1de17fccfe5141aef3e9d9", + "sha256": "0222bbca3c38d433f02758b531765c1ef5dd59d7011bc5b468ec5a96c7557df6", + "sha1": "0c9f9607e9865a69671ef603db31daa9da00f1d8", + "md5": "12d96ea32175800fcc2090006e30f38d" + } + ] + } + ] +} diff --git a/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.11.1/f5d24a1dcf46000316d40c8c61196c48dd5677c5/jackson-databind-2.11.1.jar b/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.11.1/f5d24a1dcf46000316d40c8c61196c48dd5677c5/jackson-databind-2.11.1.jar new file mode 100644 index 0000000..41e1f94 Binary files /dev/null and b/caches/modules-2/files-2.1/com.fasterxml.jackson.core/jackson-databind/2.11.1/f5d24a1dcf46000316d40c8c61196c48dd5677c5/jackson-databind-2.11.1.jar differ diff --git a/caches/modules-2/files-2.1/com.fasterxml.jackson.module/jackson-module-kotlin/2.11.1/8f9a08430cc5bf5dd63628e72e1720c8b6b8bf4/jackson-module-kotlin-2.11.1.pom b/caches/modules-2/files-2.1/com.fasterxml.jackson.module/jackson-module-kotlin/2.11.1/8f9a08430cc5bf5dd63628e72e1720c8b6b8bf4/jackson-module-kotlin-2.11.1.pom new file mode 100644 index 0000000..5435260 --- /dev/null +++ b/caches/modules-2/files-2.1/com.fasterxml.jackson.module/jackson-module-kotlin/2.11.1/8f9a08430cc5bf5dd63628e72e1720c8b6b8bf4/jackson-module-kotlin-2.11.1.pom @@ -0,0 +1,180 @@ + + 4.0.0 + + com.fasterxml.jackson + jackson-base + 2.11.1 + + com.fasterxml.jackson.module + jackson-module-kotlin + jackson-module-kotlin + 2.11.1 + bundle + Add-on module for Jackson (https://github.com/FasterXML/jackson/) to support + Kotlin language, specifically introspection of method/constructor parameter names, + without having to add explicit property name annotation. + + + + jaysonminard + Jayson Minard + jayson.minard@gmail.com + + author + + + + dinomite + Drew Stephens + + + viartemev + Vyacheslav Artemyev + + + https://github.com/FasterXML/jackson-module-kotlin + + scm:git:git@github.com:FasterXML/jackson-module-kotlin.git + scm:git:git@github.com:FasterXML/jackson-module-kotlin.git + https://github.com/FasterXML/jackson-module-kotlin + jackson-module-kotlin-2.11.1 + + + + UTF-8 + + + 1.8 + 1.8 + + 4.12 + 1.3.72 + + + com/fasterxml/jackson/module/kotlin + ${project.groupId}.kotlin + + + src/main/resources/, META-INF=target/classes/META-INF + + com.fasterxml.jackson.* + ,kotlin.* + ,kotlin.reflect.* + + ${project.groupId}.kotlin.*;version=${project.version} + + + + + + com.fasterxml.jackson.core + jackson-databind + + + + com.fasterxml.jackson.core + jackson-annotations + + + + org.jetbrains.kotlin + kotlin-stdlib + ${version.kotlin} + provided + + + org.jetbrains.kotlin + kotlin-reflect + ${version.kotlin} + compile + + + org.jetbrains.kotlin + kotlin-test + ${version.kotlin} + test + + + com.fasterxml.jackson.dataformat + jackson-dataformat-xml + test + + + + + junit + junit + ${version.junit} + test + + + + + ${project.basedir}/src/main/kotlin + ${project.basedir}/src/test/kotlin + + + kotlin-maven-plugin + org.jetbrains.kotlin + ${version.kotlin} + + + + compile + process-sources + + compile + + + + + test-compile + process-test-sources + + test-compile + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + com/fasterxml/jackson/**/failing/* + + + + + + com.google.code.maven-replacer-plugin + replacer + + + process-packageVersion + generate-sources + + + + + org.apache.maven.plugins + maven-compiler-plugin + true + + true + true + true + + + + + + + + snapshots-repo + https://oss.sonatype.org/content/repositories/snapshots + false + true + + + diff --git a/caches/modules-2/files-2.1/com.fasterxml.woodstox/woodstox-core/6.2.1/e81f9fbf9112e4a420eb35cf875fe067386cb7bb/woodstox-core-6.2.1-sources.jar b/caches/modules-2/files-2.1/com.fasterxml.woodstox/woodstox-core/6.2.1/e81f9fbf9112e4a420eb35cf875fe067386cb7bb/woodstox-core-6.2.1-sources.jar new file mode 100644 index 0000000..b565809 Binary files /dev/null and b/caches/modules-2/files-2.1/com.fasterxml.woodstox/woodstox-core/6.2.1/e81f9fbf9112e4a420eb35cf875fe067386cb7bb/woodstox-core-6.2.1-sources.jar differ diff --git a/caches/modules-2/files-2.1/com.google.errorprone/error_prone_annotations/2.3.1/19c878e6870c8382864dcc459de1c6bfe7f36e54/error_prone_annotations-2.3.1.pom b/caches/modules-2/files-2.1/com.google.errorprone/error_prone_annotations/2.3.1/19c878e6870c8382864dcc459de1c6bfe7f36e54/error_prone_annotations-2.3.1.pom new file mode 100644 index 0000000..72b4c54 --- /dev/null +++ b/caches/modules-2/files-2.1/com.google.errorprone/error_prone_annotations/2.3.1/19c878e6870c8382864dcc459de1c6bfe7f36e54/error_prone_annotations-2.3.1.pom @@ -0,0 +1,58 @@ + + + + + 4.0.0 + + + com.google.errorprone + error_prone_parent + 2.3.1 + + + error-prone annotations + error_prone_annotations + + + + junit + junit + ${junit.version} + test + + + + + + Apache 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.7 + 1.7 + + + + + diff --git a/caches/modules-2/files-2.1/com.sun.istack/istack-commons-runtime/2.21/5d42dda44aa68ff87756e93ae0042cd66d2daa78/istack-commons-runtime-2.21-sources.jar b/caches/modules-2/files-2.1/com.sun.istack/istack-commons-runtime/2.21/5d42dda44aa68ff87756e93ae0042cd66d2daa78/istack-commons-runtime-2.21-sources.jar new file mode 100644 index 0000000..ca52063 Binary files /dev/null and b/caches/modules-2/files-2.1/com.sun.istack/istack-commons-runtime/2.21/5d42dda44aa68ff87756e93ae0042cd66d2daa78/istack-commons-runtime-2.21-sources.jar differ diff --git a/caches/modules-2/files-2.1/io.grpc/grpc-context/1.21.1/aef9db74ded2d9ab229f9e184e35bebf6ac6fbdf/grpc-context-1.21.1.jar b/caches/modules-2/files-2.1/io.grpc/grpc-context/1.21.1/aef9db74ded2d9ab229f9e184e35bebf6ac6fbdf/grpc-context-1.21.1.jar new file mode 100644 index 0000000..c2961ec Binary files /dev/null and b/caches/modules-2/files-2.1/io.grpc/grpc-context/1.21.1/aef9db74ded2d9ab229f9e184e35bebf6ac6fbdf/grpc-context-1.21.1.jar differ diff --git a/caches/modules-2/files-2.1/org.checkerframework/checker-qual/2.8.1/c7e7cde72ffc19ab0f453b6fcc184638a8f3bb11/checker-qual-2.8.1.pom b/caches/modules-2/files-2.1/org.checkerframework/checker-qual/2.8.1/c7e7cde72ffc19ab0f453b6fcc184638a8f3bb11/checker-qual-2.8.1.pom new file mode 100644 index 0000000..66641b8 --- /dev/null +++ b/caches/modules-2/files-2.1/org.checkerframework/checker-qual/2.8.1/c7e7cde72ffc19ab0f453b6fcc184638a8f3bb11/checker-qual-2.8.1.pom @@ -0,0 +1,65 @@ + + + 4.0.0 + jar + + Checker Qual + https://checkerframework.org + + Checker Qual is the set of annotations (qualifiers) and supporting classes + used by the Checker Framework to type check Java source code. Please + see artifact: + org.checkerframework:checker + + + org.checkerframework + checker-qual + + + + The MIT License + http://opensource.org/licenses/MIT + repo + + + + + 2.8.1 + + + https://github.com/typetools/checker-framework.git + https://github.com/typetools/checker-framework.git + + + + + + mernst + Michael Ernst + mernst@cs.washington.edu + https://homes.cs.washington.edu/~mernst/ + University of Washington + https://www.cs.washington.edu/ + + + + wmdietl + Werner M. Dietl + wdietl@uwaterloo.ca + University of Waterloo + http://uwaterloo.ca/ + + + + smillst + Suzanne Millstein + smillst@cs.washington.edu + University of Washington PLSE Group + https://www.cs.washington.edu/research/plse/ + + + + + diff --git a/caches/modules-2/files-2.1/org.codehaus.woodstox/stax2-api/4.2.1/8d0d447792449c247f739781838cd620687074b/stax2-api-4.2.1-sources.jar b/caches/modules-2/files-2.1/org.codehaus.woodstox/stax2-api/4.2.1/8d0d447792449c247f739781838cd620687074b/stax2-api-4.2.1-sources.jar new file mode 100644 index 0000000..b3e37de Binary files /dev/null and b/caches/modules-2/files-2.1/org.codehaus.woodstox/stax2-api/4.2.1/8d0d447792449c247f739781838cd620687074b/stax2-api-4.2.1-sources.jar differ diff --git a/caches/modules-2/files-2.1/org.glassfish.jaxb/jaxb-runtime/2.3.2/5528bc882ea499a09d720b42af11785c4fc6be2a/jaxb-runtime-2.3.2.jar b/caches/modules-2/files-2.1/org.glassfish.jaxb/jaxb-runtime/2.3.2/5528bc882ea499a09d720b42af11785c4fc6be2a/jaxb-runtime-2.3.2.jar new file mode 100644 index 0000000..62f8719 Binary files /dev/null and b/caches/modules-2/files-2.1/org.glassfish.jaxb/jaxb-runtime/2.3.2/5528bc882ea499a09d720b42af11785c4fc6be2a/jaxb-runtime-2.3.2.jar differ diff --git a/caches/modules-2/files-2.1/org.jacoco/org.jacoco.ant/0.8.3/330c712fc7cdf4a63e834c7fcc9102153cba8626/org.jacoco.ant-0.8.3.pom b/caches/modules-2/files-2.1/org.jacoco/org.jacoco.ant/0.8.3/330c712fc7cdf4a63e834c7fcc9102153cba8626/org.jacoco.ant-0.8.3.pom new file mode 100644 index 0000000..c6124d5 --- /dev/null +++ b/caches/modules-2/files-2.1/org.jacoco/org.jacoco.ant/0.8.3/330c712fc7cdf4a63e834c7fcc9102153cba8626/org.jacoco.ant-0.8.3.pom @@ -0,0 +1,119 @@ + + + + 4.0.0 + + + org.jacoco + org.jacoco.build + 0.8.3 + ../org.jacoco.build + + + org.jacoco.ant + + JaCoCo :: Ant + JaCoCo Ant Tasks + + + + ${project.groupId} + org.jacoco.core + + + ${project.groupId} + org.jacoco.report + + + ${project.groupId} + org.jacoco.agent + + + org.apache.ant + ant + provided + + + + + src + + + + org.apache.maven.plugins + maven-shade-plugin + + + package + + shade + + + true + nodeps + true + + + org.objectweb.asm + org.jacoco.asm + + + + + org.ow2.asm:* + + module-info.class + + + + + + + ${project.description} + ${project.organization.name} + ${project.version} + + + + + + + + + + org.apache.felix + maven-bundle-plugin + + + + package + + bundle + + + true + + org.apache.ant;bundle-version="[1.7.0,2.0.0)" + + + + + + + + diff --git a/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.4.31/d4e46e5cbf82587049fbd9193a5d205c9d491a15/kotlin-reflect-1.4.31-sources.jar b/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.4.31/d4e46e5cbf82587049fbd9193a5d205c9d491a15/kotlin-reflect-1.4.31-sources.jar new file mode 100644 index 0000000..1a7573e Binary files /dev/null and b/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-reflect/1.4.31/d4e46e5cbf82587049fbd9193a5d205c9d491a15/kotlin-reflect-1.4.31-sources.jar differ diff --git a/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.4.31/6dd50665802f54ba9bc3f70ecb20227d1bc81323/kotlin-stdlib-common-1.4.31.jar b/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.4.31/6dd50665802f54ba9bc3f70ecb20227d1bc81323/kotlin-stdlib-common-1.4.31.jar new file mode 100644 index 0000000..8c0c9f3 Binary files /dev/null and b/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-common/1.4.31/6dd50665802f54ba9bc3f70ecb20227d1bc81323/kotlin-stdlib-common-1.4.31.jar differ diff --git a/caches/modules-2/files-2.1/org.json/json/20180813/60753006d96d5fc85b61b0897f3326b5c4e1c4f0/json-20180813-sources.jar b/caches/modules-2/files-2.1/org.json/json/20180813/60753006d96d5fc85b61b0897f3326b5c4e1c4f0/json-20180813-sources.jar new file mode 100644 index 0000000..59c52db Binary files /dev/null and b/caches/modules-2/files-2.1/org.json/json/20180813/60753006d96d5fc85b61b0897f3326b5c4e1c4f0/json-20180813-sources.jar differ diff --git a/caches/modules-2/files-2.1/org.ow2.asm/asm-parent/6.0/6a030ede2a62bdde4a6b23ef342994703a11ea24/asm-parent-6.0.pom b/caches/modules-2/files-2.1/org.ow2.asm/asm-parent/6.0/6a030ede2a62bdde4a6b23ef342994703a11ea24/asm-parent-6.0.pom new file mode 100644 index 0000000..67021e0 --- /dev/null +++ b/caches/modules-2/files-2.1/org.ow2.asm/asm-parent/6.0/6a030ede2a62bdde4a6b23ef342994703a11ea24/asm-parent-6.0.pom @@ -0,0 +1,163 @@ + + + + + + ow2 + org.ow2 + 1.3 + + + 4.0.0 + + asm-parent + org.ow2.asm + 6.0 + pom + + ASM + A very small and fast Java bytecode manipulation framework + http://asm.objectweb.org/ + + + ObjectWeb + http://www.objectweb.org/ + + 2000 + + + + BSD + http://asm.objectweb.org/license.html + + + + + + Eric Bruneton + ebruneton + ebruneton@free.fr + + Creator + Java Developer + + + + Eugene Kuleshov + eu + eu@javatx.org + + Java Developer + + + + Remi Forax + forax + forax@univ-mlv.fr + + Java Developer + + + + + + scm:svn:svn://svn.forge.objectweb.org/svnroot/asm/trunk + scm:svn:svn+ssh://${maven.username}@svn.forge.objectweb.org/svnroot/asm/trunk + http://svn.forge.objectweb.org/cgi-bin/viewcvs.cgi/asm/trunk/ + + + + http://forge.objectweb.org/tracker/?group_id=23 + + + + + + + asm + ${project.groupId} + ${project.version} + + + + asm-tree + ${project.groupId} + ${project.version} + + + + asm-analysis + ${project.groupId} + ${project.version} + + + + asm-commons + ${project.groupId} + ${project.version} + + + + asm-util + ${project.groupId} + ${project.version} + + + + asm-xml + ${project.groupId} + ${project.version} + + + + + + + + ASM Users List + sympa@objectweb.org?subject=subscribe%20asm + sympa@objectweb.org?subject=unsubscribe%20asm + asm@objectweb.org + http://www.objectweb.org/wws/arc/asm + + + ASM Team List + sympa@objectweb.org?subject=subscribe%20asm-team + sympa@objectweb.org?subject=unsubscribe%20asm-team + asm-team@objectweb.org + http://www.objectweb.org/wws/arc/asm-team + + + + diff --git a/caches/modules-2/metadata-2.69/descriptors/androidx.test.espresso/espresso-idling-resource/3.2.0/6740fe48b44caed96d7f50b66ff7b0b5/descriptor.bin b/caches/modules-2/metadata-2.69/descriptors/androidx.test.espresso/espresso-idling-resource/3.2.0/6740fe48b44caed96d7f50b66ff7b0b5/descriptor.bin new file mode 100644 index 0000000..6f2c9b9 Binary files /dev/null and b/caches/modules-2/metadata-2.69/descriptors/androidx.test.espresso/espresso-idling-resource/3.2.0/6740fe48b44caed96d7f50b66ff7b0b5/descriptor.bin differ diff --git a/caches/modules-2/metadata-2.69/descriptors/com.android.tools.build/manifest-merger/26.4.2/6740fe48b44caed96d7f50b66ff7b0b5/descriptor.bin b/caches/modules-2/metadata-2.69/descriptors/com.android.tools.build/manifest-merger/26.4.2/6740fe48b44caed96d7f50b66ff7b0b5/descriptor.bin new file mode 100644 index 0000000..1c391d1 Binary files /dev/null and b/caches/modules-2/metadata-2.69/descriptors/com.android.tools.build/manifest-merger/26.4.2/6740fe48b44caed96d7f50b66ff7b0b5/descriptor.bin differ diff --git a/caches/modules-2/metadata-2.69/descriptors/com.android.tools.build/transform-api/2.0.0-deprecated-use-gradle-api/6740fe48b44caed96d7f50b66ff7b0b5/descriptor.bin b/caches/modules-2/metadata-2.69/descriptors/com.android.tools.build/transform-api/2.0.0-deprecated-use-gradle-api/6740fe48b44caed96d7f50b66ff7b0b5/descriptor.bin new file mode 100644 index 0000000..069a33f Binary files /dev/null and b/caches/modules-2/metadata-2.69/descriptors/com.android.tools.build/transform-api/2.0.0-deprecated-use-gradle-api/6740fe48b44caed96d7f50b66ff7b0b5/descriptor.bin differ diff --git a/caches/modules-2/metadata-2.69/descriptors/org.antlr/antlr4-master/4.5.3/1dd858de07b774d6be9d3e38c5646087/descriptor.bin b/caches/modules-2/metadata-2.69/descriptors/org.antlr/antlr4-master/4.5.3/1dd858de07b774d6be9d3e38c5646087/descriptor.bin new file mode 100644 index 0000000..3e61167 Binary files /dev/null and b/caches/modules-2/metadata-2.69/descriptors/org.antlr/antlr4-master/4.5.3/1dd858de07b774d6be9d3e38c5646087/descriptor.bin differ diff --git a/caches/modules-2/metadata-2.69/descriptors/org.apache.httpcomponents/httpmime/4.5.6/1dd858de07b774d6be9d3e38c5646087/descriptor.bin b/caches/modules-2/metadata-2.69/descriptors/org.apache.httpcomponents/httpmime/4.5.6/1dd858de07b774d6be9d3e38c5646087/descriptor.bin new file mode 100644 index 0000000..106496e Binary files /dev/null and b/caches/modules-2/metadata-2.69/descriptors/org.apache.httpcomponents/httpmime/4.5.6/1dd858de07b774d6be9d3e38c5646087/descriptor.bin differ diff --git a/caches/modules-2/metadata-2.96/descriptors/androidx.lifecycle/lifecycle-common/2.0.0/11cd36a7dcab7d14d0c14c5e6c7582e3/descriptor.bin b/caches/modules-2/metadata-2.96/descriptors/androidx.lifecycle/lifecycle-common/2.0.0/11cd36a7dcab7d14d0c14c5e6c7582e3/descriptor.bin new file mode 100644 index 0000000..e4926a1 Binary files /dev/null and b/caches/modules-2/metadata-2.96/descriptors/androidx.lifecycle/lifecycle-common/2.0.0/11cd36a7dcab7d14d0c14c5e6c7582e3/descriptor.bin differ diff --git a/caches/modules-2/metadata-2.96/descriptors/androidx.vectordrawable/vectordrawable-animated/1.1.0/11cd36a7dcab7d14d0c14c5e6c7582e3/descriptor.bin b/caches/modules-2/metadata-2.96/descriptors/androidx.vectordrawable/vectordrawable-animated/1.1.0/11cd36a7dcab7d14d0c14c5e6c7582e3/descriptor.bin new file mode 100644 index 0000000..6a26dff Binary files /dev/null and b/caches/modules-2/metadata-2.96/descriptors/androidx.vectordrawable/vectordrawable-animated/1.1.0/11cd36a7dcab7d14d0c14c5e6c7582e3/descriptor.bin differ diff --git a/caches/modules-2/metadata-2.96/descriptors/commons-logging/commons-logging/1.2/edb68b65d2dd9b547bbf59d703899938/descriptor.bin b/caches/modules-2/metadata-2.96/descriptors/commons-logging/commons-logging/1.2/edb68b65d2dd9b547bbf59d703899938/descriptor.bin new file mode 100644 index 0000000..36e2246 Binary files /dev/null and b/caches/modules-2/metadata-2.96/descriptors/commons-logging/commons-logging/1.2/edb68b65d2dd9b547bbf59d703899938/descriptor.bin differ diff --git a/caches/modules-2/metadata-2.96/descriptors/org.apache.httpcomponents/httpcomponents-parent/10/edb68b65d2dd9b547bbf59d703899938/descriptor.bin b/caches/modules-2/metadata-2.96/descriptors/org.apache.httpcomponents/httpcomponents-parent/10/edb68b65d2dd9b547bbf59d703899938/descriptor.bin new file mode 100644 index 0000000..13c8b33 Binary files /dev/null and b/caches/modules-2/metadata-2.96/descriptors/org.apache.httpcomponents/httpcomponents-parent/10/edb68b65d2dd9b547bbf59d703899938/descriptor.bin differ diff --git a/caches/modules-2/metadata-2.96/descriptors/org.checkerframework/checker-qual/2.8.1/edb68b65d2dd9b547bbf59d703899938/descriptor.bin b/caches/modules-2/metadata-2.96/descriptors/org.checkerframework/checker-qual/2.8.1/edb68b65d2dd9b547bbf59d703899938/descriptor.bin new file mode 100644 index 0000000..fde5825 Binary files /dev/null and b/caches/modules-2/metadata-2.96/descriptors/org.checkerframework/checker-qual/2.8.1/edb68b65d2dd9b547bbf59d703899938/descriptor.bin differ diff --git a/caches/modules-2/metadata-2.97/descriptors/androidx.lifecycle/lifecycle-livedata/2.0.0/11cd36a7dcab7d14d0c14c5e6c7582e3/descriptor.bin b/caches/modules-2/metadata-2.97/descriptors/androidx.lifecycle/lifecycle-livedata/2.0.0/11cd36a7dcab7d14d0c14c5e6c7582e3/descriptor.bin new file mode 100644 index 0000000..95a9ef1 Binary files /dev/null and b/caches/modules-2/metadata-2.97/descriptors/androidx.lifecycle/lifecycle-livedata/2.0.0/11cd36a7dcab7d14d0c14c5e6c7582e3/descriptor.bin differ diff --git a/caches/modules-2/metadata-2.97/descriptors/com.android/zipflinger/7.1.2/11cd36a7dcab7d14d0c14c5e6c7582e3/descriptor.bin b/caches/modules-2/metadata-2.97/descriptors/com.android/zipflinger/7.1.2/11cd36a7dcab7d14d0c14c5e6c7582e3/descriptor.bin new file mode 100644 index 0000000..b2d9bdc Binary files /dev/null and b/caches/modules-2/metadata-2.97/descriptors/com.android/zipflinger/7.1.2/11cd36a7dcab7d14d0c14c5e6c7582e3/descriptor.bin differ diff --git a/caches/modules-2/metadata-2.97/descriptors/org.jacoco/org.jacoco.agent/0.8.3/edb68b65d2dd9b547bbf59d703899938/descriptor.bin b/caches/modules-2/metadata-2.97/descriptors/org.jacoco/org.jacoco.agent/0.8.3/edb68b65d2dd9b547bbf59d703899938/descriptor.bin new file mode 100644 index 0000000..f512193 Binary files /dev/null and b/caches/modules-2/metadata-2.97/descriptors/org.jacoco/org.jacoco.agent/0.8.3/edb68b65d2dd9b547bbf59d703899938/descriptor.bin differ diff --git a/caches/modules-2/metadata-2.97/descriptors/org.ow2.asm/asm-util/9.1/edb68b65d2dd9b547bbf59d703899938/descriptor.bin b/caches/modules-2/metadata-2.97/descriptors/org.ow2.asm/asm-util/9.1/edb68b65d2dd9b547bbf59d703899938/descriptor.bin new file mode 100644 index 0000000..eda84ad Binary files /dev/null and b/caches/modules-2/metadata-2.97/descriptors/org.ow2.asm/asm-util/9.1/edb68b65d2dd9b547bbf59d703899938/descriptor.bin differ diff --git a/caches/modules-2/metadata-2.97/descriptors/org.ow2/ow2/1.5/edb68b65d2dd9b547bbf59d703899938/descriptor.bin b/caches/modules-2/metadata-2.97/descriptors/org.ow2/ow2/1.5/edb68b65d2dd9b547bbf59d703899938/descriptor.bin new file mode 100644 index 0000000..5e54963 Binary files /dev/null and b/caches/modules-2/metadata-2.97/descriptors/org.ow2/ow2/1.5/edb68b65d2dd9b547bbf59d703899938/descriptor.bin differ diff --git a/caches/transforms-2/files-2.1/1252afd1dc9f5469c30b4174466bb74f/material-1.0.0/res/drawable-xhdpi-v4/design_ic_visibility.png b/caches/transforms-2/files-2.1/1252afd1dc9f5469c30b4174466bb74f/material-1.0.0/res/drawable-xhdpi-v4/design_ic_visibility.png new file mode 100644 index 0000000..1f7b4cc Binary files /dev/null and b/caches/transforms-2/files-2.1/1252afd1dc9f5469c30b4174466bb74f/material-1.0.0/res/drawable-xhdpi-v4/design_ic_visibility.png differ diff --git a/caches/transforms-2/files-2.1/2f2da1cb35aef86effd54930392df1d7/versionedparcelable-1.1.0-runtime/classes.dex b/caches/transforms-2/files-2.1/2f2da1cb35aef86effd54930392df1d7/versionedparcelable-1.1.0-runtime/classes.dex new file mode 100644 index 0000000..d02d02f Binary files /dev/null and b/caches/transforms-2/files-2.1/2f2da1cb35aef86effd54930392df1d7/versionedparcelable-1.1.0-runtime/classes.dex differ diff --git a/caches/transforms-2/files-2.1/35c069d439b305fa509b7b10ba1d96b4.bin b/caches/transforms-2/files-2.1/35c069d439b305fa509b7b10ba1d96b4.bin new file mode 100644 index 0000000..e69de29 diff --git a/caches/transforms-2/files-2.1/476e418bae6a1646436b14a2350f3166/core-1.1.0/res/layout/custom_dialog.xml b/caches/transforms-2/files-2.1/476e418bae6a1646436b14a2350f3166/core-1.1.0/res/layout/custom_dialog.xml new file mode 100644 index 0000000..47a1b12 --- /dev/null +++ b/caches/transforms-2/files-2.1/476e418bae6a1646436b14a2350f3166/core-1.1.0/res/layout/custom_dialog.xml @@ -0,0 +1,14 @@ + + + + + +
+ +
+ + + +
+ + + +
+ + +
+
+
+
+

You can install the Gradle build tool on Linux, macOS, or Windows. +This document covers installing using a package manager like SDKMAN!, Homebrew, or Scoop, as well as manual installation.

+
+
+

Use of the Gradle Wrapper is the recommended way to upgrade Gradle.

+
+
+

You can find all releases and their checksums on the releases page.

+
+
+
+
+

Prerequisites

+
+
+

Gradle runs on all major operating systems and requires only a Java Development Kit version 8 or higher to run. To check, run java -version. You should see something like this:

+
+
+
+
❯ java -version
+java version "1.8.0_151"
+Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
+Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
+
+
+
+

Gradle ships with its own Groovy library, therefore Groovy does not need to be installed. Any existing Groovy installation is ignored by Gradle.

+
+
+

Gradle uses whatever JDK it finds in your path. Alternatively, you can set the JAVA_HOME environment variable to point to the installation directory of the desired JDK.

+
+
+
+
+

Installing with a package manager

+
+
+

SDKMAN! is a tool for managing parallel versions of multiple Software Development Kits on most Unix-based systems.

+
+
+
+
❯ sdk install gradle
+
+
+
+

Homebrew is "the missing package manager for macOS".

+
+
+
+
❯ brew install gradle
+
+
+
+

Scoop is a command-line installer for Windows inspired by Homebrew.

+
+
+
+
❯ scoop install gradle
+
+
+
+

Chocolatey is "the package manager for Windows".

+
+
+
+
❯ choco install gradle
+
+
+
+

MacPorts is a system for managing tools on macOS:

+
+
+
+
❯ sudo port install gradle
+
+
+ +
+
+
+

Installing manually

+
+
+

Step 1. Download the latest Gradle distribution

+
+

The distribution ZIP file comes in two flavors:

+
+
+
    +
  • +

    Binary-only (bin)

    +
  • +
  • +

    Complete (all) with docs and sources

    +
  • +
+
+
+

Need to work with an older version? See the releases page.

+
+
+
+

Step 2. Unpack the distribution

+
+

Linux & MacOS users

+
+

Unzip the distribution zip file in the directory of your choosing, e.g.:

+
+
+
+
❯ mkdir /opt/gradle
+❯ unzip -d /opt/gradle gradle-5.1.1-bin.zip
+❯ ls /opt/gradle/gradle-5.1.1
+LICENSE  NOTICE  bin  getting-started.html  init.d  lib  media
+
+
+
+
+

Microsoft Windows users

+
+

Create a new directory C:\Gradle with File Explorer.

+
+
+

Open a second File Explorer window and go to the directory where the Gradle distribution was downloaded. Double-click the ZIP archive to expose the content. Drag the content folder gradle-5.1.1 to your newly created C:\Gradle folder.

+
+
+

Alternatively you can unpack the Gradle distribution ZIP into C:\Gradle using an archiver tool of your choice.

+
+
+
+
+

Step 3. Configure your system environment

+
+

For running Gradle, firstly add the environment variable GRADLE_HOME. This should point to the unpacked files from the Gradle website. Next add GRADLE_HOME/bin to your PATH environment variable. Usually, this is sufficient to run Gradle.

+
+
+

Linux & MacOS users

+
+

Configure your PATH environment variable to include the bin directory of the unzipped distribution, e.g.:

+
+
+
+
❯ export PATH=$PATH:/opt/gradle/gradle-5.1.1/bin
+
+
+
+
+

Microsoft Windows users

+
+

In File Explorer right-click on the This PC (or Computer) icon, then click PropertiesAdvanced System SettingsEnvironmental Variables.

+
+
+

Under System Variables select Path, then click Edit. Add an entry for C:\Gradle\gradle-5.1.1\bin. Click OK to save.

+
+ +
+
+
+
+
+

Verifying installation

+
+
+

Open a console (or a Windows command prompt) and run gradle -v to run gradle and display the version, e.g.:

+
+
+
+
❯ gradle -v
+
+------------------------------------------------------------
+Gradle 5.1.1
+------------------------------------------------------------
+
+Build time:   2018-02-21 15:28:42 UTC
+Revision:     819e0059da49f469d3e9b2896dc4e72537c4847d
+
+Groovy:       2.4.15
+Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
+JVM:          1.8.0_151 (Oracle Corporation 25.151-b12)
+OS:           Mac OS X 10.13.3 x86_64
+
+
+
+

If you run into any trouble, see the section on troubleshooting installation.

+
+
+

You can verify the integrity of the Gradle distribution by downloading the SHA-256 file (available from the releases page) and following these verification instructions.

+
+
+
+
+

Next steps

+
+
+

Now that you have Gradle installed, use these resources for getting started:

+
+
+ +
+
+
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/docs/userguide/software_model.html b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/docs/userguide/software_model.html new file mode 100644 index 0000000..c297611 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/docs/userguide/software_model.html @@ -0,0 +1,4136 @@ + + + + + + + +Rule based model configuration + + + + + + + + + +
+ + + +
+ + +
+
+
+
+ + + + + +
+
+
+
+

Rule based configuration will be deprecated. New plugins should not use this concept.

+
+
+
+
+

Rule based model configuration enables configuration logic to itself have dependencies on other elements of configuration, and to make use of the resolved states of those other elements of configuration while performing its own configuration.

+
+
+
+
+

Background

+
+
+

In a nutshell, the Software Model is a very declarative way to describe how a piece of software is built and the other components it needs as dependencies in the process. It also provides a new, rule-based engine for configuring a Gradle build. When we started to implement the software model we set ourselves the following goals:

+
+
+
    +
  • +

    Improve configuration and execution time performance.

    +
  • +
  • +

    Make customizations of builds with complex tool chains easier.

    +
  • +
  • +

    Provide a richer, more standardized way to model different software ecosystems.

    +
  • +
+
+
+

Gradle drastically improved configuration performance through other measures. There is no longer any need for a drastic, incompatible change in how Gradle builds are configured. Gradle’s support for building native software and Play Framework applications still use the configuration model.

+
+
+
+
+

Basic Concepts

+
+
+

The “model space”

+
+

The term “model space” is used to refer to the formal model, which can be read and modified by rules.

+
+
+

A counterpart to the model space is the “project space”, which should be familiar to readers. The “project space” is a graph of objects (e.g project.repositories, project.tasks etc.) having a Project as its root. A build script is effectively adding and configuring objects of this graph. For the most part, the “project space” is opaque to Gradle. It is an arbitrary graph of objects that Gradle only partially understands.

+
+
+

Each project also has its own model space, which is distinct from the project space. A key characteristic of the “model space” is that Gradle knows much more about it (which is knowledge that can be put to good use). The objects in the model space are “managed”, to a greater extent than objects in the project space. The origin, structure, state, collaborators and relationships of objects in the model space are first class constructs. This is effectively the characteristic that functionally distinguishes the model space from the project space: the objects of the model space are defined in ways that Gradle can understand them intimately, as opposed to an object that is the result of running relatively opaque code. A “rule” is effectively a building block of this definition.

+
+
+

The model space will eventually replace the project space, becoming the only “space”.

+
+
+
+

Rules

+
+

The model space is defined by “rules”. A rule is just a function (in the abstract sense) that either produces a model element, or acts upon a model element. Every rule has a single subject and zero or more inputs. Only the subject can be changed by a rule, while the inputs are effectively immutable.

+
+
+

Gradle guarantees that all inputs are fully “realized“ before the rule executes. The process of “realizing” a model element is effectively executing all the rules for which it is the subject, transitioning it to its final state. There is a strong analogy here to Gradle’s task graph and task execution model. Just as tasks depend on each other and Gradle ensures that dependencies are satisfied before executing a task, rules effectively depend on each other (i.e. a rule depends on all rules whose subject is one of the inputs) and Gradle ensures that all dependencies are satisfied before executing the rule.

+
+
+

Model elements are very often defined in terms of other model elements. For example, a compile task’s configuration can be defined in terms of the configuration of the source set that it is compiling. In this scenario, the compile task would be the subject of a rule and the source set an input. Such a rule could configure the task subject based on the source set input without concern for how it was configured, who it was configured by or when the configuration was specified.

+
+
+

There are several ways to declare rules, and in several forms.

+
+
+
+
+
+

Rule sources

+
+
+

One way to define rules is via a RuleSource subclass. If an object extends RuleSource and contains any methods annotated by '@Mutate', then each such method defines a rule. For each such method, the first argument is the subject, and zero or more subsequent arguments may follow and are inputs of the rule.

+
+
+

Example: applying a rule source plugin

+
+
build.gradle
+
+
@Managed
+interface Person {
+  void setFirstName(String name)
+  String getFirstName()
+
+  void setLastName(String name)
+  String getLastName()
+}
+
+class PersonRules extends RuleSource {
+  @Model void person(Person p) {}
+
+  //Create a rule that modifies a Person and takes no other inputs
+  @Mutate void setFirstName(Person p) {
+    p.firstName = "John"
+  }
+
+  //Create a rule that modifies a ModelMap<Task> and takes as input a Person
+  @Mutate void createHelloTask(ModelMap<Task> tasks, Person p) {
+    tasks.create("hello") {
+      doLast {
+        println "Hello $p.firstName $p.lastName!"
+      }
+    }
+  }
+}
+
+apply plugin: PersonRules
+
+
+
+
Output of gradle hello
+
+
> gradle hello
+
+> Task :hello
+Hello John Smith!
+
+BUILD SUCCESSFUL in 0s
+1 actionable task: 1 executed
+
+
+
+

Each of the different methods of the rule source are discrete, independent rules. Their order, or the fact that they belong to the same class, do not affect their behavior.

+
+
+
+

Example: a model creation rule

+
+
build.gradle
+
+
@Model void person(Person p) {}
+
+
+
+

This rule declares that there is a model element at path "person" (defined by the method name), of type Person. This is the form of the Model type rule for Managed types. Here, the person object is the rule subject. The method could potentially have a body, that mutated the person instance. It could also potentially have more parameters, which would be the rule inputs.

+
+
+
+

Example: a model mutation rule

+
+
build.gradle
+
+
//Create a rule that modifies a Person and takes no other inputs
+@Mutate void setFirstName(Person p) {
+  p.firstName = "John"
+}
+
+
+
+

This Mutate rule mutates the person object. The first parameter to the method is the subject. Here, a by-type reference is used as no Path annotation is present on the parameter. It could also potentially have more parameters, that would be the rule inputs.

+
+
+
+

Example: creating a task

+
+
build.gradle
+
+
//Create a rule that modifies a ModelMap<Task> and takes as input a Person
+@Mutate void createHelloTask(ModelMap<Task> tasks, Person p) {
+  tasks.create("hello") {
+    doLast {
+      println "Hello $p.firstName $p.lastName!"
+    }
+  }
+}
+
+
+
+

This Mutate rule effectively adds a task, by mutating the tasks collection. The subject here is the "tasks" node, which is available as a ModelMap of Task. The only input is our person element. As the person is being used as an input here, it will have been realised before executing this rule. That is, the task container effectively depends on the person element. If there are other configuration rules for the person element, potentially specified in a build script or other plugin, they will also be guaranteed to have been executed.

+
+
+

As Person is a Managed type in this example, any attempt to modify the person parameter in this method would result in an exception being thrown. Managed objects enforce immutability at the appropriate point in their lifecycle.

+
+
+

Rule source plugins can be packaged and distributed in the same manner as other types of plugins (see Custom Plugins). They also may be applied in the same manner (to project objects) as Plugin implementations (i.e. via Project.apply(java.util.Map)).

+
+
+

Please see the documentation for RuleSource for more information on constraints on how rule sources must be implemented and for more types of rules.

+
+
+
+
+
+

Advanced Concepts

+
+
+

Model paths

+
+

A model path identifies the location of an element relative to the root of its model space. A common representation is a period-delimited set of names. For example, the model path "tasks" is the path to the element that is the task container. Assuming a task whose name is hello, the path "tasks.hello" is the path to this task.

+
+
+
+

Managed model elements

+
+

Currently, any kind of Java object can be part of the model space. However, there is a difference between “managed” and “unmanaged” objects.

+
+
+

A “managed” object is transparent and enforces immutability once realized. Being transparent means that its structure is understood by the rule infrastructure and as such each of its properties are also individual elements in the model space.

+
+
+

An “unmanaged” object is opaque to the model space and does not enforce immutability. Over time, more mechanisms will be available for defining managed model elements culminating in all model elements being managed in some way.

+
+
+

Managed models can be defined by attaching the @Managed annotation to an interface:

+
+
+
+

Example: a managed type

+
+
build.gradle
+
+
@Managed
+interface Person {
+  void setFirstName(String name)
+  String getFirstName()
+
+  void setLastName(String name)
+  String getLastName()
+}
+
+
+
+

By defining a getter/setter pair, you are effectively declaring a managed property. A managed property is a property for which Gradle will enforce semantics such as immutability when a node of the model is not the subject of a rule. Therefore, this example declares properties named firstName and lastName on the managed type Person. These properties will only be writable when the view is mutable, that is to say when the Person is the subject of a Rule (see below the explanation for rules).

+
+
+

Managed properties can be of any scalar type. In addition, properties can also be of any type which is itself managed:

+
+ +++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Property typeNullableExample
+

String

+
+

Yes

+
+
+
void setFirstName(String name)
+String getFirstName()
+
+
+

File

+
+

Yes

+
+
+
void setHomeDirectory(File homeDir)
+File getHomeDirectory()
+
+
+

Integer, Boolean, Byte, Short, Float, Long, Double

+
+

Yes

+
+
+
void setId(Long id)
+Long getId()
+
+
+

int, boolean, byte, short, float, long, double

+
+

No

+
+
+
void setEmployed(boolean isEmployed)
+boolean isEmployed()
+
+
+
+
+
+
void setAge(int age)
+int getAge()
+
+
+

Another managed type.

+
+

Only if read/write

+
+
+
void setMother(Person mother)
+Person getMother()
+
+
+

An enumeration type.

+
+

Yes

+
+
+
void setMaritalStatus(MaritalStatus status)
+MaritalStatus getMaritalStatus()
+
+
+

A ManagedSet. A managed set supports the creation of new named model elements, but not their removal.

+
+

Only if read/write

+
+
+
ModelSet<Person> getChildren()
+
+
+

A Set or List of scalar types. All classic operations on collections are supported: add, remove, clear…​

+
+

Only if read/write

+
+
+
void setUserGroups(List<String> groups)
+List<String> getUserGroups()
+
+
+
+

If the type of a property is itself a managed type, it is possible to declare only a getter, in which case you are declaring a read-only property. A read-only property will be instantiated by Gradle, and cannot be replaced with another object of the same type (for example calling a setter). However, the properties of that property can potentially be changed, if, and only if, the property is the subject of a rule. If it’s not the case, the property is immutable, like any classic read/write managed property, and properties of the property cannot be changed at all.

+
+
+

Managed types can be defined out of interfaces or abstract classes and are usually defined in plugins, which are written either in Java or Groovy. Please see the Managed annotation for more information on creating managed model objects.

+
+
+
+

Model element types

+
+

There are particular types (language types) supported by the model space and can be generalised as follows:

+
+ + ++++ + + + + + + + + + + + + + + + + + + + + + + + + +
Table 1. Type definitions
TypeDefinition

Scalar

+

A scalar type is one of the following:

+
+
+
    +
  • +

    a primitive type (e.g. int) or its boxed type (e.g Integer)

    +
  • +
  • +

    a BigInteger or BigDecimal

    +
  • +
  • +

    a String

    +
  • +
  • +

    a File

    +
  • +
  • +

    an enumeration type

    +
  • +
+

Scalar Collection

+

A java.util.List or java.util.Set containing one of the scalar types

+

Managed type

+

Any class which is a valid managed model (i.e.annotated with @Managed)

+

Managed collection

+
+

There are various contexts in which these types can be used:

+
+ + ++++ + + + + + + + + + + + + + + + + +
Table 2. Model type support
ContextSupported types

Creating top level model elements

+ +

Properties of managed model elements

+

The properties (attributes) of a managed model elements may be one or more of the following:

+
+
+ +
+
+
+

Language source sets

+
+

FunctionalSourceSets and subtypes of LanguageSourceSet (which have been registered via ComponentType) can be added to the model space via rules or via the model DSL.

+
+
+
+

Example: Strongly modelling sources sets

+
+
build.gradle
+
+
apply plugin: 'java-lang'
+
+//Creating LanguageSourceSets via rules
+class LanguageSourceSetRules extends RuleSource {
+    @Model
+    void mySourceSet(JavaSourceSet javaSource) {
+        javaSource.source.srcDir("src/main/my")
+    }
+}
+apply plugin: LanguageSourceSetRules
+
+//Creating LanguageSourceSets via the model DSL
+model {
+    another(JavaSourceSet) {
+        source {
+            srcDir "src/main/another"
+        }
+    }
+}
+
+//Using FunctionalSourceSets
+@Managed
+interface SourceBundle {
+    FunctionalSourceSet getFreeSources()
+    FunctionalSourceSet getPaidSources()
+}
+model {
+    sourceBundle(SourceBundle) {
+        freeSources.create("main", JavaSourceSet)
+        freeSources.create("resources", JvmResourceSet)
+        paidSources.create("main", JavaSourceSet)
+        paidSources.create("resources", JvmResourceSet)
+    }
+}
+
+
+
+
Output of gradle help
+
+
> gradle help
+
+> Task :help
+
+
+
+ + + + + +
+
+
+The code for this example can be found at samples/modelRules/language-support in the ‘-all’ distribution of Gradle. +
+
+
+
+

References, binding and scopes

+
+

As previously mentioned, a rule has a subject and zero or more inputs. The rule’s subject and inputs are declared as “references” and are “bound” to model elements before execution by Gradle. Each rule must effectively forward declare the subject and inputs as references. Precisely how this is done depends on the form of the rule. For example, the rules provided by a RuleSource declare references as method parameters.

+
+
+

A reference is either “by-path” or “by-type”.

+
+
+

A “by-type” reference identifies a particular model element by its type. For example, a reference to the TaskContainer effectively identifies the "tasks" element in the project model space. The model space is not exhaustively searched for candidates for by-type binding; rather, a rule is given a scope (discussed later) that determines the search space for a by-type binding.

+
+
+

A “by-path” reference identifies a particular model element by its path in model space. By-path references are always relative to the rule scope; there is currently no way to path “out” of the scope. All by-path references also have an associated type, but this does not influence what the reference binds to. The element identified by the path must however by type compatible with the reference, or a fatal “binding failure” will occur.

+
+
+

Binding scope

+
+

Rules are bound within a “scope”, which determines how references bind. Most rules are bound at the project scope (i.e. the root of the model graph for the project). However, rules can be scoped to a node within the graph. The ModelMap.named(java.lang.String, java.lang.Class) method is an example of a mechanism for applying scoped rules. Rules declared in the build script using the model {} block, or via a RuleSource applied as a plugin use the root of the model space as the scope. This can be considered the default scope.

+
+
+

By-path references are always relative to the rule scope. When the scope is the root, this effectively allows binding to any element in the graph. When it is not, then only the children of the scope can be referenced using "by-path" notation.

+
+
+

When binding by-type references, the following elements are considered:

+
+
+
    +
  • +

    The scope element itself.

    +
  • +
  • +

    The immediate children of the scope element.

    +
  • +
  • +

    The immediate children of the model space (i.e. project space) root.

    +
  • +
+
+
+

For the common case, where the rule is effectively scoped to the root, only the immediate children of the root need to be considered.

+
+
+
+

Binding to all elements in a scope matching type

+
+

Mutating or validating all elements of a given type in some scope is a common use-case. To accommodate this, rules can be applied via the @Each annotation.

+
+
+

In the example below, a @Defaults rule is applied to each FileItem in the model setting a default file size of "1024". Another rule applies a RuleSource to every DirectoryItem that makes sure all file sizes are positive and divisible by "16".

+
+
+
+
+

Example: a DSL example applying a rule to every element in a scope

+
+
build.gradle
+
+
@Managed interface Item extends Named {}
+@Managed interface FileItem extends Item {
+    void setSize(int size)
+    int getSize()
+}
+@Managed interface DirectoryItem extends Item {
+    ModelMap<Item> getChildren()
+}
+
+class PluginRules extends RuleSource {
+    @Defaults void setDefaultFileSize(@Each FileItem file) {
+        file.size = 1024
+    }
+
+    @Rules void applyValidateRules(ValidateRules rules, @Each DirectoryItem directory)  {}
+}
+apply plugin: PluginRules
+
+abstract class ValidateRules extends RuleSource {
+    @Validate
+    void validateSizeIsPositive(ModelMap<FileItem> files) {
+        files.each { file ->
+            assert file.size > 0
+        }
+    }
+
+    @Validate
+    void validateSizeDivisibleBySixteen(ModelMap<FileItem> files) {
+        files.each { file ->
+            assert file.size % 16 == 0
+        }
+    }
+}
+
+model {
+    root(DirectoryItem) {
+        children {
+            dir(DirectoryItem) {
+                children {
+                    file1(FileItem)
+                    file2(FileItem) { size = 2048 }
+                }
+            }
+            file3(FileItem)
+        }
+    }
+}
+
+
+
+ + + + + +
+
+
+The code for this example can be found at samples/modelRules/ruleSourcePluginEach in the ‘-all’ distribution of Gradle. +
+
+
+
+
+
+

The model DSL

+
+
+

In addition to using a RuleSource, it is also possible to declare a model and rules directly in a build script using the “model DSL”.

+
+
+ + + + + +
+
💡
+
+
+

The model DSL makes heavy use of various Groovy DSL features. Please have a read of Groovy DSL basics for an introduction to these Groovy features.

+
+
+
+
+

The general form of the model DSL is:

+
+
+
+
model {
+    «rule-definitions»
+}
+
+
+
+

All rules are nested inside a model block. There may be any number of rule definitions inside each model block, and there may be any number of model blocks in a build script. You can also use a model block in build scripts that are applied using apply from: $uri.

+
+
+

There are currently 2 kinds of rule that you can define using the model DSL: configuration rules, and creation rules.

+
+
+

Configuration rules

+
+

You can define a rule that configures a particular model element. A configuration rule has the following form:

+
+
+
+
model {
+    «model-path-to-subject» {
+        «configuration code»
+    }
+}
+
+
+
+

Continuing with the example so far of the model element "person" of type Person being present, the following DSL snippet adds a configuration rule for the person that sets its lastName property.

+
+
+
+

Example: DSL configuration rule

+
+
build.gradle
+
+
model {
+    person {
+        lastName = "Smith"
+    }
+}
+
+
+
+

A configuration rule specifies a path to the subject that should be configured and a closure containing the code to run when the subject is configured. The closure is executed with the subject passed as the closure delegate. Exactly what code you can provide in the closure depends on the type of the subject. This is discussed below.

+
+
+

You should note that the configuration code is not executed immediately but is instead executed only when the subject is required. This is an important behaviour of model rules and allows Gradle to configure only those elements that are required for the build, which helps reduce build time. For example, let’s run a task that uses the "person" object:

+
+
+
+

Example: Configuration run when required

+
+
build.gradle
+
+
model {
+    person {
+        println "configuring person"
+        lastName = "Smith"
+    }
+}
+
+
+
+
Output of gradle showPerson
+
+
> gradle showPerson
+configuring person
+
+> Task :showPerson
+Hello John Smith!
+
+BUILD SUCCESSFUL in 0s
+1 actionable task: 1 executed
+
+
+
+

You can see that before the task is run, the "person" element is configured by running the rule closure. Now let’s run a task that does not require the "person" element:

+
+
+
+

Example: Configuration not run when not required

+
+
Output of gradle somethingElse
+
+
> gradle somethingElse
+
+> Task :somethingElse
+Not using person
+
+BUILD SUCCESSFUL in 0s
+1 actionable task: 1 executed
+
+
+
+

In this instance, you can see that the "person" element is not configured at all.

+
+
+
+

Creation rules

+
+

It is also possible to create model elements at the root level. The general form of a creation rule is:

+
+
+
+
model {
+    «element-name»(«element-type») {
+        «initialization code»
+    }
+}
+
+
+
+

The following model rule creates the "person" element:

+
+
+
+

Example: DSL creation rule

+
+
build.gradle
+
+
model {
+    person(Person) {
+        firstName = "John"
+    }
+}
+
+
+
+

A creation rule definition specifies the path of the element to create, plus its public type, represented as a Java interface or class. Only certain types of model elements can be created.

+
+
+

A creation rule may also provide a closure containing the initialization code to run when the element is created. The closure is executed with the element passed as the closure delegate. Exactly what code you can provide in the closure depends on the type of the subject. This is discussed below.

+
+
+

The initialization closure is optional and can be omitted, for example:

+
+
+
+

Example: DSL creation rule without initialization

+
+
build.gradle
+
+
model {
+    barry(Person)
+}
+
+
+
+

You should note that the initialization code is not executed immediately but is instead executed only when the element is required. The initialization code is executed before any configuration rules are run. For example:

+
+
+
+

Example: Initialization before configuration

+
+
build.gradle
+
+
model {
+    person {
+        println "configuring person"
+        println "last name is $lastName, should be Smythe"
+        lastName = "Smythe"
+    }
+    person(Person) {
+        println "creating person"
+        firstName = "John"
+        lastName = "Smith"
+    }
+}
+
+
+
+
Output of gradle showPerson
+
+
> gradle showPerson
+creating person
+configuring person
+last name is Smith, should be Smythe
+
+> Task :showPerson
+Hello John Smythe!
+
+BUILD SUCCESSFUL in 0s
+1 actionable task: 1 executed
+
+
+
+

Notice that the creation rule appears in the build script after the configuration rule, but its code runs before the code of the configuration rule. Gradle collects up all the rules for a particular subject before running any of them, then runs the rules in the appropriate order.

+
+
+
+

Model rule closures

+
+

Most DSL rules take a closure containing some code to run to configure the subject. The code you can use in this closure depends on the type of the subject of the rule.

+
+
+ + + + + +
+
💡
+
+
+

You can use the model report to determine the type of a particular model element.

+
+
+
+
+

In general, a rule closure may contain arbitrary code, mixed with some type specific DSL syntax.

+
+
+

ModelMap<T> subject

+
+

A ModelMap is basically a map of model elements, indexed by some name. When a ModelMap is used as the subject of a DSL rule, the rule closure can use any of the methods defined on the ModelMap interface.

+
+
+

A rule closure with ModelMap as a subject can also include nested creation or configuration rules. These behave in a similar way to the creation and configuration rules that appear directly under the model block.

+
+
+

Here is an example of a nested creation rule:

+
+
+
+
+

Example: Nested DSL creation rule

+
+
build.gradle
+
+
model {
+    people {
+        john(Person) {
+            firstName = "John"
+        }
+    }
+}
+
+
+
+

As before, a nested creation rule defines a name and public type for the element, and optionally, a closure containing code to use to initialize the element. The code is run only when the element is required in the build.

+
+
+

Here is an example of a nested configuration rule:

+
+
+
+

Example: Nested DSL configuration rule

+
+
build.gradle
+
+
model {
+    people {
+        john {
+            lastName = "Smith"
+        }
+    }
+}
+
+
+
+

As before, a nested configuration rule defines the name of the element to configure and a closure containing code to use to configure the element. The code is run only when the element is required in the build.

+
+
+

ModelMap introduces several other kinds of rules. For example, you can define a rule that targets each of the elements in the map. The code in the rule closure is executed once for each element in the map, when that element is required. Let’s run a task that requires all of the children of the "people" element:

+
+
+
+

Example: DSL configuration rule for each element in a map

+
+
build.gradle
+
+
model {
+    people {
+        john(Person) {
+            println "creating $it"
+            firstName = "John"
+            lastName = "Smith"
+        }
+        all {
+            println "configuring $it"
+        }
+        barry(Person) {
+            println "creating $it"
+            firstName = "Barry"
+            lastName = "Barry"
+        }
+    }
+}
+
+
+
+
Output of gradle listPeople
+
+
> gradle listPeople
+creating Person 'people.barry'
+configuring Person 'people.barry'
+creating Person 'people.john'
+configuring Person 'people.john'
+
+> Task :listPeople
+Hello Barry Barry!
+Hello John Smith!
+
+BUILD SUCCESSFUL in 0s
+1 actionable task: 1 executed
+
+
+
+

Any method on ModelMap that accepts an Action as its last parameter can also be used to define a nested rule.

+
+
+

@Managed type subject

+
+

When a managed type is used as the subject of a DSL rule, the rule closure can use any of the methods defined on the managed type interface.

+
+
+

A rule closure can also configure the properties of the element using nested closures. For example:

+
+
+
+
+

Example: Nested DSL property configuration

+
+
build.gradle
+
+
model {
+    person {
+        address {
+            city = "Melbourne"
+        }
+    }
+}
+
+
+
+ + + + + +
+
+
+
+

Currently, the nested closures do not define rules and are executed immediately. Please be aware that this behaviour will change in a future Gradle release.

+
+
+
+
+

All other subjects

+
+

For all other types, the rule closure can use any of the methods defined by the type. There is no special DSL defined for these elements.

+
+
+
+
+

Automatic type coercion

+
+

Scalar properties in managed types can be assigned CharSequence values (e.g. String, GString, etc.) and they will be converted to the actual property type for you. This works for all scalar types including `File`s, which will be resolved relative to the current project.

+
+
+
+

Example: a DSL example showing type conversions

+
+
build.gradle
+
+
enum Temperature {
+   TOO_HOT,
+   TOO_COLD,
+   JUST_RIGHT
+}
+
+@Managed
+interface Item {
+   void setName(String n); String getName()
+
+   void setQuantity(int q); int getQuantity()
+
+   void setPrice(float p); float getPrice()
+
+   void setTemperature(Temperature t)
+   Temperature getTemperature()
+
+   void setDataFile(File f); File getDataFile()
+}
+
+class ItemRules extends RuleSource {
+   @Model
+   void item(Item item) {
+      def data = item.dataFile.text.trim()
+      def (name, quantity, price, temp) = data.split(',')
+      item.name = name
+      item.quantity = quantity
+      item.price = price
+      item.temperature = temp
+   }
+
+   @Defaults
+   void setDefaults(Item item) {
+      item.dataFile = 'data.csv'
+   }
+
+   @Mutate
+   void createDataTask(ModelMap<Task> tasks, Item item) {
+      tasks.create('showData') {
+         doLast {
+            println """
+Item '$item.name'
+   quantity:    $item.quantity
+   price:       $item.price
+   temperature: $item.temperature"""
+         }
+      }
+   }
+}
+
+apply plugin: ItemRules
+
+model {
+   item {
+      price = "${price * (quantity < 10 ? 2 : 0.5)}"
+   }
+}
+
+
+
+ + + + + +
+
+
+The code for this example can be found at samples/modelRules/modelDslCoercion in the ‘-all’ distribution of Gradle. +
+
+
+

In the above example, an Item is created and is initialized in setDefaults() by providing the path to the data file. In the item() method the resolved File is parsed to extract and set the data. In the DSL block at the end, the price is adjusted based on the quantity; if there are fewer than 10 remaining the price is doubled, otherwise it is reduced by 50%. The GString expression is a valid value since it resolves to a float value in string form.

+
+
+

Finally, in createDataTask() we add the showData task to display all of the configured values.

+
+
+
+

Declaring input dependencies

+
+

Rules declared in the DSL may depend on other model elements through the use of a special syntax, which is of the form:

+
+
+
+
$.«path-to-model-element»
+
+
+
+

Paths are a period separated list of identifiers. To directly depend on the firstName of the person, the following could be used:

+
+
+
+
$.person.firstName
+
+
+
+
+

Example: a DSL rule using inputs

+
+
build.gradle
+
+
model {
+    tasks {
+        hello(Task) {
+            def p = $.person
+            doLast {
+                println "Hello $p.firstName $p.lastName!"
+            }
+        }
+    }
+}
+
+
+
+ + + + + +
+
+
+The code for this example can be found at samples/modelRules/modelDsl in the ‘-all’ distribution of Gradle. +
+
+
+

In the above snippet, the $.person construct is an input reference. The construct returns the value of the model element at the specified path, as its default type (i.e. the type advertised by the Model Report). It may appear anywhere in the rule that an expression may normally appear. It is not limited to the right hand side of variable assignments.

+
+
+

The input element is guaranteed to be fully configured before the rule executes. That is, all of the rules that mutate the element are guaranteed to have been previously executed, leaving the target element in its final, immutable, state.

+
+
+

Most model elements enforce immutability when being used as inputs. Any attempt to mutate such an element will result in a runtime error. However, some legacy type objects do not currently implement such checks. Regardless, it is always invalid to attempt to mutate an input to a rule.

+
+
+

Using ModelMap<T> as an input

+
+

When you use a ModelMap as input, each item in the map is made available as a property.

+
+
+
+
+
+
+

The model report

+
+
+

The built-in ModelReport task displays a hierarchical view of the elements in the model space. Each item prefixed with a + on the model report is a model element and the visual nesting of these elements correlates to the model path (e.g. tasks.help). The model report displays the following details about each model element:

+
+ + ++++ + + + + + + + + + + + + + + + + + + + + + + + + +
Table 3. Model report - model element details
DetailDescription

Type

This is the underlying type of the model element and is typically a fully qualified class name.

Value

Is conditionally displayed on the report when a model element can be represented as a string.

Creator

Every model element has a creator. A creator signifies the origin of the model element (i.e. what created the model element).

Rules

Is a listing of the rules, excluding the creator rule, which are executed for a given model element. The order in which the rules are displayed reflects the order in which they are executed.

+
+

Example: Model task output

+
+
Output of gradle model
+
+
> gradle model
+
+> Task :model
+
+------------------------------------------------------------
+Root project
+------------------------------------------------------------
+
++ person
+      | Type:   	Person
+      | Creator: 	PersonRules#person(Person)
+      | Rules:
+         ⤷ person { ... } @ build.gradle line 97, column 3
+         ⤷ PersonRules#setFirstName(Person)
+    + age
+          | Type:   	int
+          | Value:  	0
+          | Creator: 	PersonRules#person(Person)
+    + children
+          | Type:   	org.gradle.model.ModelSet<Person>
+          | Creator: 	PersonRules#person(Person)
+    + employed
+          | Type:   	boolean
+          | Value:  	false
+          | Creator: 	PersonRules#person(Person)
+    + father
+          | Type:   	Person
+          | Value:  	null
+          | Creator: 	PersonRules#person(Person)
+    + firstName
+          | Type:   	java.lang.String
+          | Value:  	John
+          | Creator: 	PersonRules#person(Person)
+    + homeDirectory
+          | Type:   	java.io.File
+          | Value:  	null
+          | Creator: 	PersonRules#person(Person)
+    + id
+          | Type:   	java.lang.Long
+          | Value:  	null
+          | Creator: 	PersonRules#person(Person)
+    + lastName
+          | Type:   	java.lang.String
+          | Value:  	Smith
+          | Creator: 	PersonRules#person(Person)
+    + maritalStatus
+          | Type:   	MaritalStatus
+          | Creator: 	PersonRules#person(Person)
+    + mother
+          | Type:   	Person
+          | Value:  	null
+          | Creator: 	PersonRules#person(Person)
+    + userGroups
+          | Type:   	java.util.List<java.lang.String>
+          | Value:  	null
+          | Creator: 	PersonRules#person(Person)
++ tasks
+      | Type:   	org.gradle.model.ModelMap<org.gradle.api.Task>
+      | Creator: 	Project.<init>.tasks()
+      | Rules:
+         ⤷ PersonRules#createHelloTask(ModelMap<Task>, Person)
+    + buildEnvironment
+          | Type:   	org.gradle.api.tasks.diagnostics.BuildEnvironmentReportTask
+          | Value:  	task ':buildEnvironment'
+          | Creator: 	Project.<init>.tasks.buildEnvironment()
+          | Rules:
+             ⤷ copyToTaskContainer
+    + components
+          | Type:   	org.gradle.api.reporting.components.ComponentReport
+          | Value:  	task ':components'
+          | Creator: 	Project.<init>.tasks.components()
+          | Rules:
+             ⤷ copyToTaskContainer
+    + dependencies
+          | Type:   	org.gradle.api.tasks.diagnostics.DependencyReportTask
+          | Value:  	task ':dependencies'
+          | Creator: 	Project.<init>.tasks.dependencies()
+          | Rules:
+             ⤷ copyToTaskContainer
+    + dependencyInsight
+          | Type:   	org.gradle.api.tasks.diagnostics.DependencyInsightReportTask
+          | Value:  	task ':dependencyInsight'
+          | Creator: 	Project.<init>.tasks.dependencyInsight()
+          | Rules:
+             ⤷ copyToTaskContainer
+    + dependentComponents
+          | Type:   	org.gradle.api.reporting.dependents.DependentComponentsReport
+          | Value:  	task ':dependentComponents'
+          | Creator: 	Project.<init>.tasks.dependentComponents()
+          | Rules:
+             ⤷ copyToTaskContainer
+    + hello
+          | Type:   	org.gradle.api.Task
+          | Value:  	task ':hello'
+          | Creator: 	PersonRules#createHelloTask(ModelMap<Task>, Person) > create(hello)
+          | Rules:
+             ⤷ copyToTaskContainer
+    + help
+          | Type:   	org.gradle.configuration.Help
+          | Value:  	task ':help'
+          | Creator: 	Project.<init>.tasks.help()
+          | Rules:
+             ⤷ copyToTaskContainer
+    + init
+          | Type:   	org.gradle.buildinit.tasks.InitBuild
+          | Value:  	task ':init'
+          | Creator: 	Project.<init>.tasks.init()
+          | Rules:
+             ⤷ copyToTaskContainer
+    + model
+          | Type:   	org.gradle.api.reporting.model.ModelReport
+          | Value:  	task ':model'
+          | Creator: 	Project.<init>.tasks.model()
+          | Rules:
+             ⤷ copyToTaskContainer
+    + projects
+          | Type:   	org.gradle.api.tasks.diagnostics.ProjectReportTask
+          | Value:  	task ':projects'
+          | Creator: 	Project.<init>.tasks.projects()
+          | Rules:
+             ⤷ copyToTaskContainer
+    + properties
+          | Type:   	org.gradle.api.tasks.diagnostics.PropertyReportTask
+          | Value:  	task ':properties'
+          | Creator: 	Project.<init>.tasks.properties()
+          | Rules:
+             ⤷ copyToTaskContainer
+    + tasks
+          | Type:   	org.gradle.api.tasks.diagnostics.TaskReportTask
+          | Value:  	task ':tasks'
+          | Creator: 	Project.<init>.tasks.tasks()
+          | Rules:
+             ⤷ copyToTaskContainer
+    + wrapper
+          | Type:   	org.gradle.api.tasks.wrapper.Wrapper
+          | Value:  	task ':wrapper'
+          | Creator: 	Project.<init>.tasks.wrapper()
+          | Rules:
+             ⤷ copyToTaskContainer
+
+
+
+
+
+
+

Limitations and future direction

+
+
+

The rule engine that was part of the Software Model will be deprecated. Everything under the model block will be ported as extensions to the current model. Native users will no longer have a separate extension model compared to the rest of the Gradle community, and they will be able to make use of the new variant aware dependency management. For more information, see the blog post on the state and future of the software model.

+
+
+
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/docs/userguide/task_configuration_avoidance.html b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/docs/userguide/task_configuration_avoidance.html new file mode 100644 index 0000000..c7845df --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/docs/userguide/task_configuration_avoidance.html @@ -0,0 +1,3587 @@ + + + + + + + +Task Configuration Avoidance + + + + + + + + + +
+ + + +
+ + +
+
+
+
+

This chapter provides an introduction to "configuration avoidance" when dealing with tasks and explains some guidelines for migrating your build to use the configuration avoidance APIs effectively. The API described here co-exists with an existing API that will be replaced with our usual deprecation process over several major releases. As of Gradle 5.1, we recommend that the configuration avoidance APIs be used whenever tasks are created by custom plugins.

+
+
+
+
+

How does the configuration avoidance API work?

+
+
+

In a nutshell, the API allows builds to avoid the cost of creating and configuring tasks during Gradle’s configuration phase when those tasks will never be executed. For example, when running a compile task, other unrelated tasks, like code quality, testing and publishing tasks, will not be executed, so any time spent creating and configuring those tasks is unnecessary. The configuration avoidance API avoids configuring tasks if they will not needed during the course of a build, which can have a significant impact on total configuration time.

+
+
+

To avoid creating and configuring tasks, we say that a task is "registered" but not created. When a task is in this state, it is known to the build, it can be configured, and references to it can be passed around, but the task object itself has not actually been created, and none of its configuration actions have been executed. It will remain in this state until something in the build needs the instantiated task object (for instance if the task is executed on the command line or the task is a dependency of a task executed on the command line). If the task object is never needed, then the task will remain in the registered state, and the cost of creating and configuring the task will be avoided.

+
+
+

In Gradle, you register a task using TaskContainer.register(java.lang.String). There are variations of this method that allow providing a task type and/or an action for modifying the task configuration. Instead of returning a task instance, the register(…​) method returns a TaskProvider, which is a reference to the task that can be used in many places where a normal task object might be used (for example when creating task dependencies).

+
+
+
+
+

Guidelines

+
+
+

How do I defer task creation?

+
+

Effective task configuration avoidance requires build authors to change instances of TaskContainer.create(java.lang.String) to TaskContainer.register(java.lang.String).

+
+
+

Older versions of Gradle only support the create(…​) API. The create(…​) API eagerly creates and configures tasks when it is called and should be avoided.

+
+
+

Using register(…​) alone may not be enough to avoid all task configuration completely. You may need to change other code that configures tasks by name or by type, as explained in the following sections.

+
+
+
+

How do I defer task configuration?

+
+

Eager APIs like DomainObjectCollection.all(org.gradle.api.Action) and DomainObjectCollection.withType(java.lang.Class, org.gradle.api.Action) will immediately create and configure any registered tasks. To defer task configuration, you will need to migrate to a configuration avoidance API equivalent. See the table below to identify the alternative.

+
+
+
+

How do I reference a task without creating/configuring it?

+
+

Instead of referencing a task object, you can work with a registered task via a TaskProvider object. A TaskProvider can be obtained in several ways including when calling TaskContainer.register(java.lang.String) or using the TaskCollection.named(java.lang.String) method.

+
+
+

Calling Provider.get() or looking up a task by name with TaskCollection.getByName(java.lang.String) will cause the task to be created and configured. Methods like Task.dependsOn(java.lang.Object…​) and ConfigurableFileCollection.builtBy(java.lang.Object...) work with TaskProvider in the same way as Task, so you do not need to unwrap a Provider for explicit dependencies to continue to work.

+
+
+

If you are configuring a task by name, you will need to use the configuration avoidance equivalent. See the table below to identify the alternative.

+
+
+
+

How to get an instance of a Task?

+
+

In the event you still need to get access to a Task instance, you can use TaskCollection.named(java.lang.String) and call Provider.get(). This will cause the task to be created/configured, but everything should work as it has with the eager APIs.

+
+
+
+
+
+

Migration Guide

+
+
+

The following sections will go through some general guidelines to adhere to when migrating the build logic as well as the steps we recommend following. +We also cover some troubleshooting and pitfalls to help you work around some issues you may encounter during the migration.

+
+
+

General

+
+
    +
  1. +

    Use help task as a benchmark during the migration. +The help task is the perfect candidate to benchmark your migration process. +In a build that uses only the configuration avoidance API, a build scan would show no tasks created immediately or created during configuration, and only the tasks that were actually executed would be created. +Be mindful of the version of the build scan plugin in use.

    +
  2. +
  3. +

    Only mutate the current task inside a configuration action. +Because the task configuration action can now run immediately, later or never, mutating anything other than the current task can cause indeterminate behavior in your build. +Consider the following code:

    +
    +
    +
    +
    +
    +
    +
    def check = tasks.register("check")
    +tasks.register("verificationTask") { verificationTask ->
    +    // Configure verificationTask
    +
    +    // Run verificationTask when someone runs check
    +    check.get().dependsOn verificationTask
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    val check by tasks.registering
    +tasks.register("verificationTask") {
    +    // Configure verificationTask
    +
    +    // Run verificationTask when someone runs check
    +    check.get().dependsOn(this)
    +}
    +
    +
    +
    +
    +
    +
    +
    +

    Executing the gradle check task should execute verificationTask, but with this example, it won’t. +This is because the dependency between verificationTask and check only happens when verificationTask is realized. +To avoid issues like this, you must only modify the task associated with the configuration action. +Other tasks should be modified in their own configuration action. +The code would become:

    +
    +
    +
    +
    +
    +
    +
    +
    def check = tasks.register("check")
    +def verificationTask = tasks.register("verificationTask") {
    +    // Configure verificationTask
    +}
    +check.configure {
    +    dependsOn verificationTask
    +}
    +
    +
    +
    +
    +
    +
    +
    +
    +
    val check by tasks.registering
    +val verificationTask by tasks.registering {
    +    // Configure verificationTask
    +}
    +check {
    +    dependsOn(verificationTask)
    +}
    +
    +
    +
    +
    +
    +
    +
    +

    In the future, Gradle will consider this sort of anti-pattern an error and will produce an exception.

    +
    +
  4. +
  5. +

    Prefer small incremental changes. +Smaller changes are easier to sanity check. +If you ever break your build logic, it will be easier to analyze the changelog since the last successful verification.

    +
  6. +
  7. +

    Ensure a good plan is established for validating the build logic. +Usually, a simple build task invocation should do the trick to validate your build logic. +However, some builds may need additional verification - understand the behavior of your build and make sure you have a good plan for verification.

    +
  8. +
  9. +

    Prefer automatic testing to manual testing. +It’s good practice to write integration test for your build logic using TestKit.

    +
  10. +
  11. +

    Avoid referencing a task by name. +In the majority of cases, referencing a task by name is a fragile pattern and should be avoided. +Although the task name is available on the TaskProvider, effort should be made to use references from a strongly typed model instead.

    +
  12. +
  13. +

    Use the new task API as much as possible. +Eagerly realizing some tasks may cause a cascade of other tasks to be realized. +Using TaskProvider helps create an indirection that protects against transitive realization.

    +
  14. +
  15. +

    Some APIs may be disallowed if you try to access them from the new API’s configuration blocks. For example, +Project.afterEvaluate() +cannot be called when configuring a task registered with the new API. Since afterEvaluate is used to delay configuring a Project, mixing delayed configuration +with the new API can cause errors that are hard to diagnose because tasks registered with the new API are not always configured, but an afterEvaluate block +may be expected to always execute.

    +
  16. +
+
+
+
+

Migration Steps

+
+

The first part of the migration process is to go through the code and manually migrate eager task creation and configuration to use configuration avoidance APIs. +The following explores the recommended steps for a successful migration. +While going through these steps, keep in mind the guidelines above.

+
+
+ + + + + +
+
+
+
+

Using the new API in a plugin will require users to use Gradle 4.9 or later. Plugin authors should refer to Supporting older versions of Gradle section.

+
+
+
+
+
    +
  1. +

    Migrate task configuration that affects all tasks (tasks.all {}) or subsets by type (tasks.withType(…​) {}). +This will cause your build to eagerly create fewer tasks that are registered by plugins.

    +
  2. +
  3. +

    Migrate tasks configured by name. +Similar to the previous point, this will cause your build to eagerly create fewer tasks that are registered by plugins. +For example, logic that uses TaskContainer#getByName(String, Closure/Action) should be converted to TaskContainer#named(String).configure(Closure/Action). +This also includes task configuration via DSL blocks.

    +
  4. +
  5. +

    Migrate tasks creation to register(…​). +At this point, you should change anywhere that you are creating tasks to instead register those tasks.

    +
  6. +
+
+
+

For all steps above, be aware of the common pitfalls around deferred configuration.

+
+
+

After making these changes, you should see improvement in the number of tasks that are eagerly created at configuration time. Use build scans to understand what tasks are still being created eagerly and where this is happening.

+
+
+
+

Troubleshooting

+
+
    +
  • +

    What tasks are being realized? +As we keep developing the feature, more reporting, and troubleshooting information will be made available to answer this question. +In the meantime, build scan is the best way to answer this question. +Follow these steps:

    +
    +
      +
    1. +

      Create a build scan. +Execute the Gradle command using the --scan flag.

      +
    2. +
    3. +

      Navigate to the configuration performance tab.

      +
      +
      +taskConfigurationAvoidance navigate to performance +
      +
      Figure 1. Navigate to configuration performance tab in build scan
      +
      +
      +
        +
      1. +

        Navigate to the performance card from the left side menu.

        +
      2. +
      3. +

        Navigate to the configuration tab from the top of the performance card.

        +
      4. +
      +
      +
    4. +
    5. +

      All the information requires will be presented.

      +
      +
      +taskConfigurationAvoidance performance annotated +
      +
      Figure 2. Configuration performance tab in build scan annotated
      +
      +
      +
        +
      1. +

        Total tasks present when each task is created or not.

        +
        +
          +
        • +

          "Created immediately" represents tasks that were created using the eager task APIs.

          +
        • +
        • +

          "Created during configuration" represents tasks that were created using the configuration avoidance APIs, but were realized explicitly (via TaskProvider#get()) or implicitly using the eager task query APIs.

          +
        • +
        • +

          Both "Created immediately" and "Created during configuration" numbers are considered the "bad" numbers that should be minimized as much as possible.

          +
        • +
        • +

          "Created during task graph calculation" represents the tasks created when building the execution task graph. +Ideally, this number would be equal to the number of tasks executed.

          +
        • +
        • +

          "Not created" represents the tasks that were avoided in this build session.

          +
        • +
        +
        +
      2. +
      3. +

        The next section helps answer the question of where a task was realized. For each script, plugin or lifecycle callback, the last column represents the tasks that were created either immediately or during configuration. +Ideally, this column should be empty.

        +
      4. +
      5. +

        Focusing on a script, plugin, or lifecycle callback will show a break down of the tasks that were created.

        +
      6. +
      +
      +
    6. +
    +
    +
  • +
+
+
+
+

Pitfalls

+
+
    +
  • +

    Beware of the hidden eager task realization. +There are many ways that a task can be configured eagerly. For example, configuring a task using the task name and a DSL block will cause the task to immediately be created:

    +
    +
    +
    // Given a task lazily created with
    +tasks.register("someTask")
    +
    +// Some time later, the task is configured using a DSL block
    +someTask {
    +    // This causes the task to be created and this configuration to be executed immediately
    +}
    +
    +
    +
    +

    Instead use the named() method to acquire a reference to the task and configure it:

    +
    +
    +
    +
    tasks.named("someTask").configure {
    +    // ...
    +    // Beware of the pitfalls here
    +}
    +
    +
    +
    +

    Similarly, Gradle has syntactic sugar that allows tasks to be referenced by name without an explicit query method. This can also cause the task to be immediately created:

    +
    +
    +
    +
    tasks.register("someTask")
    +
    +// Sometime later, an eager task is configured like
    +task anEagerTask {
    +    // The following will cause "someTask" to be looked up and immediately created
    +    dependsOn someTask
    +}
    +
    +
    +
    +

    There are several ways this premature creation can be avoided:

    +
    +
    +
      +
    • +

      Use a TaskProvider variable. +Useful when the task is referenced multiple times in the same build script.

      +
      +
      +
      +
      +
      +
      +
      def someTask = tasks.register("someTask")
      +
      +task anEagerTask {
      +    dependsOn someTask
      +}
      +
      +
      +
      +
      +
      +
      +
      +
      +
      val someTask by tasks.registering
      +
      +task("anEagerTask") {
      +    dependsOn(someTask)
      +}
      +
      +
      +
      +
      +
      +
      +
    • +
    • +

      Migrate the consumer task to the new API.

      +
      +
      +
      tasks.register("someTask")
      +
      +tasks.register("anEagerTask") {
      +    dependsOn someTask
      +}
      +
      +
      +
    • +
    • +

      Lookup the task lazily. +Useful when the tasks are not created by the same plugin.

      +
      +
      +
      +
      +
      +
      +
      tasks.register("someTask")
      +
      +task anEagerTask {
      +    dependsOn tasks.named("someTask")
      +}
      +
      +
      +
      +
      +
      +
      +
      +
      +
      tasks.register("someTask")
      +
      +task("anEagerTask") {
      +    dependsOn(tasks.named("someTask"))
      +}
      +
      +
      +
      +
      +
      +
      +
    • +
    +
    +
  • +
  • +

    The build scan plugin buildScanPublishPrevious task is eager until version 1.15. Upgrade the build scan plugin in your build to use the latest version.

    +
  • +
+
+
+

Supporting older versions of Gradle

+
+

This section describes two ways to keep your plugin backward compatible with older version of Gradle if you must maintain compatibility with versions of Gradle older than 4.9. Most of the new API methods are available starting with Gradle 4.9.

+
+
+ + + + + +
+
+
+
+

Although backward compatibility is good for users, we still recommended to upgrade to newer Gradle releases in a timely manner. This will reduce your maintenance burden.

+
+
+
+
+

The first method to maintain compatibility is to compile your plugin against the Gradle 4.9 API and conditionally call the right APIs with Groovy (example).

+
+
+

The second method is to use Java reflection to cope with the fact that the APIs are unavailable during compilation (example).

+
+
+

It is highly recommended to have cross-version test coverage using TestKit and multiple versions of Gradle.

+
+
+
+
+
+
+

Existing vs New API overview

+
+
+ + + + + +
+
+
+
+
    +
  • +

    Methods that take a groovy.lang.Closure are covered in the new API with methods taking org.gradle.api.Action.

    +
  • +
  • +

    More convenience methods may be added in the future based on user feedback.

    +
  • +
  • +

    Some old API methods may never have a direct replacement in the new API.

    +
  • +
  • +

    Some APIs may be restricted when accessed in a configuration action registered via the configuration avoidance methods.

    +
  • +
+
+
+
+ ++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Old vs New APIDescription
+

Instead of: task myTask(type: MyTask) {}

+
+

There is not a shorthand Groovy DSL for using the new API.

+
+

Use: tasks.register("myTask", MyTask) {}

+
+

Use one of the alternatives below.

+
+

Use: No direct equivalent.

+
+

Use one of the alternatives below.

+
+

Use: No direct equivalent.

+
+

This returns a TaskProvider instead of a Task.

+
+

This returns a TaskProvider instead of a Task.

+
+

This returns a TaskProvider instead of a Task.

+
+

This returns a TaskProvider instead of a Task.

+
+

This returns a TaskProvider instead of a Task.

+
+

This returns a TaskProvider instead of a Task.

+
+

This returns a TaskProvider instead of a Task.

+
+

Use: named(java.lang.String).configure(Action)

+
+

Accessing tasks from another project requires a specific ordering of project evaluation.

+
+

Use: No direct equivalent.

+
+

named(String) is the closest equivalent, but will fail if the task does not exist. Using findByName(String) will cause tasks registered with the new API to be created/configured.

+
+

Use: No direct equivalent.

+
+

See getByPath(String) above.

+
+

Use: No direct equivalent.

+
+

This is OK to use because it does not require tasks to be created immediately.

+
+

Use: OK

+
+

Instead of: withType(java.lang.Class).getByName(java.lang.String)

+
+

This returns a TaskProvider instead of a Task.

+
+

Use: named(java.lang.String, java.lang.Class)

+
+

This returns void, so it cannot be chained.

+
+

Use: withType(java.lang.Class).configureEach(org.gradle.api.Action)

+
+

This returns void, so it cannot be chained.

+
+

This returns void, so it cannot be chained.

+
+

This returns void, so it cannot be chained.

+
+

Avoid calling this method. matching(Spec) and configureEach(Action) are more appropriate in most cases.

+
+

Use: OK, with issues.

+
+

This is OK to use because it does not require tasks to be created immediately.

+
+

Use: OK

+
+

Avoid calling this directly as it’s a Groovy convenience method. The alternative returns a TaskProvider instead of a Task.

+
+

Instead of: iterator() or implicit iteration over the Task collection

+
+

Avoid doing this as it requires creating and configuring all tasks. See findAll(Closure) above.

+
+

Use: OK, with issues.

+
+

Instead of: remove(org.gradle.api.Task)

+
+

Avoid calling this. The behavior of remove with the new API may change in the future.

+
+

Use: OK, with issues.

+
+

Avoid calling this. The behavior of replace with the new API may change in the future.

+
+

Use: OK, with issues.

+
+

Avoid calling this. The behavior of replace with the new API may change in the future.

+
+

Use: OK, with issues.

+
+
+
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/getting-started.html b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/getting-started.html new file mode 100644 index 0000000..6ead559 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/getting-started.html @@ -0,0 +1,2928 @@ + + + + + + + +Installing Gradle + + + + + + + + + +
+ + + +
+ + +
+
+
+
+

You can install the Gradle build tool on Linux, macOS, or Windows. +This document covers installing using a package manager like SDKMAN!, Homebrew, or Scoop, as well as manual installation.

+
+
+

Use of the Gradle Wrapper is the recommended way to upgrade Gradle.

+
+
+

You can find all releases and their checksums on the releases page.

+
+
+
+
+

Prerequisites

+
+
+

Gradle runs on all major operating systems and requires only a Java Development Kit version 8 or higher to run. To check, run java -version. You should see something like this:

+
+
+
+
❯ java -version
+java version "1.8.0_151"
+Java(TM) SE Runtime Environment (build 1.8.0_151-b12)
+Java HotSpot(TM) 64-Bit Server VM (build 25.151-b12, mixed mode)
+
+
+
+

Gradle ships with its own Groovy library, therefore Groovy does not need to be installed. Any existing Groovy installation is ignored by Gradle.

+
+
+

Gradle uses whatever JDK it finds in your path. Alternatively, you can set the JAVA_HOME environment variable to point to the installation directory of the desired JDK.

+
+
+
+
+

Installing with a package manager

+
+
+

SDKMAN! is a tool for managing parallel versions of multiple Software Development Kits on most Unix-based systems.

+
+
+
+
❯ sdk install gradle
+
+
+
+

Homebrew is "the missing package manager for macOS".

+
+
+
+
❯ brew install gradle
+
+
+
+

Scoop is a command-line installer for Windows inspired by Homebrew.

+
+
+
+
❯ scoop install gradle
+
+
+
+

Chocolatey is "the package manager for Windows".

+
+
+
+
❯ choco install gradle
+
+
+
+

MacPorts is a system for managing tools on macOS:

+
+
+
+
❯ sudo port install gradle
+
+
+ +
+
+
+

Installing manually

+
+
+

Step 1. Download the latest Gradle distribution

+
+

The distribution ZIP file comes in two flavors:

+
+
+
    +
  • +

    Binary-only (bin)

    +
  • +
  • +

    Complete (all) with docs and sources

    +
  • +
+
+
+

Need to work with an older version? See the releases page.

+
+
+
+

Step 2. Unpack the distribution

+
+

Linux & MacOS users

+
+

Unzip the distribution zip file in the directory of your choosing, e.g.:

+
+
+
+
❯ mkdir /opt/gradle
+❯ unzip -d /opt/gradle gradle-5.1.1-bin.zip
+❯ ls /opt/gradle/gradle-5.1.1
+LICENSE  NOTICE  bin  getting-started.html  init.d  lib  media
+
+
+
+
+

Microsoft Windows users

+
+

Create a new directory C:\Gradle with File Explorer.

+
+
+

Open a second File Explorer window and go to the directory where the Gradle distribution was downloaded. Double-click the ZIP archive to expose the content. Drag the content folder gradle-5.1.1 to your newly created C:\Gradle folder.

+
+
+

Alternatively you can unpack the Gradle distribution ZIP into C:\Gradle using an archiver tool of your choice.

+
+
+
+
+

Step 3. Configure your system environment

+
+

For running Gradle, firstly add the environment variable GRADLE_HOME. This should point to the unpacked files from the Gradle website. Next add GRADLE_HOME/bin to your PATH environment variable. Usually, this is sufficient to run Gradle.

+
+
+

Linux & MacOS users

+
+

Configure your PATH environment variable to include the bin directory of the unzipped distribution, e.g.:

+
+
+
+
❯ export PATH=$PATH:/opt/gradle/gradle-5.1.1/bin
+
+
+
+
+

Microsoft Windows users

+
+

In File Explorer right-click on the This PC (or Computer) icon, then click PropertiesAdvanced System SettingsEnvironmental Variables.

+
+
+

Under System Variables select Path, then click Edit. Add an entry for C:\Gradle\gradle-5.1.1\bin. Click OK to save.

+
+ +
+
+
+
+
+

Verifying installation

+
+
+

Open a console (or a Windows command prompt) and run gradle -v to run gradle and display the version, e.g.:

+
+
+
+
❯ gradle -v
+
+------------------------------------------------------------
+Gradle 5.1.1
+------------------------------------------------------------
+
+Build time:   2018-02-21 15:28:42 UTC
+Revision:     819e0059da49f469d3e9b2896dc4e72537c4847d
+
+Groovy:       2.4.15
+Ant:          Apache Ant(TM) version 1.9.9 compiled on February 2 2017
+JVM:          1.8.0_151 (Oracle Corporation 25.151-b12)
+OS:           Mac OS X 10.13.3 x86_64
+
+
+
+

If you run into any trouble, see the section on troubleshooting installation.

+
+
+

You can verify the integrity of the Gradle distribution by downloading the SHA-256 file (available from the releases page) and following these verification instructions.

+
+
+
+
+

Next steps

+
+
+

Now that you have Gradle installed, use these resources for getting started:

+
+
+ +
+
+

Getting help

+
+

You might check the user guide at GRADLE_HOME/docs/userguide/userguide.html. It is also available on the Gradle web site. Typing gradle help prints the command line help. Typing gradle tasks shows all the tasks of a Gradle build.

+
+
+
+
+
+
+ + +
+ + + + + + + \ No newline at end of file diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/lib/plugins/gradle-resources-s3-5.1.1.jar b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/lib/plugins/gradle-resources-s3-5.1.1.jar new file mode 100644 index 0000000..04721b7 Binary files /dev/null and b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/lib/plugins/gradle-resources-s3-5.1.1.jar differ diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/lib/plugins/maven-model-builder-3.0.4.jar b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/lib/plugins/maven-model-builder-3.0.4.jar new file mode 100644 index 0000000..72018dd Binary files /dev/null and b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/lib/plugins/maven-model-builder-3.0.4.jar differ diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/antlr/groovy/build.gradle b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/antlr/groovy/build.gradle new file mode 100644 index 0000000..00cc9c1 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/antlr/groovy/build.gradle @@ -0,0 +1,26 @@ +// tag::use-plugin[] +plugins { + id 'antlr' +} +// end::use-plugin[] + +// tag::declare-dependency[] +repositories { + mavenCentral() +} + +dependencies { + antlr "org.antlr:antlr:3.5.2" // use ANTLR version 3 + // antlr "org.antlr:antlr4:4.5" // use ANTLR version 4 +// end::declare-dependency[] + testImplementation 'junit:junit:4.12' +// tag::declare-dependency[] +} +// end::declare-dependency[] + +// tag::generate-grammar-settings[] +generateGrammarSource { + maxHeapSize = "64m" + arguments += ["-visitor", "-long-messages"] +} +// end::generate-grammar-settings[] diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/application/kotlin/build.gradle.kts b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/application/kotlin/build.gradle.kts new file mode 100644 index 0000000..965b395 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/application/kotlin/build.gradle.kts @@ -0,0 +1,54 @@ +// tag::use-plugin[] +plugins { + application +} +// end::use-plugin[] + +version = "1.0.2" + +// tag::mainClassName-conf[] +application { + mainClassName = "org.gradle.sample.Main" +} +// end::mainClassName-conf[] + +// tag::application-defaultjvmargs[] +application { + applicationDefaultJvmArgs = listOf("-Dgreeting.language=en") +} +// end::application-defaultjvmargs[] + +// tag::executableDir-conf[] +application { + executableDir = "custom_bin_dir" +} +// end::executableDir-conf[] + +// tag::distribution-spec[] +val createDocs by tasks.registering { + val docs = file("$buildDir/docs") + outputs.dir(docs) + doLast { + docs.mkdirs() + File(docs, "readme.txt").writeText("Read me!") + } +} + +distributions { + main { + contents { + from(createDocs) { + into("docs") + } + } + } +} +// end::distribution-spec[] + +repositories { + mavenCentral() +} + +dependencies { + implementation("commons-collections:commons-collections:3.2.2") +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/buildCache/build-src/groovy/build.gradle b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/buildCache/build-src/groovy/build.gradle new file mode 100644 index 0000000..1f84c19 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/buildCache/build-src/groovy/build.gradle @@ -0,0 +1,19 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +plugins { + id 'java' +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/buildDashboard/groovy/src/main/java/org/gradle/sample/Person.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/buildDashboard/groovy/src/main/java/org/gradle/sample/Person.java new file mode 100644 index 0000000..438b0d0 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/buildDashboard/groovy/src/main/java/org/gradle/sample/Person.java @@ -0,0 +1,15 @@ +package org.gradle.sample; + +import java.lang.String; + +class Person { + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/buildDashboard/kotlin/src/main/java/org/gradle/sample/Person.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/buildDashboard/kotlin/src/main/java/org/gradle/sample/Person.java new file mode 100644 index 0000000..438b0d0 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/buildDashboard/kotlin/src/main/java/org/gradle/sample/Person.java @@ -0,0 +1,15 @@ +package org.gradle.sample; + +import java.lang.String; + +class Person { + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} \ No newline at end of file diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/codeQuality/groovy/settings.gradle b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/codeQuality/groovy/settings.gradle new file mode 100644 index 0000000..00f400f --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/codeQuality/groovy/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'code-quality' diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/compositeBuilds/declared-substitution/groovy/my-app/settings-without-declared-substitution.gradle b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/compositeBuilds/declared-substitution/groovy/my-app/settings-without-declared-substitution.gradle new file mode 100644 index 0000000..fa6244b --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/compositeBuilds/declared-substitution/groovy/my-app/settings-without-declared-substitution.gradle @@ -0,0 +1,19 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +rootProject.name = 'app' + +includeBuild('../anonymous-library') diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/compositeBuilds/hierarchical-multirepo/groovy/modules/number-utils/src/main/java/org/sample/numberutils/Numbers.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/compositeBuilds/hierarchical-multirepo/groovy/modules/number-utils/src/main/java/org/sample/numberutils/Numbers.java new file mode 100644 index 0000000..d36210c --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/compositeBuilds/hierarchical-multirepo/groovy/modules/number-utils/src/main/java/org/sample/numberutils/Numbers.java @@ -0,0 +1,5 @@ +package org.sample.numberutils; + +public class Numbers { + public static int add(int left, int right) { return left + right; } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/compositeBuilds/hierarchical-multirepo/kotlin/modules/number-utils/build.gradle.kts b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/compositeBuilds/hierarchical-multirepo/kotlin/modules/number-utils/build.gradle.kts new file mode 100644 index 0000000..7fe4d90 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/compositeBuilds/hierarchical-multirepo/kotlin/modules/number-utils/build.gradle.kts @@ -0,0 +1,20 @@ +plugins { + java + idea +} + +group = "org.sample" +version = "1.0" + +repositories { + ivy { + name = "localrepo" + url = uri(file("../../../local-repo")) + } +} + +tasks.named("uploadArchives") { + repositories { + add(project.repositories["localrepo"]) + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/compositeBuilds/plugin-dev/groovy/greeting-plugin/src/main/java/org/sample/GreetingTask.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/compositeBuilds/plugin-dev/groovy/greeting-plugin/src/main/java/org/sample/GreetingTask.java new file mode 100644 index 0000000..02d9312 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/compositeBuilds/plugin-dev/groovy/greeting-plugin/src/main/java/org/sample/GreetingTask.java @@ -0,0 +1,23 @@ +package org.sample; + +import org.gradle.api.DefaultTask; +import org.gradle.api.tasks.Input; +import org.gradle.api.tasks.TaskAction; + +public class GreetingTask extends DefaultTask { + private String who = "mate"; + + @Input + public String getWho() { + return who; + } + + public void setWho(String who) { + this.who = who; + } + + @TaskAction + public void greet() { + System.out.println("Hi " + who + "!!!"); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/customModel/internalViews/settings.gradle b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/customModel/internalViews/settings.gradle new file mode 100644 index 0000000..7d12cb1 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/customModel/internalViews/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'internal-view' diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/java/crossCompilation/groovy/src/main/resources/org/gradle/resource.xml b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/java/crossCompilation/groovy/src/main/resources/org/gradle/resource.xml new file mode 100644 index 0000000..b5db07b --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/java/crossCompilation/groovy/src/main/resources/org/gradle/resource.xml @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/java/incrementalAnnotationProcessing/user/build.gradle b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/java/incrementalAnnotationProcessing/user/build.gradle new file mode 100644 index 0000000..06a53b6 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/java/incrementalAnnotationProcessing/user/build.gradle @@ -0,0 +1,12 @@ +plugins { + id "java" +} + +dependencies { + compileOnly project(":library") + annotationProcessor project(":processor") +} + +compileJava { + options.incremental = true +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/java/incrementalAnnotationProcessing/user/src/main/java/Service2.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/java/incrementalAnnotationProcessing/user/src/main/java/Service2.java new file mode 100644 index 0000000..0da3268 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/java/incrementalAnnotationProcessing/user/src/main/java/Service2.java @@ -0,0 +1,4 @@ +@Service +public class Service2 { + +} \ No newline at end of file diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/java/multiproject/groovy/buildSrc/src/test/java/org/gradle/buildsrc/BuildSrcClassTest.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/java/multiproject/groovy/buildSrc/src/test/java/org/gradle/buildsrc/BuildSrcClassTest.java new file mode 100644 index 0000000..98380e5 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/java/multiproject/groovy/buildSrc/src/test/java/org/gradle/buildsrc/BuildSrcClassTest.java @@ -0,0 +1,8 @@ +package org.gradle.buildsrc; + +public class BuildSrcClassTest { + @org.junit.Test + public void canConstructBuildSrcClass() { + new BuildSrcClass(); + } +} \ No newline at end of file diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/java/multiproject/kotlin/shared/src/test/java/org/gradle/shared/PersonTest.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/java/multiproject/kotlin/shared/src/test/java/org/gradle/shared/PersonTest.java new file mode 100644 index 0000000..bec0dc1 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/java/multiproject/kotlin/shared/src/test/java/org/gradle/shared/PersonTest.java @@ -0,0 +1,25 @@ +package org.gradle.shared; + +import junit.framework.TestCase; + +import java.io.IOException; +import java.util.Properties; + +public class PersonTest extends TestCase { + public void testTest() { + Person person = new Person("testname1"); + assertEquals("testname1", person.getName()); + person.setName("testname2"); + assertEquals("testname2", person.getName()); + } + + public void testMainProperty() throws IOException { + assertEquals("mainValue", new Person("test").readProperty()); + } + + public void testTestProperty() throws IOException { + Properties properties = new Properties(); + properties.load(getClass().getClassLoader().getResourceAsStream("org/gradle/shared/test.properties")); + assertEquals("testValue", properties.getProperty("test")); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/jvmComponents/scala/build.gradle b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/jvmComponents/scala/build.gradle new file mode 100644 index 0000000..317bb3c --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/jvmComponents/scala/build.gradle @@ -0,0 +1,29 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +plugins { + id 'jvm-component' + id 'scala-lang' +} + +repositories{ + jcenter() +} + +model { + components { + main(JvmLibrarySpec) + } +} \ No newline at end of file diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/kotlinDsl/androidSingleBuild/build.gradle.kts b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/kotlinDsl/androidSingleBuild/build.gradle.kts new file mode 100644 index 0000000..58179a6 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/kotlinDsl/androidSingleBuild/build.gradle.kts @@ -0,0 +1,40 @@ +// tag::android[] +plugins { + id("com.android.application") version "3.2.0" +// end::android[] + kotlin("android") version "1.2.71" + kotlin("android.extensions") version "1.2.71" +// tag::android[] +} + +android { + // ... +// end::android[] + compileSdkVersion(27) + defaultConfig { + applicationId = "org.gradle.kotlin.dsl.samples.androidstudio" + minSdkVersion(15) + targetSdkVersion(27) + versionCode = 1 + versionName = "1.0" + testInstrumentationRunner = "android.support.test.runner.AndroidJUnitRunner" + } + buildTypes { + named("release") { + isMinifyEnabled = false + proguardFiles(getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro") + } + } +// tag::android[] +} +// end::android[] + +dependencies { + implementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar")))) + implementation(kotlin("stdlib-jdk7", "1.2.71")) + implementation("com.android.support:appcompat-v7:27.1.1") + implementation("com.android.support.constraint:constraint-layout:1.1.0") + testImplementation("junit:junit:4.12") + androidTestImplementation("com.android.support.test:runner:1.0.2") + androidTestImplementation("com.android.support.test.espresso:espresso-core:3.0.2") +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/kotlinDsl/androidSingleBuild/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/kotlinDsl/androidSingleBuild/src/main/res/mipmap-anydpi-v26/ic_launcher.xml new file mode 100644 index 0000000..eca70cf --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/kotlinDsl/androidSingleBuild/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/maven-publish/conditional-publishing/kotlin/src/main/java/Sample.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/maven-publish/conditional-publishing/kotlin/src/main/java/Sample.java new file mode 100644 index 0000000..c29d257 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/maven-publish/conditional-publishing/kotlin/src/main/java/Sample.java @@ -0,0 +1,2 @@ +class Sample { +} \ No newline at end of file diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/cpp-exe/settings.gradle b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/cpp-exe/settings.gradle new file mode 100644 index 0000000..7bd15c8 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/cpp-exe/settings.gradle @@ -0,0 +1 @@ +rootProject.name = "sampleExe" \ No newline at end of file diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/cunit/libs/cunit/2.1-2/include/CUnit/MyMem.h b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/cunit/libs/cunit/2.1-2/include/CUnit/MyMem.h new file mode 100644 index 0000000..88a7e62 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/cunit/libs/cunit/2.1-2/include/CUnit/MyMem.h @@ -0,0 +1,104 @@ +/* + * CUnit - A Unit testing framework library for C. + * Copyright (C) 2001 Anil Kumar + * Copyright (C) 2004-2006 Anil Kumar, Jerry St.Clair + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* + * Contains Memory Related Defines to use internal routines to detect Memory Leak + * in Debug Versions + * + * 18/Jun/2002 Memory Debug Functions. (AK) + * + * 17-Jul-2004 New interface for global function names. (JDS) + * + * 05-Sep-2004 Added internal test interface. (JDS) + */ + +/** @file + * Memory management functions (user interface). + * Two versions of memory allocation/deallocation are available. + * If compiled with MEMTRACE defined, CUnit keeps track of all + * system allocations & deallocations. The memory record can + * then be reported using CU_CREATE_MEMORY_REPORT. Otherwise, + * standard system memory allocation is used without tracing. + */ +/** @addtogroup Framework + * @{ + */ + +#ifndef CUNIT_MYMEM_H_SEEN +#define CUNIT_MYMEM_H_SEEN + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef MEMTRACE + void* CU_calloc(size_t nmemb, size_t size, unsigned int uiLine, const char* szFileName); + void* CU_malloc(size_t size, unsigned int uiLine, const char* szFileName); + void CU_free(void *ptr, unsigned int uiLine, const char* szFileName); + void* CU_realloc(void *ptr, size_t size, unsigned int uiLine, const char* szFileName); + CU_EXPORT void CU_dump_memory_usage(const char*); + + /** c-allocate with memory tracking. */ + #define CU_CALLOC(x, y) CU_calloc((x), (y), __LINE__, __FILE__) + /** m-allocate with memory tracking. */ + #define CU_MALLOC(x) CU_malloc((x), __LINE__, __FILE__) + /** Free with memory tracking. */ + #define CU_FREE(x) CU_free((x), __LINE__, __FILE__) + /** Reallocate with memory tracking. */ + #define CU_REALLOC(x, y) CU_realloc((x), (y), __LINE__, __FILE__) + /** Generate report on tracked memory. */ + #define CU_CREATE_MEMORY_REPORT(x) CU_dump_memory_usage((x)) + /** Generate report on tracked memory (old macro). */ + #define CU_DUMP_MEMORY_USAGE(x) CU_dump_memory_usage((x)) +#else /* MEMTRACE */ + /** Standard calloc() if MEMTRACE not defined. */ + #define CU_CALLOC(x, y) calloc((x), (y)) + /** Standard malloc() if MEMTRACE not defined. */ + #define CU_MALLOC(x) malloc((x)) + /** Standard free() if MEMTRACE not defined. */ + #define CU_FREE(x) free((x)) + /** Standard realloc() if MEMTRACE not defined. */ + #define CU_REALLOC(x, y) realloc((x), (y)) + /** No-op if MEMTRACE not defined. */ + #define CU_CREATE_MEMORY_REPORT(x) + /** No-op if MEMTRACE not defined. */ + #define CU_DUMP_MEMORY_USAGE(x) +#endif /* MEMTRACE */ + +#ifdef CUNIT_BUILD_TESTS +/** Disable memory allocation for testing purposes. */ +void test_cunit_deactivate_malloc(void); +/** Enable memory allocation for testing purposes. */ +void test_cunit_activate_malloc(void); +/** Retrieve number of memory events for a given pointer */ +unsigned int test_cunit_get_n_memevents(void* pLocation); +/** Retrieve number of allocations for a given pointer */ +unsigned int test_cunit_get_n_allocations(void* pLocation); +/** Retrieve number of deallocations for a given pointer */ +unsigned int test_cunit_get_n_deallocations(void* pLocation); + +void test_cunit_MyMem(void); +#endif /* CUNIT_BUILD_TESTS */ + +#ifdef __cplusplus +} +#endif +#endif /* CUNIT_MYMEM_H_SEEN */ +/** @} */ diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/google-test/libs/googleTest/1.7.0/include/gtest/gtest_prod.h b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/google-test/libs/googleTest/1.7.0/include/gtest/gtest_prod.h new file mode 100644 index 0000000..da80ddc --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/google-test/libs/googleTest/1.7.0/include/gtest/gtest_prod.h @@ -0,0 +1,58 @@ +// Copyright 2006, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: wan@google.com (Zhanyong Wan) +// +// Google C++ Testing Framework definitions useful in production code. + +#ifndef GTEST_INCLUDE_GTEST_GTEST_PROD_H_ +#define GTEST_INCLUDE_GTEST_GTEST_PROD_H_ + +// When you need to test the private or protected members of a class, +// use the FRIEND_TEST macro to declare your tests as friends of the +// class. For example: +// +// class MyClass { +// private: +// void MyMethod(); +// FRIEND_TEST(MyClassTest, MyMethod); +// }; +// +// class MyClassTest : public testing::Test { +// // ... +// }; +// +// TEST_F(MyClassTest, MyMethod) { +// // Can call MyClass::MyMethod() here. +// } + +#define FRIEND_TEST(test_case_name, test_name)\ +friend class test_case_name##_##test_name##_Test + +#endif // GTEST_INCLUDE_GTEST_GTEST_PROD_H_ diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/google-test/libs/googleTest/1.7.0/include/gtest/internal/gtest-filepath.h b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/google-test/libs/googleTest/1.7.0/include/gtest/internal/gtest-filepath.h new file mode 100644 index 0000000..7a13b4b --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/google-test/libs/googleTest/1.7.0/include/gtest/internal/gtest-filepath.h @@ -0,0 +1,206 @@ +// Copyright 2008, Google Inc. +// All rights reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: keith.ray@gmail.com (Keith Ray) +// +// Google Test filepath utilities +// +// This header file declares classes and functions used internally by +// Google Test. They are subject to change without notice. +// +// This file is #included in . +// Do not include this header file separately! + +#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ +#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ + +#include "gtest/internal/gtest-string.h" + +namespace testing { +namespace internal { + +// FilePath - a class for file and directory pathname manipulation which +// handles platform-specific conventions (like the pathname separator). +// Used for helper functions for naming files in a directory for xml output. +// Except for Set methods, all methods are const or static, which provides an +// "immutable value object" -- useful for peace of mind. +// A FilePath with a value ending in a path separator ("like/this/") represents +// a directory, otherwise it is assumed to represent a file. In either case, +// it may or may not represent an actual file or directory in the file system. +// Names are NOT checked for syntax correctness -- no checking for illegal +// characters, malformed paths, etc. + +class GTEST_API_ FilePath { + public: + FilePath() : pathname_("") { } + FilePath(const FilePath& rhs) : pathname_(rhs.pathname_) { } + + explicit FilePath(const std::string& pathname) : pathname_(pathname) { + Normalize(); + } + + FilePath& operator=(const FilePath& rhs) { + Set(rhs); + return *this; + } + + void Set(const FilePath& rhs) { + pathname_ = rhs.pathname_; + } + + const std::string& string() const { return pathname_; } + const char* c_str() const { return pathname_.c_str(); } + + // Returns the current working directory, or "" if unsuccessful. + static FilePath GetCurrentDir(); + + // Given directory = "dir", base_name = "test", number = 0, + // extension = "xml", returns "dir/test.xml". If number is greater + // than zero (e.g., 12), returns "dir/test_12.xml". + // On Windows platform, uses \ as the separator rather than /. + static FilePath MakeFileName(const FilePath& directory, + const FilePath& base_name, + int number, + const char* extension); + + // Given directory = "dir", relative_path = "test.xml", + // returns "dir/test.xml". + // On Windows, uses \ as the separator rather than /. + static FilePath ConcatPaths(const FilePath& directory, + const FilePath& relative_path); + + // Returns a pathname for a file that does not currently exist. The pathname + // will be directory/base_name.extension or + // directory/base_name_.extension if directory/base_name.extension + // already exists. The number will be incremented until a pathname is found + // that does not already exist. + // Examples: 'dir/foo_test.xml' or 'dir/foo_test_1.xml'. + // There could be a race condition if two or more processes are calling this + // function at the same time -- they could both pick the same filename. + static FilePath GenerateUniqueFileName(const FilePath& directory, + const FilePath& base_name, + const char* extension); + + // Returns true iff the path is "". + bool IsEmpty() const { return pathname_.empty(); } + + // If input name has a trailing separator character, removes it and returns + // the name, otherwise return the name string unmodified. + // On Windows platform, uses \ as the separator, other platforms use /. + FilePath RemoveTrailingPathSeparator() const; + + // Returns a copy of the FilePath with the directory part removed. + // Example: FilePath("path/to/file").RemoveDirectoryName() returns + // FilePath("file"). If there is no directory part ("just_a_file"), it returns + // the FilePath unmodified. If there is no file part ("just_a_dir/") it + // returns an empty FilePath (""). + // On Windows platform, '\' is the path separator, otherwise it is '/'. + FilePath RemoveDirectoryName() const; + + // RemoveFileName returns the directory path with the filename removed. + // Example: FilePath("path/to/file").RemoveFileName() returns "path/to/". + // If the FilePath is "a_file" or "/a_file", RemoveFileName returns + // FilePath("./") or, on Windows, FilePath(".\\"). If the filepath does + // not have a file, like "just/a/dir/", it returns the FilePath unmodified. + // On Windows platform, '\' is the path separator, otherwise it is '/'. + FilePath RemoveFileName() const; + + // Returns a copy of the FilePath with the case-insensitive extension removed. + // Example: FilePath("dir/file.exe").RemoveExtension("EXE") returns + // FilePath("dir/file"). If a case-insensitive extension is not + // found, returns a copy of the original FilePath. + FilePath RemoveExtension(const char* extension) const; + + // Creates directories so that path exists. Returns true if successful or if + // the directories already exist; returns false if unable to create + // directories for any reason. Will also return false if the FilePath does + // not represent a directory (that is, it doesn't end with a path separator). + bool CreateDirectoriesRecursively() const; + + // Create the directory so that path exists. Returns true if successful or + // if the directory already exists; returns false if unable to create the + // directory for any reason, including if the parent directory does not + // exist. Not named "CreateDirectory" because that's a macro on Windows. + bool CreateFolder() const; + + // Returns true if FilePath describes something in the file-system, + // either a file, directory, or whatever, and that something exists. + bool FileOrDirectoryExists() const; + + // Returns true if pathname describes a directory in the file-system + // that exists. + bool DirectoryExists() const; + + // Returns true if FilePath ends with a path separator, which indicates that + // it is intended to represent a directory. Returns false otherwise. + // This does NOT check that a directory (or file) actually exists. + bool IsDirectory() const; + + // Returns true if pathname describes a root directory. (Windows has one + // root directory per disk drive.) + bool IsRootDirectory() const; + + // Returns true if pathname describes an absolute path. + bool IsAbsolutePath() const; + + private: + // Replaces multiple consecutive separators with a single separator. + // For example, "bar///foo" becomes "bar/foo". Does not eliminate other + // redundancies that might be in a pathname involving "." or "..". + // + // A pathname with multiple consecutive separators may occur either through + // user error or as a result of some scripts or APIs that generate a pathname + // with a trailing separator. On other platforms the same API or script + // may NOT generate a pathname with a trailing "/". Then elsewhere that + // pathname may have another "/" and pathname components added to it, + // without checking for the separator already being there. + // The script language and operating system may allow paths like "foo//bar" + // but some of the functions in FilePath will not handle that correctly. In + // particular, RemoveTrailingPathSeparator() only removes one separator, and + // it is called in CreateDirectoriesRecursively() assuming that it will change + // a pathname from directory syntax (trailing separator) to filename syntax. + // + // On Windows this method also replaces the alternate path separator '/' with + // the primary path separator '\\', so that for example "bar\\/\\foo" becomes + // "bar\\foo". + + void Normalize(); + + // Returns a pointer to the last occurence of a valid path separator in + // the FilePath. On Windows, for example, both '/' and '\' are valid path + // separators. Returns NULL if no path separator was found. + const char* FindLastPathSeparator() const; + + std::string pathname_; +}; // class FilePath + +} // namespace internal +} // namespace testing + +#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_FILEPATH_H_ diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/google-test/libs/googleTest/1.7.0/include/gtest/internal/gtest-param-util-generated.h b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/google-test/libs/googleTest/1.7.0/include/gtest/internal/gtest-param-util-generated.h new file mode 100644 index 0000000..e805485 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/google-test/libs/googleTest/1.7.0/include/gtest/internal/gtest-param-util-generated.h @@ -0,0 +1,5143 @@ +// This file was GENERATED by command: +// pump.py gtest-param-util-generated.h.pump +// DO NOT EDIT BY HAND!!! + +// Copyright 2008 Google Inc. +// All Rights Reserved. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// * Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// * Redistributions in binary form must reproduce the above +// copyright notice, this list of conditions and the following disclaimer +// in the documentation and/or other materials provided with the +// distribution. +// * Neither the name of Google Inc. nor the names of its +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Author: vladl@google.com (Vlad Losev) + +// Type and function utilities for implementing parameterized tests. +// This file is generated by a SCRIPT. DO NOT EDIT BY HAND! +// +// Currently Google Test supports at most 50 arguments in Values, +// and at most 10 arguments in Combine. Please contact +// googletestframework@googlegroups.com if you need more. +// Please note that the number of arguments to Combine is limited +// by the maximum arity of the implementation of tr1::tuple which is +// currently set at 10. + +#ifndef GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ +#define GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ + +// scripts/fuse_gtest.py depends on gtest's own header being #included +// *unconditionally*. Therefore these #includes cannot be moved +// inside #if GTEST_HAS_PARAM_TEST. +#include "gtest/internal/gtest-param-util.h" +#include "gtest/internal/gtest-port.h" + +#if GTEST_HAS_PARAM_TEST + +namespace testing { + +// Forward declarations of ValuesIn(), which is implemented in +// include/gtest/gtest-param-test.h. +template +internal::ParamGenerator< + typename ::testing::internal::IteratorTraits::value_type> +ValuesIn(ForwardIterator begin, ForwardIterator end); + +template +internal::ParamGenerator ValuesIn(const T (&array)[N]); + +template +internal::ParamGenerator ValuesIn( + const Container& container); + +namespace internal { + +// Used in the Values() function to provide polymorphic capabilities. +template +class ValueArray1 { + public: + explicit ValueArray1(T1 v1) : v1_(v1) {} + + template + operator ParamGenerator() const { return ValuesIn(&v1_, &v1_ + 1); } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray1& other); + + const T1 v1_; +}; + +template +class ValueArray2 { + public: + ValueArray2(T1 v1, T2 v2) : v1_(v1), v2_(v2) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray2& other); + + const T1 v1_; + const T2 v2_; +}; + +template +class ValueArray3 { + public: + ValueArray3(T1 v1, T2 v2, T3 v3) : v1_(v1), v2_(v2), v3_(v3) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray3& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; +}; + +template +class ValueArray4 { + public: + ValueArray4(T1 v1, T2 v2, T3 v3, T4 v4) : v1_(v1), v2_(v2), v3_(v3), + v4_(v4) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray4& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; +}; + +template +class ValueArray5 { + public: + ValueArray5(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5) : v1_(v1), v2_(v2), v3_(v3), + v4_(v4), v5_(v5) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray5& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; +}; + +template +class ValueArray6 { + public: + ValueArray6(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6) : v1_(v1), v2_(v2), + v3_(v3), v4_(v4), v5_(v5), v6_(v6) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray6& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; +}; + +template +class ValueArray7 { + public: + ValueArray7(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7) : v1_(v1), + v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray7& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; +}; + +template +class ValueArray8 { + public: + ValueArray8(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, + T8 v8) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray8& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; +}; + +template +class ValueArray9 { + public: + ValueArray9(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, + T9 v9) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray9& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; +}; + +template +class ValueArray10 { + public: + ValueArray10(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9), v10_(v10) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray10& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; +}; + +template +class ValueArray11 { + public: + ValueArray11(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), + v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray11& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; +}; + +template +class ValueArray12 { + public: + ValueArray12(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), + v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray12& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; +}; + +template +class ValueArray13 { + public: + ValueArray13(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), + v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), + v12_(v12), v13_(v13) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray13& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; +}; + +template +class ValueArray14 { + public: + ValueArray14(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14) : v1_(v1), v2_(v2), v3_(v3), + v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), + v11_(v11), v12_(v12), v13_(v13), v14_(v14) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray14& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; +}; + +template +class ValueArray15 { + public: + ValueArray15(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15) : v1_(v1), v2_(v2), + v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), + v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray15& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; +}; + +template +class ValueArray16 { + public: + ValueArray16(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16) : v1_(v1), + v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), + v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), + v16_(v16) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray16& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; +}; + +template +class ValueArray17 { + public: + ValueArray17(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, + T17 v17) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), + v15_(v15), v16_(v16), v17_(v17) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray17& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; +}; + +template +class ValueArray18 { + public: + ValueArray18(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), + v15_(v15), v16_(v16), v17_(v17), v18_(v18) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray18& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; +}; + +template +class ValueArray19 { + public: + ValueArray19(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), + v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), + v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray19& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; +}; + +template +class ValueArray20 { + public: + ValueArray20(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), + v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), + v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), + v19_(v19), v20_(v20) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray20& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; +}; + +template +class ValueArray21 { + public: + ValueArray21(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), + v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), + v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), + v18_(v18), v19_(v19), v20_(v20), v21_(v21) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray21& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; +}; + +template +class ValueArray22 { + public: + ValueArray22(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22) : v1_(v1), v2_(v2), v3_(v3), + v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), + v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), + v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray22& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; +}; + +template +class ValueArray23 { + public: + ValueArray23(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23) : v1_(v1), v2_(v2), + v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), + v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), + v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), + v23_(v23) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray23& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; +}; + +template +class ValueArray24 { + public: + ValueArray24(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24) : v1_(v1), + v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), + v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), + v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), + v22_(v22), v23_(v23), v24_(v24) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray24& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; +}; + +template +class ValueArray25 { + public: + ValueArray25(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, + T25 v25) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), + v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), + v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray25& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; +}; + +template +class ValueArray26 { + public: + ValueArray26(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), + v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), + v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray26& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; +}; + +template +class ValueArray27 { + public: + ValueArray27(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), + v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), + v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), + v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), + v26_(v26), v27_(v27) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray27& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; +}; + +template +class ValueArray28 { + public: + ValueArray28(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), + v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), + v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), + v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), + v25_(v25), v26_(v26), v27_(v27), v28_(v28) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray28& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; +}; + +template +class ValueArray29 { + public: + ValueArray29(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), + v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), + v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), + v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), + v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_), static_cast(v29_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray29& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; +}; + +template +class ValueArray30 { + public: + ValueArray30(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30) : v1_(v1), v2_(v2), v3_(v3), + v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), + v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), + v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), + v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), + v29_(v29), v30_(v30) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_), static_cast(v29_), + static_cast(v30_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray30& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; +}; + +template +class ValueArray31 { + public: + ValueArray31(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31) : v1_(v1), v2_(v2), + v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), + v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), + v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), + v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), + v29_(v29), v30_(v30), v31_(v31) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_), static_cast(v29_), + static_cast(v30_), static_cast(v31_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray31& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; +}; + +template +class ValueArray32 { + public: + ValueArray32(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32) : v1_(v1), + v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), + v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), + v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), + v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), + v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_), static_cast(v29_), + static_cast(v30_), static_cast(v31_), static_cast(v32_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray32& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; +}; + +template +class ValueArray33 { + public: + ValueArray33(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, + T33 v33) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), + v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), + v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), + v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), + v33_(v33) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_), static_cast(v29_), + static_cast(v30_), static_cast(v31_), static_cast(v32_), + static_cast(v33_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray33& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; +}; + +template +class ValueArray34 { + public: + ValueArray34(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), + v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), + v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), + v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), + v33_(v33), v34_(v34) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_), static_cast(v29_), + static_cast(v30_), static_cast(v31_), static_cast(v32_), + static_cast(v33_), static_cast(v34_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray34& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; +}; + +template +class ValueArray35 { + public: + ValueArray35(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), + v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), + v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), + v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), + v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), + v32_(v32), v33_(v33), v34_(v34), v35_(v35) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_), static_cast(v29_), + static_cast(v30_), static_cast(v31_), static_cast(v32_), + static_cast(v33_), static_cast(v34_), static_cast(v35_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray35& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; +}; + +template +class ValueArray36 { + public: + ValueArray36(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), + v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), + v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), + v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), + v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), + v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_), static_cast(v29_), + static_cast(v30_), static_cast(v31_), static_cast(v32_), + static_cast(v33_), static_cast(v34_), static_cast(v35_), + static_cast(v36_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray36& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; +}; + +template +class ValueArray37 { + public: + ValueArray37(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), + v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), + v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), + v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), + v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), + v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), + v36_(v36), v37_(v37) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_), static_cast(v29_), + static_cast(v30_), static_cast(v31_), static_cast(v32_), + static_cast(v33_), static_cast(v34_), static_cast(v35_), + static_cast(v36_), static_cast(v37_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray37& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; +}; + +template +class ValueArray38 { + public: + ValueArray38(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38) : v1_(v1), v2_(v2), v3_(v3), + v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), + v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), + v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), + v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), + v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), + v35_(v35), v36_(v36), v37_(v37), v38_(v38) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_), static_cast(v29_), + static_cast(v30_), static_cast(v31_), static_cast(v32_), + static_cast(v33_), static_cast(v34_), static_cast(v35_), + static_cast(v36_), static_cast(v37_), static_cast(v38_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray38& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; +}; + +template +class ValueArray39 { + public: + ValueArray39(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39) : v1_(v1), v2_(v2), + v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), + v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), + v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), + v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), + v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), + v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_), static_cast(v29_), + static_cast(v30_), static_cast(v31_), static_cast(v32_), + static_cast(v33_), static_cast(v34_), static_cast(v35_), + static_cast(v36_), static_cast(v37_), static_cast(v38_), + static_cast(v39_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray39& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; +}; + +template +class ValueArray40 { + public: + ValueArray40(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40) : v1_(v1), + v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), + v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), + v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), + v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), + v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), + v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), + v40_(v40) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_), static_cast(v29_), + static_cast(v30_), static_cast(v31_), static_cast(v32_), + static_cast(v33_), static_cast(v34_), static_cast(v35_), + static_cast(v36_), static_cast(v37_), static_cast(v38_), + static_cast(v39_), static_cast(v40_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray40& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; + const T40 v40_; +}; + +template +class ValueArray41 { + public: + ValueArray41(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, + T41 v41) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), + v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), + v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), + v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), + v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), + v39_(v39), v40_(v40), v41_(v41) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_), static_cast(v29_), + static_cast(v30_), static_cast(v31_), static_cast(v32_), + static_cast(v33_), static_cast(v34_), static_cast(v35_), + static_cast(v36_), static_cast(v37_), static_cast(v38_), + static_cast(v39_), static_cast(v40_), static_cast(v41_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray41& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; + const T40 v40_; + const T41 v41_; +}; + +template +class ValueArray42 { + public: + ValueArray42(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, + T42 v42) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), + v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), + v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), + v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), + v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), + v39_(v39), v40_(v40), v41_(v41), v42_(v42) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_), static_cast(v29_), + static_cast(v30_), static_cast(v31_), static_cast(v32_), + static_cast(v33_), static_cast(v34_), static_cast(v35_), + static_cast(v36_), static_cast(v37_), static_cast(v38_), + static_cast(v39_), static_cast(v40_), static_cast(v41_), + static_cast(v42_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray42& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; + const T40 v40_; + const T41 v41_; + const T42 v42_; +}; + +template +class ValueArray43 { + public: + ValueArray43(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, + T42 v42, T43 v43) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), + v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), + v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), + v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), + v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), + v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), + v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_), static_cast(v29_), + static_cast(v30_), static_cast(v31_), static_cast(v32_), + static_cast(v33_), static_cast(v34_), static_cast(v35_), + static_cast(v36_), static_cast(v37_), static_cast(v38_), + static_cast(v39_), static_cast(v40_), static_cast(v41_), + static_cast(v42_), static_cast(v43_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray43& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; + const T40 v40_; + const T41 v41_; + const T42 v42_; + const T43 v43_; +}; + +template +class ValueArray44 { + public: + ValueArray44(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, + T42 v42, T43 v43, T44 v44) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), + v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), + v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), v18_(v18), + v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), v24_(v24), + v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), v30_(v30), + v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), v36_(v36), + v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), v42_(v42), + v43_(v43), v44_(v44) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_), static_cast(v29_), + static_cast(v30_), static_cast(v31_), static_cast(v32_), + static_cast(v33_), static_cast(v34_), static_cast(v35_), + static_cast(v36_), static_cast(v37_), static_cast(v38_), + static_cast(v39_), static_cast(v40_), static_cast(v41_), + static_cast(v42_), static_cast(v43_), static_cast(v44_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray44& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; + const T40 v40_; + const T41 v41_; + const T42 v42_; + const T43 v43_; + const T44 v44_; +}; + +template +class ValueArray45 { + public: + ValueArray45(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, + T42 v42, T43 v43, T44 v44, T45 v45) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), + v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), v11_(v11), + v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), v17_(v17), + v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), v23_(v23), + v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), v29_(v29), + v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), v35_(v35), + v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), v41_(v41), + v42_(v42), v43_(v43), v44_(v44), v45_(v45) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_), static_cast(v29_), + static_cast(v30_), static_cast(v31_), static_cast(v32_), + static_cast(v33_), static_cast(v34_), static_cast(v35_), + static_cast(v36_), static_cast(v37_), static_cast(v38_), + static_cast(v39_), static_cast(v40_), static_cast(v41_), + static_cast(v42_), static_cast(v43_), static_cast(v44_), + static_cast(v45_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray45& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; + const T40 v40_; + const T41 v41_; + const T42 v42_; + const T43 v43_; + const T44 v44_; + const T45 v45_; +}; + +template +class ValueArray46 { + public: + ValueArray46(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, + T42 v42, T43 v43, T44 v44, T45 v45, T46 v46) : v1_(v1), v2_(v2), v3_(v3), + v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), + v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), + v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), + v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), + v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), + v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), + v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_), static_cast(v29_), + static_cast(v30_), static_cast(v31_), static_cast(v32_), + static_cast(v33_), static_cast(v34_), static_cast(v35_), + static_cast(v36_), static_cast(v37_), static_cast(v38_), + static_cast(v39_), static_cast(v40_), static_cast(v41_), + static_cast(v42_), static_cast(v43_), static_cast(v44_), + static_cast(v45_), static_cast(v46_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray46& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; + const T40 v40_; + const T41 v41_; + const T42 v42_; + const T43 v43_; + const T44 v44_; + const T45 v45_; + const T46 v46_; +}; + +template +class ValueArray47 { + public: + ValueArray47(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, + T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47) : v1_(v1), v2_(v2), + v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), v10_(v10), + v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), v16_(v16), + v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), v22_(v22), + v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), v28_(v28), + v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), v34_(v34), + v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), v40_(v40), + v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), v46_(v46), + v47_(v47) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_), static_cast(v29_), + static_cast(v30_), static_cast(v31_), static_cast(v32_), + static_cast(v33_), static_cast(v34_), static_cast(v35_), + static_cast(v36_), static_cast(v37_), static_cast(v38_), + static_cast(v39_), static_cast(v40_), static_cast(v41_), + static_cast(v42_), static_cast(v43_), static_cast(v44_), + static_cast(v45_), static_cast(v46_), static_cast(v47_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray47& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; + const T40 v40_; + const T41 v41_; + const T42 v42_; + const T43 v43_; + const T44 v44_; + const T45 v45_; + const T46 v46_; + const T47 v47_; +}; + +template +class ValueArray48 { + public: + ValueArray48(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, + T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48) : v1_(v1), + v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), v8_(v8), v9_(v9), + v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), v15_(v15), + v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), v21_(v21), + v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), v27_(v27), + v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), v33_(v33), + v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), v39_(v39), + v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), v45_(v45), + v46_(v46), v47_(v47), v48_(v48) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_), static_cast(v29_), + static_cast(v30_), static_cast(v31_), static_cast(v32_), + static_cast(v33_), static_cast(v34_), static_cast(v35_), + static_cast(v36_), static_cast(v37_), static_cast(v38_), + static_cast(v39_), static_cast(v40_), static_cast(v41_), + static_cast(v42_), static_cast(v43_), static_cast(v44_), + static_cast(v45_), static_cast(v46_), static_cast(v47_), + static_cast(v48_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray48& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; + const T40 v40_; + const T41 v41_; + const T42 v42_; + const T43 v43_; + const T44 v44_; + const T45 v45_; + const T46 v46_; + const T47 v47_; + const T48 v48_; +}; + +template +class ValueArray49 { + public: + ValueArray49(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, + T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, + T49 v49) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), + v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), + v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), + v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), + v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), + v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), + v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_), static_cast(v29_), + static_cast(v30_), static_cast(v31_), static_cast(v32_), + static_cast(v33_), static_cast(v34_), static_cast(v35_), + static_cast(v36_), static_cast(v37_), static_cast(v38_), + static_cast(v39_), static_cast(v40_), static_cast(v41_), + static_cast(v42_), static_cast(v43_), static_cast(v44_), + static_cast(v45_), static_cast(v46_), static_cast(v47_), + static_cast(v48_), static_cast(v49_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray49& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; + const T40 v40_; + const T41 v41_; + const T42 v42_; + const T43 v43_; + const T44 v44_; + const T45 v45_; + const T46 v46_; + const T47 v47_; + const T48 v48_; + const T49 v49_; +}; + +template +class ValueArray50 { + public: + ValueArray50(T1 v1, T2 v2, T3 v3, T4 v4, T5 v5, T6 v6, T7 v7, T8 v8, T9 v9, + T10 v10, T11 v11, T12 v12, T13 v13, T14 v14, T15 v15, T16 v16, T17 v17, + T18 v18, T19 v19, T20 v20, T21 v21, T22 v22, T23 v23, T24 v24, T25 v25, + T26 v26, T27 v27, T28 v28, T29 v29, T30 v30, T31 v31, T32 v32, T33 v33, + T34 v34, T35 v35, T36 v36, T37 v37, T38 v38, T39 v39, T40 v40, T41 v41, + T42 v42, T43 v43, T44 v44, T45 v45, T46 v46, T47 v47, T48 v48, T49 v49, + T50 v50) : v1_(v1), v2_(v2), v3_(v3), v4_(v4), v5_(v5), v6_(v6), v7_(v7), + v8_(v8), v9_(v9), v10_(v10), v11_(v11), v12_(v12), v13_(v13), v14_(v14), + v15_(v15), v16_(v16), v17_(v17), v18_(v18), v19_(v19), v20_(v20), + v21_(v21), v22_(v22), v23_(v23), v24_(v24), v25_(v25), v26_(v26), + v27_(v27), v28_(v28), v29_(v29), v30_(v30), v31_(v31), v32_(v32), + v33_(v33), v34_(v34), v35_(v35), v36_(v36), v37_(v37), v38_(v38), + v39_(v39), v40_(v40), v41_(v41), v42_(v42), v43_(v43), v44_(v44), + v45_(v45), v46_(v46), v47_(v47), v48_(v48), v49_(v49), v50_(v50) {} + + template + operator ParamGenerator() const { + const T array[] = {static_cast(v1_), static_cast(v2_), + static_cast(v3_), static_cast(v4_), static_cast(v5_), + static_cast(v6_), static_cast(v7_), static_cast(v8_), + static_cast(v9_), static_cast(v10_), static_cast(v11_), + static_cast(v12_), static_cast(v13_), static_cast(v14_), + static_cast(v15_), static_cast(v16_), static_cast(v17_), + static_cast(v18_), static_cast(v19_), static_cast(v20_), + static_cast(v21_), static_cast(v22_), static_cast(v23_), + static_cast(v24_), static_cast(v25_), static_cast(v26_), + static_cast(v27_), static_cast(v28_), static_cast(v29_), + static_cast(v30_), static_cast(v31_), static_cast(v32_), + static_cast(v33_), static_cast(v34_), static_cast(v35_), + static_cast(v36_), static_cast(v37_), static_cast(v38_), + static_cast(v39_), static_cast(v40_), static_cast(v41_), + static_cast(v42_), static_cast(v43_), static_cast(v44_), + static_cast(v45_), static_cast(v46_), static_cast(v47_), + static_cast(v48_), static_cast(v49_), static_cast(v50_)}; + return ValuesIn(array); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const ValueArray50& other); + + const T1 v1_; + const T2 v2_; + const T3 v3_; + const T4 v4_; + const T5 v5_; + const T6 v6_; + const T7 v7_; + const T8 v8_; + const T9 v9_; + const T10 v10_; + const T11 v11_; + const T12 v12_; + const T13 v13_; + const T14 v14_; + const T15 v15_; + const T16 v16_; + const T17 v17_; + const T18 v18_; + const T19 v19_; + const T20 v20_; + const T21 v21_; + const T22 v22_; + const T23 v23_; + const T24 v24_; + const T25 v25_; + const T26 v26_; + const T27 v27_; + const T28 v28_; + const T29 v29_; + const T30 v30_; + const T31 v31_; + const T32 v32_; + const T33 v33_; + const T34 v34_; + const T35 v35_; + const T36 v36_; + const T37 v37_; + const T38 v38_; + const T39 v39_; + const T40 v40_; + const T41 v41_; + const T42 v42_; + const T43 v43_; + const T44 v44_; + const T45 v45_; + const T46 v46_; + const T47 v47_; + const T48 v48_; + const T49 v49_; + const T50 v50_; +}; + +# if GTEST_HAS_COMBINE +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. +// +// Generates values from the Cartesian product of values produced +// by the argument generators. +// +template +class CartesianProductGenerator2 + : public ParamGeneratorInterface< ::std::tr1::tuple > { + public: + typedef ::std::tr1::tuple ParamType; + + CartesianProductGenerator2(const ParamGenerator& g1, + const ParamGenerator& g2) + : g1_(g1), g2_(g2) {} + virtual ~CartesianProductGenerator2() {} + + virtual ParamIteratorInterface* Begin() const { + return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin()); + } + virtual ParamIteratorInterface* End() const { + return new Iterator(this, g1_, g1_.end(), g2_, g2_.end()); + } + + private: + class Iterator : public ParamIteratorInterface { + public: + Iterator(const ParamGeneratorInterface* base, + const ParamGenerator& g1, + const typename ParamGenerator::iterator& current1, + const ParamGenerator& g2, + const typename ParamGenerator::iterator& current2) + : base_(base), + begin1_(g1.begin()), end1_(g1.end()), current1_(current1), + begin2_(g2.begin()), end2_(g2.end()), current2_(current2) { + ComputeCurrentValue(); + } + virtual ~Iterator() {} + + virtual const ParamGeneratorInterface* BaseGenerator() const { + return base_; + } + // Advance should not be called on beyond-of-range iterators + // so no component iterators must be beyond end of range, either. + virtual void Advance() { + assert(!AtEnd()); + ++current2_; + if (current2_ == end2_) { + current2_ = begin2_; + ++current1_; + } + ComputeCurrentValue(); + } + virtual ParamIteratorInterface* Clone() const { + return new Iterator(*this); + } + virtual const ParamType* Current() const { return ¤t_value_; } + virtual bool Equals(const ParamIteratorInterface& other) const { + // Having the same base generator guarantees that the other + // iterator is of the same type and we can downcast. + GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) + << "The program attempted to compare iterators " + << "from different generators." << std::endl; + const Iterator* typed_other = + CheckedDowncastToActualType(&other); + // We must report iterators equal if they both point beyond their + // respective ranges. That can happen in a variety of fashions, + // so we have to consult AtEnd(). + return (AtEnd() && typed_other->AtEnd()) || + ( + current1_ == typed_other->current1_ && + current2_ == typed_other->current2_); + } + + private: + Iterator(const Iterator& other) + : base_(other.base_), + begin1_(other.begin1_), + end1_(other.end1_), + current1_(other.current1_), + begin2_(other.begin2_), + end2_(other.end2_), + current2_(other.current2_) { + ComputeCurrentValue(); + } + + void ComputeCurrentValue() { + if (!AtEnd()) + current_value_ = ParamType(*current1_, *current2_); + } + bool AtEnd() const { + // We must report iterator past the end of the range when either of the + // component iterators has reached the end of its range. + return + current1_ == end1_ || + current2_ == end2_; + } + + // No implementation - assignment is unsupported. + void operator=(const Iterator& other); + + const ParamGeneratorInterface* const base_; + // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. + // current[i]_ is the actual traversing iterator. + const typename ParamGenerator::iterator begin1_; + const typename ParamGenerator::iterator end1_; + typename ParamGenerator::iterator current1_; + const typename ParamGenerator::iterator begin2_; + const typename ParamGenerator::iterator end2_; + typename ParamGenerator::iterator current2_; + ParamType current_value_; + }; // class CartesianProductGenerator2::Iterator + + // No implementation - assignment is unsupported. + void operator=(const CartesianProductGenerator2& other); + + const ParamGenerator g1_; + const ParamGenerator g2_; +}; // class CartesianProductGenerator2 + + +template +class CartesianProductGenerator3 + : public ParamGeneratorInterface< ::std::tr1::tuple > { + public: + typedef ::std::tr1::tuple ParamType; + + CartesianProductGenerator3(const ParamGenerator& g1, + const ParamGenerator& g2, const ParamGenerator& g3) + : g1_(g1), g2_(g2), g3_(g3) {} + virtual ~CartesianProductGenerator3() {} + + virtual ParamIteratorInterface* Begin() const { + return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, + g3_.begin()); + } + virtual ParamIteratorInterface* End() const { + return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end()); + } + + private: + class Iterator : public ParamIteratorInterface { + public: + Iterator(const ParamGeneratorInterface* base, + const ParamGenerator& g1, + const typename ParamGenerator::iterator& current1, + const ParamGenerator& g2, + const typename ParamGenerator::iterator& current2, + const ParamGenerator& g3, + const typename ParamGenerator::iterator& current3) + : base_(base), + begin1_(g1.begin()), end1_(g1.end()), current1_(current1), + begin2_(g2.begin()), end2_(g2.end()), current2_(current2), + begin3_(g3.begin()), end3_(g3.end()), current3_(current3) { + ComputeCurrentValue(); + } + virtual ~Iterator() {} + + virtual const ParamGeneratorInterface* BaseGenerator() const { + return base_; + } + // Advance should not be called on beyond-of-range iterators + // so no component iterators must be beyond end of range, either. + virtual void Advance() { + assert(!AtEnd()); + ++current3_; + if (current3_ == end3_) { + current3_ = begin3_; + ++current2_; + } + if (current2_ == end2_) { + current2_ = begin2_; + ++current1_; + } + ComputeCurrentValue(); + } + virtual ParamIteratorInterface* Clone() const { + return new Iterator(*this); + } + virtual const ParamType* Current() const { return ¤t_value_; } + virtual bool Equals(const ParamIteratorInterface& other) const { + // Having the same base generator guarantees that the other + // iterator is of the same type and we can downcast. + GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) + << "The program attempted to compare iterators " + << "from different generators." << std::endl; + const Iterator* typed_other = + CheckedDowncastToActualType(&other); + // We must report iterators equal if they both point beyond their + // respective ranges. That can happen in a variety of fashions, + // so we have to consult AtEnd(). + return (AtEnd() && typed_other->AtEnd()) || + ( + current1_ == typed_other->current1_ && + current2_ == typed_other->current2_ && + current3_ == typed_other->current3_); + } + + private: + Iterator(const Iterator& other) + : base_(other.base_), + begin1_(other.begin1_), + end1_(other.end1_), + current1_(other.current1_), + begin2_(other.begin2_), + end2_(other.end2_), + current2_(other.current2_), + begin3_(other.begin3_), + end3_(other.end3_), + current3_(other.current3_) { + ComputeCurrentValue(); + } + + void ComputeCurrentValue() { + if (!AtEnd()) + current_value_ = ParamType(*current1_, *current2_, *current3_); + } + bool AtEnd() const { + // We must report iterator past the end of the range when either of the + // component iterators has reached the end of its range. + return + current1_ == end1_ || + current2_ == end2_ || + current3_ == end3_; + } + + // No implementation - assignment is unsupported. + void operator=(const Iterator& other); + + const ParamGeneratorInterface* const base_; + // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. + // current[i]_ is the actual traversing iterator. + const typename ParamGenerator::iterator begin1_; + const typename ParamGenerator::iterator end1_; + typename ParamGenerator::iterator current1_; + const typename ParamGenerator::iterator begin2_; + const typename ParamGenerator::iterator end2_; + typename ParamGenerator::iterator current2_; + const typename ParamGenerator::iterator begin3_; + const typename ParamGenerator::iterator end3_; + typename ParamGenerator::iterator current3_; + ParamType current_value_; + }; // class CartesianProductGenerator3::Iterator + + // No implementation - assignment is unsupported. + void operator=(const CartesianProductGenerator3& other); + + const ParamGenerator g1_; + const ParamGenerator g2_; + const ParamGenerator g3_; +}; // class CartesianProductGenerator3 + + +template +class CartesianProductGenerator4 + : public ParamGeneratorInterface< ::std::tr1::tuple > { + public: + typedef ::std::tr1::tuple ParamType; + + CartesianProductGenerator4(const ParamGenerator& g1, + const ParamGenerator& g2, const ParamGenerator& g3, + const ParamGenerator& g4) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {} + virtual ~CartesianProductGenerator4() {} + + virtual ParamIteratorInterface* Begin() const { + return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, + g3_.begin(), g4_, g4_.begin()); + } + virtual ParamIteratorInterface* End() const { + return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), + g4_, g4_.end()); + } + + private: + class Iterator : public ParamIteratorInterface { + public: + Iterator(const ParamGeneratorInterface* base, + const ParamGenerator& g1, + const typename ParamGenerator::iterator& current1, + const ParamGenerator& g2, + const typename ParamGenerator::iterator& current2, + const ParamGenerator& g3, + const typename ParamGenerator::iterator& current3, + const ParamGenerator& g4, + const typename ParamGenerator::iterator& current4) + : base_(base), + begin1_(g1.begin()), end1_(g1.end()), current1_(current1), + begin2_(g2.begin()), end2_(g2.end()), current2_(current2), + begin3_(g3.begin()), end3_(g3.end()), current3_(current3), + begin4_(g4.begin()), end4_(g4.end()), current4_(current4) { + ComputeCurrentValue(); + } + virtual ~Iterator() {} + + virtual const ParamGeneratorInterface* BaseGenerator() const { + return base_; + } + // Advance should not be called on beyond-of-range iterators + // so no component iterators must be beyond end of range, either. + virtual void Advance() { + assert(!AtEnd()); + ++current4_; + if (current4_ == end4_) { + current4_ = begin4_; + ++current3_; + } + if (current3_ == end3_) { + current3_ = begin3_; + ++current2_; + } + if (current2_ == end2_) { + current2_ = begin2_; + ++current1_; + } + ComputeCurrentValue(); + } + virtual ParamIteratorInterface* Clone() const { + return new Iterator(*this); + } + virtual const ParamType* Current() const { return ¤t_value_; } + virtual bool Equals(const ParamIteratorInterface& other) const { + // Having the same base generator guarantees that the other + // iterator is of the same type and we can downcast. + GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) + << "The program attempted to compare iterators " + << "from different generators." << std::endl; + const Iterator* typed_other = + CheckedDowncastToActualType(&other); + // We must report iterators equal if they both point beyond their + // respective ranges. That can happen in a variety of fashions, + // so we have to consult AtEnd(). + return (AtEnd() && typed_other->AtEnd()) || + ( + current1_ == typed_other->current1_ && + current2_ == typed_other->current2_ && + current3_ == typed_other->current3_ && + current4_ == typed_other->current4_); + } + + private: + Iterator(const Iterator& other) + : base_(other.base_), + begin1_(other.begin1_), + end1_(other.end1_), + current1_(other.current1_), + begin2_(other.begin2_), + end2_(other.end2_), + current2_(other.current2_), + begin3_(other.begin3_), + end3_(other.end3_), + current3_(other.current3_), + begin4_(other.begin4_), + end4_(other.end4_), + current4_(other.current4_) { + ComputeCurrentValue(); + } + + void ComputeCurrentValue() { + if (!AtEnd()) + current_value_ = ParamType(*current1_, *current2_, *current3_, + *current4_); + } + bool AtEnd() const { + // We must report iterator past the end of the range when either of the + // component iterators has reached the end of its range. + return + current1_ == end1_ || + current2_ == end2_ || + current3_ == end3_ || + current4_ == end4_; + } + + // No implementation - assignment is unsupported. + void operator=(const Iterator& other); + + const ParamGeneratorInterface* const base_; + // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. + // current[i]_ is the actual traversing iterator. + const typename ParamGenerator::iterator begin1_; + const typename ParamGenerator::iterator end1_; + typename ParamGenerator::iterator current1_; + const typename ParamGenerator::iterator begin2_; + const typename ParamGenerator::iterator end2_; + typename ParamGenerator::iterator current2_; + const typename ParamGenerator::iterator begin3_; + const typename ParamGenerator::iterator end3_; + typename ParamGenerator::iterator current3_; + const typename ParamGenerator::iterator begin4_; + const typename ParamGenerator::iterator end4_; + typename ParamGenerator::iterator current4_; + ParamType current_value_; + }; // class CartesianProductGenerator4::Iterator + + // No implementation - assignment is unsupported. + void operator=(const CartesianProductGenerator4& other); + + const ParamGenerator g1_; + const ParamGenerator g2_; + const ParamGenerator g3_; + const ParamGenerator g4_; +}; // class CartesianProductGenerator4 + + +template +class CartesianProductGenerator5 + : public ParamGeneratorInterface< ::std::tr1::tuple > { + public: + typedef ::std::tr1::tuple ParamType; + + CartesianProductGenerator5(const ParamGenerator& g1, + const ParamGenerator& g2, const ParamGenerator& g3, + const ParamGenerator& g4, const ParamGenerator& g5) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {} + virtual ~CartesianProductGenerator5() {} + + virtual ParamIteratorInterface* Begin() const { + return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, + g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin()); + } + virtual ParamIteratorInterface* End() const { + return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), + g4_, g4_.end(), g5_, g5_.end()); + } + + private: + class Iterator : public ParamIteratorInterface { + public: + Iterator(const ParamGeneratorInterface* base, + const ParamGenerator& g1, + const typename ParamGenerator::iterator& current1, + const ParamGenerator& g2, + const typename ParamGenerator::iterator& current2, + const ParamGenerator& g3, + const typename ParamGenerator::iterator& current3, + const ParamGenerator& g4, + const typename ParamGenerator::iterator& current4, + const ParamGenerator& g5, + const typename ParamGenerator::iterator& current5) + : base_(base), + begin1_(g1.begin()), end1_(g1.end()), current1_(current1), + begin2_(g2.begin()), end2_(g2.end()), current2_(current2), + begin3_(g3.begin()), end3_(g3.end()), current3_(current3), + begin4_(g4.begin()), end4_(g4.end()), current4_(current4), + begin5_(g5.begin()), end5_(g5.end()), current5_(current5) { + ComputeCurrentValue(); + } + virtual ~Iterator() {} + + virtual const ParamGeneratorInterface* BaseGenerator() const { + return base_; + } + // Advance should not be called on beyond-of-range iterators + // so no component iterators must be beyond end of range, either. + virtual void Advance() { + assert(!AtEnd()); + ++current5_; + if (current5_ == end5_) { + current5_ = begin5_; + ++current4_; + } + if (current4_ == end4_) { + current4_ = begin4_; + ++current3_; + } + if (current3_ == end3_) { + current3_ = begin3_; + ++current2_; + } + if (current2_ == end2_) { + current2_ = begin2_; + ++current1_; + } + ComputeCurrentValue(); + } + virtual ParamIteratorInterface* Clone() const { + return new Iterator(*this); + } + virtual const ParamType* Current() const { return ¤t_value_; } + virtual bool Equals(const ParamIteratorInterface& other) const { + // Having the same base generator guarantees that the other + // iterator is of the same type and we can downcast. + GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) + << "The program attempted to compare iterators " + << "from different generators." << std::endl; + const Iterator* typed_other = + CheckedDowncastToActualType(&other); + // We must report iterators equal if they both point beyond their + // respective ranges. That can happen in a variety of fashions, + // so we have to consult AtEnd(). + return (AtEnd() && typed_other->AtEnd()) || + ( + current1_ == typed_other->current1_ && + current2_ == typed_other->current2_ && + current3_ == typed_other->current3_ && + current4_ == typed_other->current4_ && + current5_ == typed_other->current5_); + } + + private: + Iterator(const Iterator& other) + : base_(other.base_), + begin1_(other.begin1_), + end1_(other.end1_), + current1_(other.current1_), + begin2_(other.begin2_), + end2_(other.end2_), + current2_(other.current2_), + begin3_(other.begin3_), + end3_(other.end3_), + current3_(other.current3_), + begin4_(other.begin4_), + end4_(other.end4_), + current4_(other.current4_), + begin5_(other.begin5_), + end5_(other.end5_), + current5_(other.current5_) { + ComputeCurrentValue(); + } + + void ComputeCurrentValue() { + if (!AtEnd()) + current_value_ = ParamType(*current1_, *current2_, *current3_, + *current4_, *current5_); + } + bool AtEnd() const { + // We must report iterator past the end of the range when either of the + // component iterators has reached the end of its range. + return + current1_ == end1_ || + current2_ == end2_ || + current3_ == end3_ || + current4_ == end4_ || + current5_ == end5_; + } + + // No implementation - assignment is unsupported. + void operator=(const Iterator& other); + + const ParamGeneratorInterface* const base_; + // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. + // current[i]_ is the actual traversing iterator. + const typename ParamGenerator::iterator begin1_; + const typename ParamGenerator::iterator end1_; + typename ParamGenerator::iterator current1_; + const typename ParamGenerator::iterator begin2_; + const typename ParamGenerator::iterator end2_; + typename ParamGenerator::iterator current2_; + const typename ParamGenerator::iterator begin3_; + const typename ParamGenerator::iterator end3_; + typename ParamGenerator::iterator current3_; + const typename ParamGenerator::iterator begin4_; + const typename ParamGenerator::iterator end4_; + typename ParamGenerator::iterator current4_; + const typename ParamGenerator::iterator begin5_; + const typename ParamGenerator::iterator end5_; + typename ParamGenerator::iterator current5_; + ParamType current_value_; + }; // class CartesianProductGenerator5::Iterator + + // No implementation - assignment is unsupported. + void operator=(const CartesianProductGenerator5& other); + + const ParamGenerator g1_; + const ParamGenerator g2_; + const ParamGenerator g3_; + const ParamGenerator g4_; + const ParamGenerator g5_; +}; // class CartesianProductGenerator5 + + +template +class CartesianProductGenerator6 + : public ParamGeneratorInterface< ::std::tr1::tuple > { + public: + typedef ::std::tr1::tuple ParamType; + + CartesianProductGenerator6(const ParamGenerator& g1, + const ParamGenerator& g2, const ParamGenerator& g3, + const ParamGenerator& g4, const ParamGenerator& g5, + const ParamGenerator& g6) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {} + virtual ~CartesianProductGenerator6() {} + + virtual ParamIteratorInterface* Begin() const { + return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, + g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin()); + } + virtual ParamIteratorInterface* End() const { + return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), + g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end()); + } + + private: + class Iterator : public ParamIteratorInterface { + public: + Iterator(const ParamGeneratorInterface* base, + const ParamGenerator& g1, + const typename ParamGenerator::iterator& current1, + const ParamGenerator& g2, + const typename ParamGenerator::iterator& current2, + const ParamGenerator& g3, + const typename ParamGenerator::iterator& current3, + const ParamGenerator& g4, + const typename ParamGenerator::iterator& current4, + const ParamGenerator& g5, + const typename ParamGenerator::iterator& current5, + const ParamGenerator& g6, + const typename ParamGenerator::iterator& current6) + : base_(base), + begin1_(g1.begin()), end1_(g1.end()), current1_(current1), + begin2_(g2.begin()), end2_(g2.end()), current2_(current2), + begin3_(g3.begin()), end3_(g3.end()), current3_(current3), + begin4_(g4.begin()), end4_(g4.end()), current4_(current4), + begin5_(g5.begin()), end5_(g5.end()), current5_(current5), + begin6_(g6.begin()), end6_(g6.end()), current6_(current6) { + ComputeCurrentValue(); + } + virtual ~Iterator() {} + + virtual const ParamGeneratorInterface* BaseGenerator() const { + return base_; + } + // Advance should not be called on beyond-of-range iterators + // so no component iterators must be beyond end of range, either. + virtual void Advance() { + assert(!AtEnd()); + ++current6_; + if (current6_ == end6_) { + current6_ = begin6_; + ++current5_; + } + if (current5_ == end5_) { + current5_ = begin5_; + ++current4_; + } + if (current4_ == end4_) { + current4_ = begin4_; + ++current3_; + } + if (current3_ == end3_) { + current3_ = begin3_; + ++current2_; + } + if (current2_ == end2_) { + current2_ = begin2_; + ++current1_; + } + ComputeCurrentValue(); + } + virtual ParamIteratorInterface* Clone() const { + return new Iterator(*this); + } + virtual const ParamType* Current() const { return ¤t_value_; } + virtual bool Equals(const ParamIteratorInterface& other) const { + // Having the same base generator guarantees that the other + // iterator is of the same type and we can downcast. + GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) + << "The program attempted to compare iterators " + << "from different generators." << std::endl; + const Iterator* typed_other = + CheckedDowncastToActualType(&other); + // We must report iterators equal if they both point beyond their + // respective ranges. That can happen in a variety of fashions, + // so we have to consult AtEnd(). + return (AtEnd() && typed_other->AtEnd()) || + ( + current1_ == typed_other->current1_ && + current2_ == typed_other->current2_ && + current3_ == typed_other->current3_ && + current4_ == typed_other->current4_ && + current5_ == typed_other->current5_ && + current6_ == typed_other->current6_); + } + + private: + Iterator(const Iterator& other) + : base_(other.base_), + begin1_(other.begin1_), + end1_(other.end1_), + current1_(other.current1_), + begin2_(other.begin2_), + end2_(other.end2_), + current2_(other.current2_), + begin3_(other.begin3_), + end3_(other.end3_), + current3_(other.current3_), + begin4_(other.begin4_), + end4_(other.end4_), + current4_(other.current4_), + begin5_(other.begin5_), + end5_(other.end5_), + current5_(other.current5_), + begin6_(other.begin6_), + end6_(other.end6_), + current6_(other.current6_) { + ComputeCurrentValue(); + } + + void ComputeCurrentValue() { + if (!AtEnd()) + current_value_ = ParamType(*current1_, *current2_, *current3_, + *current4_, *current5_, *current6_); + } + bool AtEnd() const { + // We must report iterator past the end of the range when either of the + // component iterators has reached the end of its range. + return + current1_ == end1_ || + current2_ == end2_ || + current3_ == end3_ || + current4_ == end4_ || + current5_ == end5_ || + current6_ == end6_; + } + + // No implementation - assignment is unsupported. + void operator=(const Iterator& other); + + const ParamGeneratorInterface* const base_; + // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. + // current[i]_ is the actual traversing iterator. + const typename ParamGenerator::iterator begin1_; + const typename ParamGenerator::iterator end1_; + typename ParamGenerator::iterator current1_; + const typename ParamGenerator::iterator begin2_; + const typename ParamGenerator::iterator end2_; + typename ParamGenerator::iterator current2_; + const typename ParamGenerator::iterator begin3_; + const typename ParamGenerator::iterator end3_; + typename ParamGenerator::iterator current3_; + const typename ParamGenerator::iterator begin4_; + const typename ParamGenerator::iterator end4_; + typename ParamGenerator::iterator current4_; + const typename ParamGenerator::iterator begin5_; + const typename ParamGenerator::iterator end5_; + typename ParamGenerator::iterator current5_; + const typename ParamGenerator::iterator begin6_; + const typename ParamGenerator::iterator end6_; + typename ParamGenerator::iterator current6_; + ParamType current_value_; + }; // class CartesianProductGenerator6::Iterator + + // No implementation - assignment is unsupported. + void operator=(const CartesianProductGenerator6& other); + + const ParamGenerator g1_; + const ParamGenerator g2_; + const ParamGenerator g3_; + const ParamGenerator g4_; + const ParamGenerator g5_; + const ParamGenerator g6_; +}; // class CartesianProductGenerator6 + + +template +class CartesianProductGenerator7 + : public ParamGeneratorInterface< ::std::tr1::tuple > { + public: + typedef ::std::tr1::tuple ParamType; + + CartesianProductGenerator7(const ParamGenerator& g1, + const ParamGenerator& g2, const ParamGenerator& g3, + const ParamGenerator& g4, const ParamGenerator& g5, + const ParamGenerator& g6, const ParamGenerator& g7) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {} + virtual ~CartesianProductGenerator7() {} + + virtual ParamIteratorInterface* Begin() const { + return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, + g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, + g7_.begin()); + } + virtual ParamIteratorInterface* End() const { + return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), + g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end()); + } + + private: + class Iterator : public ParamIteratorInterface { + public: + Iterator(const ParamGeneratorInterface* base, + const ParamGenerator& g1, + const typename ParamGenerator::iterator& current1, + const ParamGenerator& g2, + const typename ParamGenerator::iterator& current2, + const ParamGenerator& g3, + const typename ParamGenerator::iterator& current3, + const ParamGenerator& g4, + const typename ParamGenerator::iterator& current4, + const ParamGenerator& g5, + const typename ParamGenerator::iterator& current5, + const ParamGenerator& g6, + const typename ParamGenerator::iterator& current6, + const ParamGenerator& g7, + const typename ParamGenerator::iterator& current7) + : base_(base), + begin1_(g1.begin()), end1_(g1.end()), current1_(current1), + begin2_(g2.begin()), end2_(g2.end()), current2_(current2), + begin3_(g3.begin()), end3_(g3.end()), current3_(current3), + begin4_(g4.begin()), end4_(g4.end()), current4_(current4), + begin5_(g5.begin()), end5_(g5.end()), current5_(current5), + begin6_(g6.begin()), end6_(g6.end()), current6_(current6), + begin7_(g7.begin()), end7_(g7.end()), current7_(current7) { + ComputeCurrentValue(); + } + virtual ~Iterator() {} + + virtual const ParamGeneratorInterface* BaseGenerator() const { + return base_; + } + // Advance should not be called on beyond-of-range iterators + // so no component iterators must be beyond end of range, either. + virtual void Advance() { + assert(!AtEnd()); + ++current7_; + if (current7_ == end7_) { + current7_ = begin7_; + ++current6_; + } + if (current6_ == end6_) { + current6_ = begin6_; + ++current5_; + } + if (current5_ == end5_) { + current5_ = begin5_; + ++current4_; + } + if (current4_ == end4_) { + current4_ = begin4_; + ++current3_; + } + if (current3_ == end3_) { + current3_ = begin3_; + ++current2_; + } + if (current2_ == end2_) { + current2_ = begin2_; + ++current1_; + } + ComputeCurrentValue(); + } + virtual ParamIteratorInterface* Clone() const { + return new Iterator(*this); + } + virtual const ParamType* Current() const { return ¤t_value_; } + virtual bool Equals(const ParamIteratorInterface& other) const { + // Having the same base generator guarantees that the other + // iterator is of the same type and we can downcast. + GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) + << "The program attempted to compare iterators " + << "from different generators." << std::endl; + const Iterator* typed_other = + CheckedDowncastToActualType(&other); + // We must report iterators equal if they both point beyond their + // respective ranges. That can happen in a variety of fashions, + // so we have to consult AtEnd(). + return (AtEnd() && typed_other->AtEnd()) || + ( + current1_ == typed_other->current1_ && + current2_ == typed_other->current2_ && + current3_ == typed_other->current3_ && + current4_ == typed_other->current4_ && + current5_ == typed_other->current5_ && + current6_ == typed_other->current6_ && + current7_ == typed_other->current7_); + } + + private: + Iterator(const Iterator& other) + : base_(other.base_), + begin1_(other.begin1_), + end1_(other.end1_), + current1_(other.current1_), + begin2_(other.begin2_), + end2_(other.end2_), + current2_(other.current2_), + begin3_(other.begin3_), + end3_(other.end3_), + current3_(other.current3_), + begin4_(other.begin4_), + end4_(other.end4_), + current4_(other.current4_), + begin5_(other.begin5_), + end5_(other.end5_), + current5_(other.current5_), + begin6_(other.begin6_), + end6_(other.end6_), + current6_(other.current6_), + begin7_(other.begin7_), + end7_(other.end7_), + current7_(other.current7_) { + ComputeCurrentValue(); + } + + void ComputeCurrentValue() { + if (!AtEnd()) + current_value_ = ParamType(*current1_, *current2_, *current3_, + *current4_, *current5_, *current6_, *current7_); + } + bool AtEnd() const { + // We must report iterator past the end of the range when either of the + // component iterators has reached the end of its range. + return + current1_ == end1_ || + current2_ == end2_ || + current3_ == end3_ || + current4_ == end4_ || + current5_ == end5_ || + current6_ == end6_ || + current7_ == end7_; + } + + // No implementation - assignment is unsupported. + void operator=(const Iterator& other); + + const ParamGeneratorInterface* const base_; + // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. + // current[i]_ is the actual traversing iterator. + const typename ParamGenerator::iterator begin1_; + const typename ParamGenerator::iterator end1_; + typename ParamGenerator::iterator current1_; + const typename ParamGenerator::iterator begin2_; + const typename ParamGenerator::iterator end2_; + typename ParamGenerator::iterator current2_; + const typename ParamGenerator::iterator begin3_; + const typename ParamGenerator::iterator end3_; + typename ParamGenerator::iterator current3_; + const typename ParamGenerator::iterator begin4_; + const typename ParamGenerator::iterator end4_; + typename ParamGenerator::iterator current4_; + const typename ParamGenerator::iterator begin5_; + const typename ParamGenerator::iterator end5_; + typename ParamGenerator::iterator current5_; + const typename ParamGenerator::iterator begin6_; + const typename ParamGenerator::iterator end6_; + typename ParamGenerator::iterator current6_; + const typename ParamGenerator::iterator begin7_; + const typename ParamGenerator::iterator end7_; + typename ParamGenerator::iterator current7_; + ParamType current_value_; + }; // class CartesianProductGenerator7::Iterator + + // No implementation - assignment is unsupported. + void operator=(const CartesianProductGenerator7& other); + + const ParamGenerator g1_; + const ParamGenerator g2_; + const ParamGenerator g3_; + const ParamGenerator g4_; + const ParamGenerator g5_; + const ParamGenerator g6_; + const ParamGenerator g7_; +}; // class CartesianProductGenerator7 + + +template +class CartesianProductGenerator8 + : public ParamGeneratorInterface< ::std::tr1::tuple > { + public: + typedef ::std::tr1::tuple ParamType; + + CartesianProductGenerator8(const ParamGenerator& g1, + const ParamGenerator& g2, const ParamGenerator& g3, + const ParamGenerator& g4, const ParamGenerator& g5, + const ParamGenerator& g6, const ParamGenerator& g7, + const ParamGenerator& g8) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), + g8_(g8) {} + virtual ~CartesianProductGenerator8() {} + + virtual ParamIteratorInterface* Begin() const { + return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, + g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, + g7_.begin(), g8_, g8_.begin()); + } + virtual ParamIteratorInterface* End() const { + return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), + g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, + g8_.end()); + } + + private: + class Iterator : public ParamIteratorInterface { + public: + Iterator(const ParamGeneratorInterface* base, + const ParamGenerator& g1, + const typename ParamGenerator::iterator& current1, + const ParamGenerator& g2, + const typename ParamGenerator::iterator& current2, + const ParamGenerator& g3, + const typename ParamGenerator::iterator& current3, + const ParamGenerator& g4, + const typename ParamGenerator::iterator& current4, + const ParamGenerator& g5, + const typename ParamGenerator::iterator& current5, + const ParamGenerator& g6, + const typename ParamGenerator::iterator& current6, + const ParamGenerator& g7, + const typename ParamGenerator::iterator& current7, + const ParamGenerator& g8, + const typename ParamGenerator::iterator& current8) + : base_(base), + begin1_(g1.begin()), end1_(g1.end()), current1_(current1), + begin2_(g2.begin()), end2_(g2.end()), current2_(current2), + begin3_(g3.begin()), end3_(g3.end()), current3_(current3), + begin4_(g4.begin()), end4_(g4.end()), current4_(current4), + begin5_(g5.begin()), end5_(g5.end()), current5_(current5), + begin6_(g6.begin()), end6_(g6.end()), current6_(current6), + begin7_(g7.begin()), end7_(g7.end()), current7_(current7), + begin8_(g8.begin()), end8_(g8.end()), current8_(current8) { + ComputeCurrentValue(); + } + virtual ~Iterator() {} + + virtual const ParamGeneratorInterface* BaseGenerator() const { + return base_; + } + // Advance should not be called on beyond-of-range iterators + // so no component iterators must be beyond end of range, either. + virtual void Advance() { + assert(!AtEnd()); + ++current8_; + if (current8_ == end8_) { + current8_ = begin8_; + ++current7_; + } + if (current7_ == end7_) { + current7_ = begin7_; + ++current6_; + } + if (current6_ == end6_) { + current6_ = begin6_; + ++current5_; + } + if (current5_ == end5_) { + current5_ = begin5_; + ++current4_; + } + if (current4_ == end4_) { + current4_ = begin4_; + ++current3_; + } + if (current3_ == end3_) { + current3_ = begin3_; + ++current2_; + } + if (current2_ == end2_) { + current2_ = begin2_; + ++current1_; + } + ComputeCurrentValue(); + } + virtual ParamIteratorInterface* Clone() const { + return new Iterator(*this); + } + virtual const ParamType* Current() const { return ¤t_value_; } + virtual bool Equals(const ParamIteratorInterface& other) const { + // Having the same base generator guarantees that the other + // iterator is of the same type and we can downcast. + GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) + << "The program attempted to compare iterators " + << "from different generators." << std::endl; + const Iterator* typed_other = + CheckedDowncastToActualType(&other); + // We must report iterators equal if they both point beyond their + // respective ranges. That can happen in a variety of fashions, + // so we have to consult AtEnd(). + return (AtEnd() && typed_other->AtEnd()) || + ( + current1_ == typed_other->current1_ && + current2_ == typed_other->current2_ && + current3_ == typed_other->current3_ && + current4_ == typed_other->current4_ && + current5_ == typed_other->current5_ && + current6_ == typed_other->current6_ && + current7_ == typed_other->current7_ && + current8_ == typed_other->current8_); + } + + private: + Iterator(const Iterator& other) + : base_(other.base_), + begin1_(other.begin1_), + end1_(other.end1_), + current1_(other.current1_), + begin2_(other.begin2_), + end2_(other.end2_), + current2_(other.current2_), + begin3_(other.begin3_), + end3_(other.end3_), + current3_(other.current3_), + begin4_(other.begin4_), + end4_(other.end4_), + current4_(other.current4_), + begin5_(other.begin5_), + end5_(other.end5_), + current5_(other.current5_), + begin6_(other.begin6_), + end6_(other.end6_), + current6_(other.current6_), + begin7_(other.begin7_), + end7_(other.end7_), + current7_(other.current7_), + begin8_(other.begin8_), + end8_(other.end8_), + current8_(other.current8_) { + ComputeCurrentValue(); + } + + void ComputeCurrentValue() { + if (!AtEnd()) + current_value_ = ParamType(*current1_, *current2_, *current3_, + *current4_, *current5_, *current6_, *current7_, *current8_); + } + bool AtEnd() const { + // We must report iterator past the end of the range when either of the + // component iterators has reached the end of its range. + return + current1_ == end1_ || + current2_ == end2_ || + current3_ == end3_ || + current4_ == end4_ || + current5_ == end5_ || + current6_ == end6_ || + current7_ == end7_ || + current8_ == end8_; + } + + // No implementation - assignment is unsupported. + void operator=(const Iterator& other); + + const ParamGeneratorInterface* const base_; + // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. + // current[i]_ is the actual traversing iterator. + const typename ParamGenerator::iterator begin1_; + const typename ParamGenerator::iterator end1_; + typename ParamGenerator::iterator current1_; + const typename ParamGenerator::iterator begin2_; + const typename ParamGenerator::iterator end2_; + typename ParamGenerator::iterator current2_; + const typename ParamGenerator::iterator begin3_; + const typename ParamGenerator::iterator end3_; + typename ParamGenerator::iterator current3_; + const typename ParamGenerator::iterator begin4_; + const typename ParamGenerator::iterator end4_; + typename ParamGenerator::iterator current4_; + const typename ParamGenerator::iterator begin5_; + const typename ParamGenerator::iterator end5_; + typename ParamGenerator::iterator current5_; + const typename ParamGenerator::iterator begin6_; + const typename ParamGenerator::iterator end6_; + typename ParamGenerator::iterator current6_; + const typename ParamGenerator::iterator begin7_; + const typename ParamGenerator::iterator end7_; + typename ParamGenerator::iterator current7_; + const typename ParamGenerator::iterator begin8_; + const typename ParamGenerator::iterator end8_; + typename ParamGenerator::iterator current8_; + ParamType current_value_; + }; // class CartesianProductGenerator8::Iterator + + // No implementation - assignment is unsupported. + void operator=(const CartesianProductGenerator8& other); + + const ParamGenerator g1_; + const ParamGenerator g2_; + const ParamGenerator g3_; + const ParamGenerator g4_; + const ParamGenerator g5_; + const ParamGenerator g6_; + const ParamGenerator g7_; + const ParamGenerator g8_; +}; // class CartesianProductGenerator8 + + +template +class CartesianProductGenerator9 + : public ParamGeneratorInterface< ::std::tr1::tuple > { + public: + typedef ::std::tr1::tuple ParamType; + + CartesianProductGenerator9(const ParamGenerator& g1, + const ParamGenerator& g2, const ParamGenerator& g3, + const ParamGenerator& g4, const ParamGenerator& g5, + const ParamGenerator& g6, const ParamGenerator& g7, + const ParamGenerator& g8, const ParamGenerator& g9) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), + g9_(g9) {} + virtual ~CartesianProductGenerator9() {} + + virtual ParamIteratorInterface* Begin() const { + return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, + g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, + g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin()); + } + virtual ParamIteratorInterface* End() const { + return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), + g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, + g8_.end(), g9_, g9_.end()); + } + + private: + class Iterator : public ParamIteratorInterface { + public: + Iterator(const ParamGeneratorInterface* base, + const ParamGenerator& g1, + const typename ParamGenerator::iterator& current1, + const ParamGenerator& g2, + const typename ParamGenerator::iterator& current2, + const ParamGenerator& g3, + const typename ParamGenerator::iterator& current3, + const ParamGenerator& g4, + const typename ParamGenerator::iterator& current4, + const ParamGenerator& g5, + const typename ParamGenerator::iterator& current5, + const ParamGenerator& g6, + const typename ParamGenerator::iterator& current6, + const ParamGenerator& g7, + const typename ParamGenerator::iterator& current7, + const ParamGenerator& g8, + const typename ParamGenerator::iterator& current8, + const ParamGenerator& g9, + const typename ParamGenerator::iterator& current9) + : base_(base), + begin1_(g1.begin()), end1_(g1.end()), current1_(current1), + begin2_(g2.begin()), end2_(g2.end()), current2_(current2), + begin3_(g3.begin()), end3_(g3.end()), current3_(current3), + begin4_(g4.begin()), end4_(g4.end()), current4_(current4), + begin5_(g5.begin()), end5_(g5.end()), current5_(current5), + begin6_(g6.begin()), end6_(g6.end()), current6_(current6), + begin7_(g7.begin()), end7_(g7.end()), current7_(current7), + begin8_(g8.begin()), end8_(g8.end()), current8_(current8), + begin9_(g9.begin()), end9_(g9.end()), current9_(current9) { + ComputeCurrentValue(); + } + virtual ~Iterator() {} + + virtual const ParamGeneratorInterface* BaseGenerator() const { + return base_; + } + // Advance should not be called on beyond-of-range iterators + // so no component iterators must be beyond end of range, either. + virtual void Advance() { + assert(!AtEnd()); + ++current9_; + if (current9_ == end9_) { + current9_ = begin9_; + ++current8_; + } + if (current8_ == end8_) { + current8_ = begin8_; + ++current7_; + } + if (current7_ == end7_) { + current7_ = begin7_; + ++current6_; + } + if (current6_ == end6_) { + current6_ = begin6_; + ++current5_; + } + if (current5_ == end5_) { + current5_ = begin5_; + ++current4_; + } + if (current4_ == end4_) { + current4_ = begin4_; + ++current3_; + } + if (current3_ == end3_) { + current3_ = begin3_; + ++current2_; + } + if (current2_ == end2_) { + current2_ = begin2_; + ++current1_; + } + ComputeCurrentValue(); + } + virtual ParamIteratorInterface* Clone() const { + return new Iterator(*this); + } + virtual const ParamType* Current() const { return ¤t_value_; } + virtual bool Equals(const ParamIteratorInterface& other) const { + // Having the same base generator guarantees that the other + // iterator is of the same type and we can downcast. + GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) + << "The program attempted to compare iterators " + << "from different generators." << std::endl; + const Iterator* typed_other = + CheckedDowncastToActualType(&other); + // We must report iterators equal if they both point beyond their + // respective ranges. That can happen in a variety of fashions, + // so we have to consult AtEnd(). + return (AtEnd() && typed_other->AtEnd()) || + ( + current1_ == typed_other->current1_ && + current2_ == typed_other->current2_ && + current3_ == typed_other->current3_ && + current4_ == typed_other->current4_ && + current5_ == typed_other->current5_ && + current6_ == typed_other->current6_ && + current7_ == typed_other->current7_ && + current8_ == typed_other->current8_ && + current9_ == typed_other->current9_); + } + + private: + Iterator(const Iterator& other) + : base_(other.base_), + begin1_(other.begin1_), + end1_(other.end1_), + current1_(other.current1_), + begin2_(other.begin2_), + end2_(other.end2_), + current2_(other.current2_), + begin3_(other.begin3_), + end3_(other.end3_), + current3_(other.current3_), + begin4_(other.begin4_), + end4_(other.end4_), + current4_(other.current4_), + begin5_(other.begin5_), + end5_(other.end5_), + current5_(other.current5_), + begin6_(other.begin6_), + end6_(other.end6_), + current6_(other.current6_), + begin7_(other.begin7_), + end7_(other.end7_), + current7_(other.current7_), + begin8_(other.begin8_), + end8_(other.end8_), + current8_(other.current8_), + begin9_(other.begin9_), + end9_(other.end9_), + current9_(other.current9_) { + ComputeCurrentValue(); + } + + void ComputeCurrentValue() { + if (!AtEnd()) + current_value_ = ParamType(*current1_, *current2_, *current3_, + *current4_, *current5_, *current6_, *current7_, *current8_, + *current9_); + } + bool AtEnd() const { + // We must report iterator past the end of the range when either of the + // component iterators has reached the end of its range. + return + current1_ == end1_ || + current2_ == end2_ || + current3_ == end3_ || + current4_ == end4_ || + current5_ == end5_ || + current6_ == end6_ || + current7_ == end7_ || + current8_ == end8_ || + current9_ == end9_; + } + + // No implementation - assignment is unsupported. + void operator=(const Iterator& other); + + const ParamGeneratorInterface* const base_; + // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. + // current[i]_ is the actual traversing iterator. + const typename ParamGenerator::iterator begin1_; + const typename ParamGenerator::iterator end1_; + typename ParamGenerator::iterator current1_; + const typename ParamGenerator::iterator begin2_; + const typename ParamGenerator::iterator end2_; + typename ParamGenerator::iterator current2_; + const typename ParamGenerator::iterator begin3_; + const typename ParamGenerator::iterator end3_; + typename ParamGenerator::iterator current3_; + const typename ParamGenerator::iterator begin4_; + const typename ParamGenerator::iterator end4_; + typename ParamGenerator::iterator current4_; + const typename ParamGenerator::iterator begin5_; + const typename ParamGenerator::iterator end5_; + typename ParamGenerator::iterator current5_; + const typename ParamGenerator::iterator begin6_; + const typename ParamGenerator::iterator end6_; + typename ParamGenerator::iterator current6_; + const typename ParamGenerator::iterator begin7_; + const typename ParamGenerator::iterator end7_; + typename ParamGenerator::iterator current7_; + const typename ParamGenerator::iterator begin8_; + const typename ParamGenerator::iterator end8_; + typename ParamGenerator::iterator current8_; + const typename ParamGenerator::iterator begin9_; + const typename ParamGenerator::iterator end9_; + typename ParamGenerator::iterator current9_; + ParamType current_value_; + }; // class CartesianProductGenerator9::Iterator + + // No implementation - assignment is unsupported. + void operator=(const CartesianProductGenerator9& other); + + const ParamGenerator g1_; + const ParamGenerator g2_; + const ParamGenerator g3_; + const ParamGenerator g4_; + const ParamGenerator g5_; + const ParamGenerator g6_; + const ParamGenerator g7_; + const ParamGenerator g8_; + const ParamGenerator g9_; +}; // class CartesianProductGenerator9 + + +template +class CartesianProductGenerator10 + : public ParamGeneratorInterface< ::std::tr1::tuple > { + public: + typedef ::std::tr1::tuple ParamType; + + CartesianProductGenerator10(const ParamGenerator& g1, + const ParamGenerator& g2, const ParamGenerator& g3, + const ParamGenerator& g4, const ParamGenerator& g5, + const ParamGenerator& g6, const ParamGenerator& g7, + const ParamGenerator& g8, const ParamGenerator& g9, + const ParamGenerator& g10) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), + g9_(g9), g10_(g10) {} + virtual ~CartesianProductGenerator10() {} + + virtual ParamIteratorInterface* Begin() const { + return new Iterator(this, g1_, g1_.begin(), g2_, g2_.begin(), g3_, + g3_.begin(), g4_, g4_.begin(), g5_, g5_.begin(), g6_, g6_.begin(), g7_, + g7_.begin(), g8_, g8_.begin(), g9_, g9_.begin(), g10_, g10_.begin()); + } + virtual ParamIteratorInterface* End() const { + return new Iterator(this, g1_, g1_.end(), g2_, g2_.end(), g3_, g3_.end(), + g4_, g4_.end(), g5_, g5_.end(), g6_, g6_.end(), g7_, g7_.end(), g8_, + g8_.end(), g9_, g9_.end(), g10_, g10_.end()); + } + + private: + class Iterator : public ParamIteratorInterface { + public: + Iterator(const ParamGeneratorInterface* base, + const ParamGenerator& g1, + const typename ParamGenerator::iterator& current1, + const ParamGenerator& g2, + const typename ParamGenerator::iterator& current2, + const ParamGenerator& g3, + const typename ParamGenerator::iterator& current3, + const ParamGenerator& g4, + const typename ParamGenerator::iterator& current4, + const ParamGenerator& g5, + const typename ParamGenerator::iterator& current5, + const ParamGenerator& g6, + const typename ParamGenerator::iterator& current6, + const ParamGenerator& g7, + const typename ParamGenerator::iterator& current7, + const ParamGenerator& g8, + const typename ParamGenerator::iterator& current8, + const ParamGenerator& g9, + const typename ParamGenerator::iterator& current9, + const ParamGenerator& g10, + const typename ParamGenerator::iterator& current10) + : base_(base), + begin1_(g1.begin()), end1_(g1.end()), current1_(current1), + begin2_(g2.begin()), end2_(g2.end()), current2_(current2), + begin3_(g3.begin()), end3_(g3.end()), current3_(current3), + begin4_(g4.begin()), end4_(g4.end()), current4_(current4), + begin5_(g5.begin()), end5_(g5.end()), current5_(current5), + begin6_(g6.begin()), end6_(g6.end()), current6_(current6), + begin7_(g7.begin()), end7_(g7.end()), current7_(current7), + begin8_(g8.begin()), end8_(g8.end()), current8_(current8), + begin9_(g9.begin()), end9_(g9.end()), current9_(current9), + begin10_(g10.begin()), end10_(g10.end()), current10_(current10) { + ComputeCurrentValue(); + } + virtual ~Iterator() {} + + virtual const ParamGeneratorInterface* BaseGenerator() const { + return base_; + } + // Advance should not be called on beyond-of-range iterators + // so no component iterators must be beyond end of range, either. + virtual void Advance() { + assert(!AtEnd()); + ++current10_; + if (current10_ == end10_) { + current10_ = begin10_; + ++current9_; + } + if (current9_ == end9_) { + current9_ = begin9_; + ++current8_; + } + if (current8_ == end8_) { + current8_ = begin8_; + ++current7_; + } + if (current7_ == end7_) { + current7_ = begin7_; + ++current6_; + } + if (current6_ == end6_) { + current6_ = begin6_; + ++current5_; + } + if (current5_ == end5_) { + current5_ = begin5_; + ++current4_; + } + if (current4_ == end4_) { + current4_ = begin4_; + ++current3_; + } + if (current3_ == end3_) { + current3_ = begin3_; + ++current2_; + } + if (current2_ == end2_) { + current2_ = begin2_; + ++current1_; + } + ComputeCurrentValue(); + } + virtual ParamIteratorInterface* Clone() const { + return new Iterator(*this); + } + virtual const ParamType* Current() const { return ¤t_value_; } + virtual bool Equals(const ParamIteratorInterface& other) const { + // Having the same base generator guarantees that the other + // iterator is of the same type and we can downcast. + GTEST_CHECK_(BaseGenerator() == other.BaseGenerator()) + << "The program attempted to compare iterators " + << "from different generators." << std::endl; + const Iterator* typed_other = + CheckedDowncastToActualType(&other); + // We must report iterators equal if they both point beyond their + // respective ranges. That can happen in a variety of fashions, + // so we have to consult AtEnd(). + return (AtEnd() && typed_other->AtEnd()) || + ( + current1_ == typed_other->current1_ && + current2_ == typed_other->current2_ && + current3_ == typed_other->current3_ && + current4_ == typed_other->current4_ && + current5_ == typed_other->current5_ && + current6_ == typed_other->current6_ && + current7_ == typed_other->current7_ && + current8_ == typed_other->current8_ && + current9_ == typed_other->current9_ && + current10_ == typed_other->current10_); + } + + private: + Iterator(const Iterator& other) + : base_(other.base_), + begin1_(other.begin1_), + end1_(other.end1_), + current1_(other.current1_), + begin2_(other.begin2_), + end2_(other.end2_), + current2_(other.current2_), + begin3_(other.begin3_), + end3_(other.end3_), + current3_(other.current3_), + begin4_(other.begin4_), + end4_(other.end4_), + current4_(other.current4_), + begin5_(other.begin5_), + end5_(other.end5_), + current5_(other.current5_), + begin6_(other.begin6_), + end6_(other.end6_), + current6_(other.current6_), + begin7_(other.begin7_), + end7_(other.end7_), + current7_(other.current7_), + begin8_(other.begin8_), + end8_(other.end8_), + current8_(other.current8_), + begin9_(other.begin9_), + end9_(other.end9_), + current9_(other.current9_), + begin10_(other.begin10_), + end10_(other.end10_), + current10_(other.current10_) { + ComputeCurrentValue(); + } + + void ComputeCurrentValue() { + if (!AtEnd()) + current_value_ = ParamType(*current1_, *current2_, *current3_, + *current4_, *current5_, *current6_, *current7_, *current8_, + *current9_, *current10_); + } + bool AtEnd() const { + // We must report iterator past the end of the range when either of the + // component iterators has reached the end of its range. + return + current1_ == end1_ || + current2_ == end2_ || + current3_ == end3_ || + current4_ == end4_ || + current5_ == end5_ || + current6_ == end6_ || + current7_ == end7_ || + current8_ == end8_ || + current9_ == end9_ || + current10_ == end10_; + } + + // No implementation - assignment is unsupported. + void operator=(const Iterator& other); + + const ParamGeneratorInterface* const base_; + // begin[i]_ and end[i]_ define the i-th range that Iterator traverses. + // current[i]_ is the actual traversing iterator. + const typename ParamGenerator::iterator begin1_; + const typename ParamGenerator::iterator end1_; + typename ParamGenerator::iterator current1_; + const typename ParamGenerator::iterator begin2_; + const typename ParamGenerator::iterator end2_; + typename ParamGenerator::iterator current2_; + const typename ParamGenerator::iterator begin3_; + const typename ParamGenerator::iterator end3_; + typename ParamGenerator::iterator current3_; + const typename ParamGenerator::iterator begin4_; + const typename ParamGenerator::iterator end4_; + typename ParamGenerator::iterator current4_; + const typename ParamGenerator::iterator begin5_; + const typename ParamGenerator::iterator end5_; + typename ParamGenerator::iterator current5_; + const typename ParamGenerator::iterator begin6_; + const typename ParamGenerator::iterator end6_; + typename ParamGenerator::iterator current6_; + const typename ParamGenerator::iterator begin7_; + const typename ParamGenerator::iterator end7_; + typename ParamGenerator::iterator current7_; + const typename ParamGenerator::iterator begin8_; + const typename ParamGenerator::iterator end8_; + typename ParamGenerator::iterator current8_; + const typename ParamGenerator::iterator begin9_; + const typename ParamGenerator::iterator end9_; + typename ParamGenerator::iterator current9_; + const typename ParamGenerator::iterator begin10_; + const typename ParamGenerator::iterator end10_; + typename ParamGenerator::iterator current10_; + ParamType current_value_; + }; // class CartesianProductGenerator10::Iterator + + // No implementation - assignment is unsupported. + void operator=(const CartesianProductGenerator10& other); + + const ParamGenerator g1_; + const ParamGenerator g2_; + const ParamGenerator g3_; + const ParamGenerator g4_; + const ParamGenerator g5_; + const ParamGenerator g6_; + const ParamGenerator g7_; + const ParamGenerator g8_; + const ParamGenerator g9_; + const ParamGenerator g10_; +}; // class CartesianProductGenerator10 + + +// INTERNAL IMPLEMENTATION - DO NOT USE IN USER CODE. +// +// Helper classes providing Combine() with polymorphic features. They allow +// casting CartesianProductGeneratorN to ParamGenerator if T is +// convertible to U. +// +template +class CartesianProductHolder2 { + public: +CartesianProductHolder2(const Generator1& g1, const Generator2& g2) + : g1_(g1), g2_(g2) {} + template + operator ParamGenerator< ::std::tr1::tuple >() const { + return ParamGenerator< ::std::tr1::tuple >( + new CartesianProductGenerator2( + static_cast >(g1_), + static_cast >(g2_))); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const CartesianProductHolder2& other); + + const Generator1 g1_; + const Generator2 g2_; +}; // class CartesianProductHolder2 + +template +class CartesianProductHolder3 { + public: +CartesianProductHolder3(const Generator1& g1, const Generator2& g2, + const Generator3& g3) + : g1_(g1), g2_(g2), g3_(g3) {} + template + operator ParamGenerator< ::std::tr1::tuple >() const { + return ParamGenerator< ::std::tr1::tuple >( + new CartesianProductGenerator3( + static_cast >(g1_), + static_cast >(g2_), + static_cast >(g3_))); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const CartesianProductHolder3& other); + + const Generator1 g1_; + const Generator2 g2_; + const Generator3 g3_; +}; // class CartesianProductHolder3 + +template +class CartesianProductHolder4 { + public: +CartesianProductHolder4(const Generator1& g1, const Generator2& g2, + const Generator3& g3, const Generator4& g4) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4) {} + template + operator ParamGenerator< ::std::tr1::tuple >() const { + return ParamGenerator< ::std::tr1::tuple >( + new CartesianProductGenerator4( + static_cast >(g1_), + static_cast >(g2_), + static_cast >(g3_), + static_cast >(g4_))); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const CartesianProductHolder4& other); + + const Generator1 g1_; + const Generator2 g2_; + const Generator3 g3_; + const Generator4 g4_; +}; // class CartesianProductHolder4 + +template +class CartesianProductHolder5 { + public: +CartesianProductHolder5(const Generator1& g1, const Generator2& g2, + const Generator3& g3, const Generator4& g4, const Generator5& g5) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5) {} + template + operator ParamGenerator< ::std::tr1::tuple >() const { + return ParamGenerator< ::std::tr1::tuple >( + new CartesianProductGenerator5( + static_cast >(g1_), + static_cast >(g2_), + static_cast >(g3_), + static_cast >(g4_), + static_cast >(g5_))); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const CartesianProductHolder5& other); + + const Generator1 g1_; + const Generator2 g2_; + const Generator3 g3_; + const Generator4 g4_; + const Generator5 g5_; +}; // class CartesianProductHolder5 + +template +class CartesianProductHolder6 { + public: +CartesianProductHolder6(const Generator1& g1, const Generator2& g2, + const Generator3& g3, const Generator4& g4, const Generator5& g5, + const Generator6& g6) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6) {} + template + operator ParamGenerator< ::std::tr1::tuple >() const { + return ParamGenerator< ::std::tr1::tuple >( + new CartesianProductGenerator6( + static_cast >(g1_), + static_cast >(g2_), + static_cast >(g3_), + static_cast >(g4_), + static_cast >(g5_), + static_cast >(g6_))); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const CartesianProductHolder6& other); + + const Generator1 g1_; + const Generator2 g2_; + const Generator3 g3_; + const Generator4 g4_; + const Generator5 g5_; + const Generator6 g6_; +}; // class CartesianProductHolder6 + +template +class CartesianProductHolder7 { + public: +CartesianProductHolder7(const Generator1& g1, const Generator2& g2, + const Generator3& g3, const Generator4& g4, const Generator5& g5, + const Generator6& g6, const Generator7& g7) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7) {} + template + operator ParamGenerator< ::std::tr1::tuple >() const { + return ParamGenerator< ::std::tr1::tuple >( + new CartesianProductGenerator7( + static_cast >(g1_), + static_cast >(g2_), + static_cast >(g3_), + static_cast >(g4_), + static_cast >(g5_), + static_cast >(g6_), + static_cast >(g7_))); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const CartesianProductHolder7& other); + + const Generator1 g1_; + const Generator2 g2_; + const Generator3 g3_; + const Generator4 g4_; + const Generator5 g5_; + const Generator6 g6_; + const Generator7 g7_; +}; // class CartesianProductHolder7 + +template +class CartesianProductHolder8 { + public: +CartesianProductHolder8(const Generator1& g1, const Generator2& g2, + const Generator3& g3, const Generator4& g4, const Generator5& g5, + const Generator6& g6, const Generator7& g7, const Generator8& g8) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), + g8_(g8) {} + template + operator ParamGenerator< ::std::tr1::tuple >() const { + return ParamGenerator< ::std::tr1::tuple >( + new CartesianProductGenerator8( + static_cast >(g1_), + static_cast >(g2_), + static_cast >(g3_), + static_cast >(g4_), + static_cast >(g5_), + static_cast >(g6_), + static_cast >(g7_), + static_cast >(g8_))); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const CartesianProductHolder8& other); + + const Generator1 g1_; + const Generator2 g2_; + const Generator3 g3_; + const Generator4 g4_; + const Generator5 g5_; + const Generator6 g6_; + const Generator7 g7_; + const Generator8 g8_; +}; // class CartesianProductHolder8 + +template +class CartesianProductHolder9 { + public: +CartesianProductHolder9(const Generator1& g1, const Generator2& g2, + const Generator3& g3, const Generator4& g4, const Generator5& g5, + const Generator6& g6, const Generator7& g7, const Generator8& g8, + const Generator9& g9) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), + g9_(g9) {} + template + operator ParamGenerator< ::std::tr1::tuple >() const { + return ParamGenerator< ::std::tr1::tuple >( + new CartesianProductGenerator9( + static_cast >(g1_), + static_cast >(g2_), + static_cast >(g3_), + static_cast >(g4_), + static_cast >(g5_), + static_cast >(g6_), + static_cast >(g7_), + static_cast >(g8_), + static_cast >(g9_))); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const CartesianProductHolder9& other); + + const Generator1 g1_; + const Generator2 g2_; + const Generator3 g3_; + const Generator4 g4_; + const Generator5 g5_; + const Generator6 g6_; + const Generator7 g7_; + const Generator8 g8_; + const Generator9 g9_; +}; // class CartesianProductHolder9 + +template +class CartesianProductHolder10 { + public: +CartesianProductHolder10(const Generator1& g1, const Generator2& g2, + const Generator3& g3, const Generator4& g4, const Generator5& g5, + const Generator6& g6, const Generator7& g7, const Generator8& g8, + const Generator9& g9, const Generator10& g10) + : g1_(g1), g2_(g2), g3_(g3), g4_(g4), g5_(g5), g6_(g6), g7_(g7), g8_(g8), + g9_(g9), g10_(g10) {} + template + operator ParamGenerator< ::std::tr1::tuple >() const { + return ParamGenerator< ::std::tr1::tuple >( + new CartesianProductGenerator10( + static_cast >(g1_), + static_cast >(g2_), + static_cast >(g3_), + static_cast >(g4_), + static_cast >(g5_), + static_cast >(g6_), + static_cast >(g7_), + static_cast >(g8_), + static_cast >(g9_), + static_cast >(g10_))); + } + + private: + // No implementation - assignment is unsupported. + void operator=(const CartesianProductHolder10& other); + + const Generator1 g1_; + const Generator2 g2_; + const Generator3 g3_; + const Generator4 g4_; + const Generator5 g5_; + const Generator6 g6_; + const Generator7 g7_; + const Generator8 g8_; + const Generator9 g9_; + const Generator10 g10_; +}; // class CartesianProductHolder10 + +# endif // GTEST_HAS_COMBINE + +} // namespace internal +} // namespace testing + +#endif // GTEST_HAS_PARAM_TEST + +#endif // GTEST_INCLUDE_GTEST_INTERNAL_GTEST_PARAM_UTIL_GENERATED_H_ diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/idl/settings.gradle b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/idl/settings.gradle new file mode 100644 index 0000000..6022d09 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/idl/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'idl' diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/prebuilt/3rd-party-lib/util/src/util/cpp/util.cpp b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/prebuilt/3rd-party-lib/util/src/util/cpp/util.cpp new file mode 100644 index 0000000..4c3e406 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/prebuilt/3rd-party-lib/util/src/util/cpp/util.cpp @@ -0,0 +1,10 @@ +#include +#include "util.h" + +void LIB_FUNC printBuildType () { +#ifdef DEBUG + std::cout << "Util build type: DEBUG" << std::endl; +#else + std::cout << "Util build type: RELEASE" << std::endl; +#endif +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/sourceset-variant/src/main/windows/platform-windows.c b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/sourceset-variant/src/main/windows/platform-windows.c new file mode 100644 index 0000000..16eec39 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/sourceset-variant/src/main/windows/platform-windows.c @@ -0,0 +1,10 @@ +#include "platform.h" + +const char* platform_name = "Windows"; + +int max_path_length() { return 260; } + +// 640K ought to be enough for anybody. +unsigned long long max_memory() { return KB(640); } + +int is_posix_like() { return 0; } diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/windows-resources/src/hello/cpp/hello.cpp b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/windows-resources/src/hello/cpp/hello.cpp new file mode 100644 index 0000000..b95de70 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/native-binaries/windows-resources/src/hello/cpp/hello.cpp @@ -0,0 +1,19 @@ +#include +#include +#include +#include "hello.h" +#include "resources.h" + +std::string LoadStringFromResource(UINT stringID) +{ + HINSTANCE instance = GetModuleHandle("hello"); + WCHAR * pBuf = NULL; + int len = LoadStringW(instance, stringID, reinterpret_cast(&pBuf), 0); + std::wstring wide = std::wstring(pBuf, len); + return std::string(wide.begin(), wide.end()); +} + +void hello() { + std::string hello = LoadStringFromResource(IDS_HELLO); + std::cout << hello << std::endl; +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/osgi/kotlin/src/main/groovy/org/gradle/GradleActivator.groovy b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/osgi/kotlin/src/main/groovy/org/gradle/GradleActivator.groovy new file mode 100644 index 0000000..15f0e0d --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/osgi/kotlin/src/main/groovy/org/gradle/GradleActivator.groovy @@ -0,0 +1,14 @@ +package org.gradle + +import org.osgi.framework.BundleActivator +import org.osgi.framework.BundleContext + +public class GradleActivator implements BundleActivator { + + public void start(BundleContext context) { + println "Hello from a Groovy Gradle Activator" + } + + public void stop(BundleContext context) { + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/play/custom-assets/public/javascripts/hello.js b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/play/custom-assets/public/javascripts/hello.js new file mode 100644 index 0000000..209fbee --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/play/custom-assets/public/javascripts/hello.js @@ -0,0 +1,3 @@ +if (window.console) { + console.log("Welcome to your Play application's JavaScript!"); +} \ No newline at end of file diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/play/custom-distribution/app/views/main.scala.html b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/play/custom-distribution/app/views/main.scala.html new file mode 100644 index 0000000..5025aa5 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/play/custom-distribution/app/views/main.scala.html @@ -0,0 +1,15 @@ +@(title: String)(content: Html) + + + + + + @title + + + + + + @content + + diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/plugins/consuming/ivy-repo/org.gradle.sample.goodbye/org.gradle.sample.goodbye.gradle.plugin/1.0.0/ivy-1.0.0.xml b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/plugins/consuming/ivy-repo/org.gradle.sample.goodbye/org.gradle.sample.goodbye.gradle.plugin/1.0.0/ivy-1.0.0.xml new file mode 100644 index 0000000..55a4385 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/plugins/consuming/ivy-repo/org.gradle.sample.goodbye/org.gradle.sample.goodbye.gradle.plugin/1.0.0/ivy-1.0.0.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/plugins/consuming/maven-repo/org/gradle/sample/sample-plugins/maven-metadata.xml.sha1 b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/plugins/consuming/maven-repo/org/gradle/sample/sample-plugins/maven-metadata.xml.sha1 new file mode 100644 index 0000000..b9abc87 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/plugins/consuming/maven-repo/org/gradle/sample/sample-plugins/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +0cd579be7f46939d6b2802936f2663d2ce2bdb6f \ No newline at end of file diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/plugins/multiproject/maven-repo/org/gradle/sample/goodbye/org.gradle.sample.goodbye.gradle.plugin/maven-metadata.xml.sha1 b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/plugins/multiproject/maven-repo/org/gradle/sample/goodbye/org.gradle.sample.goodbye.gradle.plugin/maven-metadata.xml.sha1 new file mode 100644 index 0000000..4a29b7b --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/plugins/multiproject/maven-repo/org/gradle/sample/goodbye/org.gradle.sample.goodbye.gradle.plugin/maven-metadata.xml.sha1 @@ -0,0 +1 @@ +dc60095bd585c5bce057c5c4ff3aa29a568247b5 \ No newline at end of file diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/scala/crossCompilation/groovy/src/main/java/org/gradle/sample/Named.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/scala/crossCompilation/groovy/src/main/java/org/gradle/sample/Named.java new file mode 100644 index 0000000..949e230 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/scala/crossCompilation/groovy/src/main/java/org/gradle/sample/Named.java @@ -0,0 +1,5 @@ +package org.gradle.sample; + +public interface Named { + String getName(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/scala/crossCompilation/kotlin/src/main/scala/org/gradle/sample/Person.scala b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/scala/crossCompilation/kotlin/src/main/scala/org/gradle/sample/Person.scala new file mode 100644 index 0000000..bd810ec --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/scala/crossCompilation/kotlin/src/main/scala/org/gradle/sample/Person.scala @@ -0,0 +1,5 @@ +package org.gradle.sample + +class Person(val name: String) extends Named { + override def getName: String = name +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/signing/gnupg-signatory/kotlin/gradle.properties b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/signing/gnupg-signatory/kotlin/gradle.properties new file mode 100644 index 0000000..2d7795a --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/signing/gnupg-signatory/kotlin/gradle.properties @@ -0,0 +1,8 @@ +// tag::user-properties[] +signing.gnupg.executable=gpg +signing.gnupg.useLegacyGpg=true +signing.gnupg.homeDir=gnupg-home +signing.gnupg.optionsFile=gnupg-home/gpg.conf +signing.gnupg.keyName=24875D73 +signing.gnupg.passphrase=gradle +// end::user-properties[] diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/signing/maven-publish/kotlin/settings.gradle.kts b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/signing/maven-publish/kotlin/settings.gradle.kts new file mode 100644 index 0000000..1788ef8 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/signing/maven-publish/kotlin/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "maven-publish" diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/testKit/gradleRunner/automaticClasspathInjectionCustomTestSourceSet/kotlin/build.gradle.kts b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/testKit/gradleRunner/automaticClasspathInjectionCustomTestSourceSet/kotlin/build.gradle.kts new file mode 100644 index 0000000..6fdf259 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/testKit/gradleRunner/automaticClasspathInjectionCustomTestSourceSet/kotlin/build.gradle.kts @@ -0,0 +1,42 @@ +// tag::custom-test-source-set[] +plugins { + groovy + `java-gradle-plugin` +} + +sourceSets { + create("functionalTest") { + withConvention(GroovySourceSet::class) { + groovy { + srcDir(file("src/functionalTest/groovy")) + } + } + resources { + srcDir(file("src/functionalTest/resources")) + } + compileClasspath += sourceSets.main.get().output + configurations.testRuntimeClasspath + runtimeClasspath += output + compileClasspath + } +} + +tasks.register("functionalTest") { + testClassesDirs = sourceSets["functionalTest"].output.classesDirs + classpath = sourceSets["functionalTest"].runtimeClasspath +} + +tasks.check { dependsOn(tasks["functionalTest"]) } + +gradlePlugin { + testSourceSets(sourceSets["functionalTest"]) +} + +dependencies { + "functionalTestImplementation"("org.spockframework:spock-core:1.1-groovy-2.4") { + exclude(module = "groovy-all") + } +} +// end::custom-test-source-set[] + +repositories { + mavenCentral() +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/testKit/gradleRunner/testKitFunctionalTestSpockBuildCache/src/main/groovy/org/gradle/sample/MyCacheableTask.groovy b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/testKit/gradleRunner/testKitFunctionalTestSpockBuildCache/src/main/groovy/org/gradle/sample/MyCacheableTask.groovy new file mode 100644 index 0000000..d6ad935 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/testKit/gradleRunner/testKitFunctionalTestSpockBuildCache/src/main/groovy/org/gradle/sample/MyCacheableTask.groovy @@ -0,0 +1,39 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.sample + +import org.gradle.api.DefaultTask +import org.gradle.api.tasks.CacheableTask +import org.gradle.api.tasks.InputFile +import org.gradle.api.tasks.OutputFile +import org.gradle.api.tasks.PathSensitive +import org.gradle.api.tasks.PathSensitivity +import org.gradle.api.tasks.TaskAction + +@CacheableTask +class MyCacheableTask extends DefaultTask { + @InputFile + @PathSensitive(PathSensitivity.NONE) + File inputFile + @OutputFile + File outputFile + + @TaskAction + void doSomething() { + outputFile.text = inputFile.text + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/testing/junit/categories/groovy/settings.gradle b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/testing/junit/categories/groovy/settings.gradle new file mode 100644 index 0000000..9fb8259 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/testing/junit/categories/groovy/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'junit' diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/testing/junit/categories/groovy/src/test/java/org/gradle/junit/SimpleJUnitTest.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/testing/junit/categories/groovy/src/test/java/org/gradle/junit/SimpleJUnitTest.java new file mode 100644 index 0000000..03588b4 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/testing/junit/categories/groovy/src/test/java/org/gradle/junit/SimpleJUnitTest.java @@ -0,0 +1,27 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.junit; + +import org.junit.Test; +import java.lang.System; + +public class SimpleJUnitTest { + @Test + public void ok() { + System.out.println("hello from SimpleJUnitTest."); + } +} \ No newline at end of file diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/testing/junitplatform/mix/groovy/build.gradle b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/testing/junitplatform/mix/groovy/build.gradle new file mode 100644 index 0000000..e1bd350 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/testing/junitplatform/mix/groovy/build.gradle @@ -0,0 +1,35 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +plugins { + id 'java' +} + +repositories { + mavenCentral() +} + +// tag::vintage-dependencies[] +dependencies { + testImplementation 'org.junit.jupiter:junit-jupiter-api:5.1.0' + testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.1.0' + testCompileOnly 'junit:junit:4.12' + testRuntimeOnly 'org.junit.vintage:junit-vintage-engine:5.1.0' +} +// end::vintage-dependencies[] + +test { + useJUnitPlatform() +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/testing/testng/preserveorder/groovy/build.gradle b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/testing/testng/preserveorder/groovy/build.gradle new file mode 100644 index 0000000..112a18a --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/testing/testng/preserveorder/groovy/build.gradle @@ -0,0 +1,39 @@ +plugins { + id 'java' +} + +repositories { + mavenCentral() +} + +dependencies { + testCompile 'org.testng:testng:6.9.4' +} + +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// tag::test-config[] +test { + useTestNG { + preserveOrder true + } +} +// end::test-config[] + +test { + testLogging.showStandardStreams = true +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/toolingApi/runBuild/groovy/build.gradle b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/toolingApi/runBuild/groovy/build.gradle new file mode 100644 index 0000000..2a98681 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/toolingApi/runBuild/groovy/build.gradle @@ -0,0 +1,19 @@ +plugins { + id 'application' +} + +def toolingApiVersion = gradle.gradleVersion + +// tag::use-tooling-api[] +repositories { + maven { url 'https://repo.gradle.org/gradle/libs-releases' } +} + +dependencies { + implementation "org.gradle:gradle-tooling-api:$toolingApiVersion" + // The tooling API need an SLF4J implementation available at runtime, replace this with any other implementation + runtimeOnly 'org.slf4j:slf4j-simple:1.7.10' +} +// end::use-tooling-api[] + +mainClassName = 'org.gradle.sample.Main' diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/antMigration/fileDeps/groovy/build.gradle b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/antMigration/fileDeps/groovy/build.gradle new file mode 100644 index 0000000..ac9c3c7 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/antMigration/fileDeps/groovy/build.gradle @@ -0,0 +1,40 @@ +plugins { + id 'java' +} + +// tag::file-deps[] +repositories { + flatDir { + name = 'libs dir' + dir file('libs') // <1> + } +} + +dependencies { + implementation files('libs/our-custom.jar') // <2> + implementation ':log4j:1.2.8', ':commons-io:2.1' // <3> +} +// end::file-deps[] + +// tag::retrieve-deps[] +task retrieveRuntimeDependencies(type: Copy) { + into "$buildDir/libs" + from configurations.runtimeClasspath +} +// end::retrieve-deps[] + +// tag::properties[] +ext { + tmpDistDir = file("$buildDir/dist") +} + +task javadocJar(type: Jar) { + from javadoc // <1> + classifier = 'javadoc' +} + +task unpackJavadocs(type: Copy) { + from zipTree(javadocJar.archivePath) // <2> + into tmpDistDir // <3> +} +// end::properties[] diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/antMigration/importBuild/kotlin/settings.gradle.kts b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/antMigration/importBuild/kotlin/settings.gradle.kts new file mode 100644 index 0000000..92ab11c --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/antMigration/importBuild/kotlin/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "ant-import-build-sample" diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/customPlugins/customPlugin/kotlin/build.gradle.kts b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/customPlugins/customPlugin/kotlin/build.gradle.kts new file mode 100644 index 0000000..07a5ce5 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/customPlugins/customPlugin/kotlin/build.gradle.kts @@ -0,0 +1,12 @@ +class GreetingPlugin : Plugin { + override fun apply(project: Project) { + project.task("hello") { + doLast { + println("Hello from the GreetingPlugin") + } + } + } +} + +// Apply the plugin +apply() diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/dependencyManagement/customizingResolution/conditionalSubstitutionRule/kotlin/repo/org.example/project2/1.0/ivy-1.0.xml b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/dependencyManagement/customizingResolution/conditionalSubstitutionRule/kotlin/repo/org.example/project2/1.0/ivy-1.0.xml new file mode 100644 index 0000000..03df96e --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/dependencyManagement/customizingResolution/conditionalSubstitutionRule/kotlin/repo/org.example/project2/1.0/ivy-1.0.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/dependencyManagement/definingUsingConfigurations/custom/groovy/src/main/webapp/hello.jsp b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/dependencyManagement/definingUsingConfigurations/custom/groovy/src/main/webapp/hello.jsp new file mode 100644 index 0000000..d410e37 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/dependencyManagement/definingUsingConfigurations/custom/groovy/src/main/webapp/hello.jsp @@ -0,0 +1,18 @@ + +Randomizer + +<% + double num = Math.random(); + if (num > 0.5) { +%> +

It's your lucky day!

(<%= num %>)

+<% +} else { +%> +

Sorry...bad day

(<%= num %>)

+<% + } +%> +

Try Again

+ + diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/dependencyManagement/managingTransitiveDependencies/excludeForConfiguration/kotlin/settings.gradle.kts b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/dependencyManagement/managingTransitiveDependencies/excludeForConfiguration/kotlin/settings.gradle.kts new file mode 100644 index 0000000..9413c23 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/dependencyManagement/managingTransitiveDependencies/excludeForConfiguration/kotlin/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "excluding-transitive-dependencies-for-configuration" diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/dependencyManagement/managingTransitiveDependencies/excludeForDependency/groovy/settings.gradle b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/dependencyManagement/managingTransitiveDependencies/excludeForDependency/groovy/settings.gradle new file mode 100644 index 0000000..d330222 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/dependencyManagement/managingTransitiveDependencies/excludeForDependency/groovy/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'excluding-transitive-dependencies-for-dependency' diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/dependencyManagement/managingTransitiveDependencies/versionsWithConstraints/kotlin/build.gradle.kts b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/dependencyManagement/managingTransitiveDependencies/versionsWithConstraints/kotlin/build.gradle.kts new file mode 100644 index 0000000..b36510c --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/dependencyManagement/managingTransitiveDependencies/versionsWithConstraints/kotlin/build.gradle.kts @@ -0,0 +1,26 @@ +plugins { + `java-library` +} + +repositories { + mavenCentral() +} + +// tag::dependency-constraints[] +dependencies { + implementation("org.apache.httpcomponents:httpclient") + constraints { + implementation("org.apache.httpcomponents:httpclient:4.5.3") { + because("previous versions have a bug impacting this application") + } + implementation("commons-codec:commons-codec:1.11") { + because("version 1.9 pulled from httpclient has bugs affecting this application") + } + } +} +// end::dependency-constraints[] + +tasks.register("copyLibs") { + from(configurations.compileClasspath) + into("$buildDir/libs") +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/dependencyManagement/workingWithDependencies/iterateArtifacts/groovy/settings.gradle b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/dependencyManagement/workingWithDependencies/iterateArtifacts/groovy/settings.gradle new file mode 100644 index 0000000..ea89c02 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/dependencyManagement/workingWithDependencies/iterateArtifacts/groovy/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'iterating-artifacts' diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/files/archives/groovy/settings.gradle b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/files/archives/groovy/settings.gradle new file mode 100644 index 0000000..2c94942 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/files/archives/groovy/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'archives' diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/files/archivesWithJavaPlugin/kotlin/build.gradle.kts b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/files/archivesWithJavaPlugin/kotlin/build.gradle.kts new file mode 100644 index 0000000..7b697c7 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/files/archivesWithJavaPlugin/kotlin/build.gradle.kts @@ -0,0 +1,26 @@ +// tag::create-uber-jar-example[] +plugins { + java +} + +version = "1.0.0" + +repositories { + mavenCentral() +} + +dependencies { + implementation("commons-io:commons-io:2.6") +} + +tasks.register("uberJar") { + appendix = "uber" + + from(sourceSets.main.get().output) + + dependsOn(configurations.runtimeClasspath) + from({ + configurations.runtimeClasspath.get().filter { it.name.endsWith("jar") }.map { zipTree(it) } + }) +} +// end::create-uber-jar-example[] diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/files/copy/kotlin/src/main/webapp/web.xml b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/files/copy/kotlin/src/main/webapp/web.xml new file mode 100644 index 0000000..a7f6fc4 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/files/copy/kotlin/src/main/webapp/web.xml @@ -0,0 +1,13 @@ + + + hello + org.gradle.sample.HelloServlet + + + + hello + /hello + + diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/files/misc/groovy/shared/config.xml b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/files/misc/groovy/shared/config.xml new file mode 100644 index 0000000..e69de29 diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/files/misc/kotlin/settings.gradle.kts b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/files/misc/kotlin/settings.gradle.kts new file mode 100644 index 0000000..3aa1c31 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/files/misc/kotlin/settings.gradle.kts @@ -0,0 +1,3 @@ +include("project2") + +rootProject.name = "misc" diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/files/sampleJavaProject/kotlin/settings.gradle.kts b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/files/sampleJavaProject/kotlin/settings.gradle.kts new file mode 100644 index 0000000..256b53e --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/files/sampleJavaProject/kotlin/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "my-java-project" diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/java/basic/groovy/src/intTest/resources/org/gradle/test-resource.xml b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/java/basic/groovy/src/intTest/resources/org/gradle/test-resource.xml new file mode 100644 index 0000000..c833a65 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/java/basic/groovy/src/intTest/resources/org/gradle/test-resource.xml @@ -0,0 +1 @@ + diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/java/basic/kotlin/src/test/resources/org/gradle/test-resource.xml b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/java/basic/kotlin/src/test/resources/org/gradle/test-resource.xml new file mode 100644 index 0000000..c833a65 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/java/basic/kotlin/src/test/resources/org/gradle/test-resource.xml @@ -0,0 +1 @@ + diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/multiproject/dependencies/java/kotlin/api/src/main/resources/org/gradle/resource.txt b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/multiproject/dependencies/java/kotlin/api/src/main/resources/org/gradle/resource.txt new file mode 100644 index 0000000..e69de29 diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/multiproject/dependencies/java/kotlin/api/src/test/java/org/gradle/PersonTest.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/multiproject/dependencies/java/kotlin/api/src/test/java/org/gradle/PersonTest.java new file mode 100644 index 0000000..5c0d2ea --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/multiproject/dependencies/java/kotlin/api/src/test/java/org/gradle/PersonTest.java @@ -0,0 +1,9 @@ +package org.gradle; + +import org.junit.Test; + +public class PersonTest { + @Test + public void ok() { + } +} \ No newline at end of file diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/multiproject/dependencies/webDist/kotlin/settings.gradle.kts b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/multiproject/dependencies/webDist/kotlin/settings.gradle.kts new file mode 100644 index 0000000..fa58efa --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/multiproject/dependencies/webDist/kotlin/settings.gradle.kts @@ -0,0 +1,2 @@ +rootProject.name = "webDist" +include("date", "hello") diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/multiproject/firstExample/water/kotlin/build.gradle.kts b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/multiproject/firstExample/water/kotlin/build.gradle.kts new file mode 100644 index 0000000..e2c36e0 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/multiproject/firstExample/water/kotlin/build.gradle.kts @@ -0,0 +1,5 @@ +val cl = Action { println("I'm ${this.project.name}") } +tasks.register("hello") { doLast(cl) } +project(":bluewhale") { + tasks.register("hello") { doLast(cl) } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/multiproject/firstExample/water/kotlin/settings.gradle.kts b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/multiproject/firstExample/water/kotlin/settings.gradle.kts new file mode 100644 index 0000000..4015bcd --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/multiproject/firstExample/water/kotlin/settings.gradle.kts @@ -0,0 +1,2 @@ +rootProject.name = "water" +include("bluewhale") diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/multiproject/partialTasks/water/kotlin/krill/build.gradle.kts b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/multiproject/partialTasks/water/kotlin/krill/build.gradle.kts new file mode 100644 index 0000000..dc34b47 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/multiproject/partialTasks/water/kotlin/krill/build.gradle.kts @@ -0,0 +1,12 @@ +extra["arctic"] = true +tasks.named("hello") { + doLast { + println("- The weight of my species in summer is twice as heavy as all human beings.") + } +} + +tasks.register("distanceToIceberg") { + doLast { + println("5 nautical miles") + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/organizingGradleProjects/customGradleDistribution/buildSrc/src/main/groovy/org/gradle/distribution/DownloadGradle.groovy b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/organizingGradleProjects/customGradleDistribution/buildSrc/src/main/groovy/org/gradle/distribution/DownloadGradle.groovy new file mode 100644 index 0000000..639a604 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/organizingGradleProjects/customGradleDistribution/buildSrc/src/main/groovy/org/gradle/distribution/DownloadGradle.groovy @@ -0,0 +1,34 @@ +package org.gradle.distribution + +import org.gradle.api.DefaultTask +import org.gradle.api.tasks.* + +class DownloadGradle extends DefaultTask { + @Input + String gradleVersion + + @Input + String gradleDownloadBase = 'http://services.gradle.org/distributions' + + @TaskAction + void doDownloadGradle() { + destinationFile.withOutputStream { it << downloadUrl.newInputStream() } + } + + URL getDownloadUrl() { + new URL("$gradleDownloadBase/$downloadFileName") + } + + String getDistributionNameBase() { + "gradle-$gradleVersion" + } + + String getDownloadFileName() { + "$distributionNameBase-bin.zip" + } + + @OutputFile + File getDestinationFile() { + new File(project.file("gradle-downloads"), downloadFileName) + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tasks/configureUsingBlock/groovy/build.gradle b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tasks/configureUsingBlock/groovy/build.gradle new file mode 100644 index 0000000..3087d1f --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tasks/configureUsingBlock/groovy/build.gradle @@ -0,0 +1,12 @@ +// tag::declare-task[] +task myCopy(type: Copy) +// end::declare-task[] + +// tag::configure[] +// Configure task using Groovy dynamic task configuration block +myCopy { + from 'resources' + into 'target' +} +myCopy.include('**/*.txt', '**/*.xml', '**/*.properties') +// end::configure[] diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tasks/customTaskWithProperty/groovy/build.gradle b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tasks/customTaskWithProperty/groovy/build.gradle new file mode 100644 index 0000000..a235da0 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tasks/customTaskWithProperty/groovy/build.gradle @@ -0,0 +1,18 @@ +// tag::add-property[] +class GreetingTask extends DefaultTask { + String greeting = 'hello from GreetingTask' + + @TaskAction + def greet() { + println greeting + } +} + +// Use the default greeting +task hello(type: GreetingTask) + +// Customize the greeting +task greeting(type: GreetingTask) { + greeting = 'greetings from GreetingTask' +} +// end::add-property[] diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tutorial/antLoadfileWithMethod/kotlin/settings.gradle.kts b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tutorial/antLoadfileWithMethod/kotlin/settings.gradle.kts new file mode 100644 index 0000000..966f680 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tutorial/antLoadfileWithMethod/kotlin/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "ant-load-file-withh-method" diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tutorial/configureObject/groovy/build.gradle b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tutorial/configureObject/groovy/build.gradle new file mode 100644 index 0000000..f6e5ee3 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tutorial/configureObject/groovy/build.gradle @@ -0,0 +1,12 @@ +import java.text.FieldPosition + +task configure { + doLast { + def pos = configure(new FieldPosition(10)) { + beginIndex = 1 + endIndex = 5 + } + println pos.beginIndex + println pos.endIndex + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tutorial/count/kotlin/settings.gradle.kts b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tutorial/count/kotlin/settings.gradle.kts new file mode 100644 index 0000000..503e3a8 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tutorial/count/kotlin/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "count" diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tutorial/defaultTasks/kotlin/settings.gradle.kts b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tutorial/defaultTasks/kotlin/settings.gradle.kts new file mode 100644 index 0000000..923eee0 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tutorial/defaultTasks/kotlin/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "default-tasks" diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tutorial/extraProperties/kotlin/build.gradle.kts b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tutorial/extraProperties/kotlin/build.gradle.kts new file mode 100644 index 0000000..0f0509c --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tutorial/extraProperties/kotlin/build.gradle.kts @@ -0,0 +1,47 @@ +// tag::extraProperties[] +plugins { + java +} +// end::extraProperties[] + + +// tag::taskProperties[] +tasks.register("myTask") { + extra["myProperty"] = "myValue" +} + +tasks.register("printTaskProperties") { + doLast { + println(tasks["myTask"].extra["myProperty"]) + } +} +// end::taskProperties[] + + +// tag::extraProperties[] + +val springVersion by extra("3.1.0.RELEASE") +val emailNotification by extra { "build@master.org" } + +sourceSets.all { extra["purpose"] = null } + +sourceSets { + main { + extra["purpose"] = "production" + } + test { + extra["purpose"] = "test" + } + create("plugin") { + extra["purpose"] = "production" + } +} + +tasks.register("printProperties") { + doLast { + println(springVersion) + println(emailNotification) + sourceSets.matching { it.extra["purpose"] == "production" }.forEach { println(it.name) } + } +} +// end::extraProperties[] diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tutorial/mkdirTrap/kotlin/settings.gradle.kts b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tutorial/mkdirTrap/kotlin/settings.gradle.kts new file mode 100644 index 0000000..e95fa99 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tutorial/mkdirTrap/kotlin/settings.gradle.kts @@ -0,0 +1 @@ +rootProject.name = "mkdir-trap" diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tutorial/taskOnlyIf/kotlin/build.gradle.kts b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tutorial/taskOnlyIf/kotlin/build.gradle.kts new file mode 100644 index 0000000..b7959f2 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/userguide/tutorial/taskOnlyIf/kotlin/build.gradle.kts @@ -0,0 +1,9 @@ +val hello by tasks.registering { + doLast { + println("hello world") + } +} + +hello { + onlyIf { !project.hasProperty("skipHello") } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/webApplication/customized/groovy/lib/otherLib-1.0.jar b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/webApplication/customized/groovy/lib/otherLib-1.0.jar new file mode 100644 index 0000000..c75ef21 Binary files /dev/null and b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/webApplication/customized/groovy/lib/otherLib-1.0.jar differ diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/workerApi/noIsolation/kotlin/sources/hemingway.txt b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/workerApi/noIsolation/kotlin/sources/hemingway.txt new file mode 100644 index 0000000..9f4bc54 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/samples/workerApi/noIsolation/kotlin/sources/hemingway.txt @@ -0,0 +1,3 @@ +for whom the bell tolls +the sun also rises +a farewell to arms diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/announce/org/gradle/api/plugins/announce/internal/NotifySend.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/announce/org/gradle/api/plugins/announce/internal/NotifySend.java new file mode 100644 index 0000000..bd91311 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/announce/org/gradle/api/plugins/announce/internal/NotifySend.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.plugins.announce.internal; + +import org.gradle.api.Action; +import org.gradle.api.internal.ProcessOperations; +import org.gradle.api.plugins.announce.Announcer; +import org.gradle.internal.os.OperatingSystem; +import org.gradle.process.ExecSpec; + +import java.io.File; + +/** + * This class wraps the Ubuntu Notify Send functionality. + */ +public class NotifySend implements Announcer { + private final IconProvider iconProvider; + private final ProcessOperations processOperations; + + public NotifySend(ProcessOperations processOperations, IconProvider iconProvider) { + this.processOperations = processOperations; + this.iconProvider = iconProvider; + } + + @Override + public void send(final String title, final String message) { + final File exe = OperatingSystem.current().findInPath("notify-send"); + if (exe == null) { + throw new AnnouncerUnavailableException("Could not find 'notify-send' in the path."); + } + + processOperations.exec(new Action() { + @Override + public void execute(ExecSpec execSpec) { + execSpec.executable(exe); + File icon = iconProvider.getIcon(32, 32); + if (icon != null) { + execSpec.args("-i", icon.getAbsolutePath()); + } + execSpec.args("--hint=int:transient:1"); + execSpec.args(title, message); + } + + }); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services-groovy/org/gradle/internal/metaobject/CompositeDynamicObject.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services-groovy/org/gradle/internal/metaobject/CompositeDynamicObject.java new file mode 100644 index 0000000..d60823a --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services-groovy/org/gradle/internal/metaobject/CompositeDynamicObject.java @@ -0,0 +1,105 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.internal.metaobject; + +import java.util.HashMap; +import java.util.Map; + +/** + * Presents a {@link DynamicObject} view of multiple objects at once. + * + * Can be used to provide a dynamic view of an object with enhancements. + */ +public abstract class CompositeDynamicObject extends AbstractDynamicObject { + + private static final DynamicObject[] NONE = new DynamicObject[0]; + + private DynamicObject[] objects = NONE; + private DynamicObject[] updateObjects = NONE; + + protected void setObjects(DynamicObject... objects) { + this.objects = objects; + updateObjects = objects; + } + + protected void setObjectsForUpdate(DynamicObject... objects) { + this.updateObjects = objects; + } + + @Override + public boolean hasProperty(String name) { + for (DynamicObject object : objects) { + if (object.hasProperty(name)) { + return true; + } + } + return false; + } + + @Override + public DynamicInvokeResult tryGetProperty(String name) { + for (DynamicObject object : objects) { + DynamicInvokeResult result = object.tryGetProperty(name); + if (result.isFound()) { + return result; + } + } + return DynamicInvokeResult.notFound(); + } + + @Override + public DynamicInvokeResult trySetProperty(String name, Object value) { + for (DynamicObject object : updateObjects) { + DynamicInvokeResult result = object.trySetProperty(name, value); + if (result.isFound()) { + return result; + } + } + return DynamicInvokeResult.notFound(); + } + + @Override + public Map getProperties() { + Map properties = new HashMap(); + for (int i = objects.length - 1; i >= 0; i--) { + DynamicObject object = objects[i]; + properties.putAll(object.getProperties()); + } + properties.put("properties", properties); + return properties; + } + + @Override + public boolean hasMethod(String name, Object... arguments) { + for (DynamicObject object : objects) { + if (object.hasMethod(name, arguments)) { + return true; + } + } + return false; + } + + @Override + public DynamicInvokeResult tryInvokeMethod(String name, Object... arguments) { + for (DynamicObject object : objects) { + DynamicInvokeResult result = object.tryInvokeMethod(name, arguments); + if (result.isFound()) { + return result; + } + } + return DynamicInvokeResult.notFound(); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/api/InvalidUserDataException.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/api/InvalidUserDataException.java new file mode 100644 index 0000000..0c5865f --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/api/InvalidUserDataException.java @@ -0,0 +1,33 @@ +/* + * Copyright 2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api; + +/** + * A InvalidUserDataException is thrown, if a user is providing illegal data for the build. + */ +public class InvalidUserDataException extends GradleException { + public InvalidUserDataException() { + } + + public InvalidUserDataException(String message) { + super(message); + } + + public InvalidUserDataException(String message, Throwable cause) { + super(message, cause); + } +} \ No newline at end of file diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/internal/Cast.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/internal/Cast.java new file mode 100644 index 0000000..69fbfab --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/internal/Cast.java @@ -0,0 +1,58 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal; + +import javax.annotation.Nullable; + +public abstract class Cast { + + /** + * Casts the given object to the given type, providing a better error message than the default. + * + * The standard {@link Class#cast(Object)} method produces unsatisfactory error messages on some platforms + * when it fails. All this method does is provide a better, consistent, error message. + * + * This should be used whenever there is a chance the cast could fail. If in doubt, use this. + * + * @param outputType The type to cast the input to + * @param object The object to be cast + * @param The type to be cast to + * @param The type of the object to be vast + * @return The input object, cast to the output type + */ + @Nullable + public static O cast(Class outputType, @Nullable I object) { + try { + return outputType.cast(object); + } catch (ClassCastException e) { + throw new ClassCastException(String.format( + "Failed to cast object %s of type %s to target type %s", object, object.getClass().getName(), outputType.getName() + )); + } + } + + @SuppressWarnings("unchecked") + @Nullable + public static T uncheckedCast(@Nullable Object object) { + return (T) object; + } + + @SuppressWarnings("unchecked") + public static T uncheckedNonnullCast(Object object) { + return (T) object; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/internal/classloader/HashingClassLoaderFactory.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/internal/classloader/HashingClassLoaderFactory.java new file mode 100644 index 0000000..0fec155 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/internal/classloader/HashingClassLoaderFactory.java @@ -0,0 +1,32 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.internal.classloader; + +import org.gradle.internal.classpath.ClassPath; +import org.gradle.internal.hash.HashCode; + +import javax.annotation.Nullable; + +/** + * A {@link ClassLoaderFactory} that also stores the hash of each created classloader which is later retrievable via {@link #getHash(ClassLoader)}. + */ +public interface HashingClassLoaderFactory extends ClassLoaderFactory, ClassLoaderHasher { + /** + * Creates a {@link ClassLoader} with the given parent and classpath. Use the given hash + * code, or calculate it from the given classpath when hash code is {@code null}. + */ + ClassLoader createChildClassLoader(String name, ClassLoader parent, ClassPath classPath, @Nullable HashCode implementationHash); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/internal/concurrent/ThreadFactoryImpl.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/internal/concurrent/ThreadFactoryImpl.java new file mode 100644 index 0000000..13b854e --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/internal/concurrent/ThreadFactoryImpl.java @@ -0,0 +1,58 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.concurrent; + +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.atomic.AtomicLong; + +/** + * Provides meaningful names to threads created in a thread pool. + * And mark them as managed by Gradle. + */ +public class ThreadFactoryImpl implements ThreadFactory { + private final AtomicLong counter = new AtomicLong(); + private final String displayName; + + public ThreadFactoryImpl(String displayName) { + this.displayName = displayName; + } + + public Thread newThread(Runnable r) { + Thread thread = new Thread(new ManagedThreadRunnable(r)); + long count = counter.incrementAndGet(); + if (count == 1) { + thread.setName(displayName); + } else { + thread.setName(displayName + " Thread " + count); + } + return thread; + } + + private static class ManagedThreadRunnable implements Runnable { + private final Runnable delegate; + + private ManagedThreadRunnable(Runnable delegate) { + this.delegate = delegate; + } + + @Override + public void run() { + GradleThread.setManaged(); + delegate.run(); + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/internal/operations/RunnableBuildOperation.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/internal/operations/RunnableBuildOperation.java new file mode 100644 index 0000000..809ebb8 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/internal/operations/RunnableBuildOperation.java @@ -0,0 +1,25 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.operations; + +/** + * Represents a build operation that is directly runnable and therefore does not require a {@link BuildOperationWorker}. + */ +public interface RunnableBuildOperation extends BuildOperation { + + void run(BuildOperationContext context); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/internal/operations/notify/BuildOperationStartedNotification.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/internal/operations/notify/BuildOperationStartedNotification.java new file mode 100644 index 0000000..ecf9c5f --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/internal/operations/notify/BuildOperationStartedNotification.java @@ -0,0 +1,64 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.operations.notify; + +import org.gradle.internal.scan.UsedByScanPlugin; + +import javax.annotation.Nullable; + +/** + * A notification that a build operation has started. + * + * The methods of this interface are awkwardly prefixed to allow + * internal types to implement this interface along with other internal interfaces + * without risking method collision. + * + * @since 4.0 + */ +@UsedByScanPlugin +public interface BuildOperationStartedNotification { + + /** + * A unique, opaque, value identifying this operation. + */ + Object getNotificationOperationId(); + + /** + * The ID of the parent of this notification. + * + * Note: this is the ID of the nearest parent operation that also resulted in a notification. + * As notifications are not sent for all operations, this may be a different value to the + * parent operation ID. + * + * Null if the operation has no parent. + */ + @Nullable + Object getNotificationOperationParentId(); + + /** + * The time that the operation started. + * + * @since 4.2 + */ + long getNotificationOperationStartedTimestamp(); + + /** + * A structured object providing details about the operation to be performed. + */ + Object getNotificationOperationDetails(); + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/internal/os/OperatingSystem.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/internal/os/OperatingSystem.java new file mode 100644 index 0000000..6c06713 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/internal/os/OperatingSystem.java @@ -0,0 +1,431 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.internal.os; + +import org.gradle.internal.scan.UsedByScanPlugin; + +import javax.annotation.Nullable; +import java.io.File; +import java.util.ArrayList; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.regex.Pattern; + +import static org.gradle.internal.FileUtils.withExtension; + +public abstract class OperatingSystem { + public static final Windows WINDOWS = new Windows(); + public static final MacOs MAC_OS = new MacOs(); + public static final Solaris SOLARIS = new Solaris(); + public static final Linux LINUX = new Linux(); + public static final FreeBSD FREE_BSD = new FreeBSD(); + public static final Unix UNIX = new Unix(); + private static OperatingSystem currentOs; + private final String toStringValue; + private final String osName; + private final String osVersion; + + OperatingSystem() { + osName = System.getProperty("os.name"); + osVersion = System.getProperty("os.version"); + toStringValue = getName() + " " + getVersion() + " " + System.getProperty("os.arch"); + } + + public static OperatingSystem current() { + if (currentOs == null) { + currentOs = forName(System.getProperty("os.name")); + } + return currentOs; + } + + // for testing current() + static void resetCurrent() { + currentOs = null; + } + + public static OperatingSystem forName(String os) { + String osName = os.toLowerCase(); + if (osName.contains("windows")) { + return WINDOWS; + } else if (osName.contains("mac os x") || osName.contains("darwin") || osName.contains("osx")) { + return MAC_OS; + } else if (osName.contains("sunos") || osName.contains("solaris")) { + return SOLARIS; + } else if (osName.contains("linux")) { + return LINUX; + } else if (osName.contains("freebsd")) { + return FREE_BSD; + } else { + // Not strictly true + return UNIX; + } + } + + @Override + public String toString() { + return toStringValue; + } + + public String getName() { + return osName; + } + + public String getVersion() { + return osVersion; + } + + @UsedByScanPlugin + public boolean isWindows() { + return false; + } + + public boolean isUnix() { + return false; + } + + public boolean isMacOsX() { + return false; + } + + public boolean isLinux() { + return false; + } + + public abstract String getNativePrefix(); + + public abstract String getScriptName(String scriptPath); + + public abstract String getExecutableName(String executablePath); + + public abstract String getExecutableSuffix(); + + public abstract String getSharedLibraryName(String libraryName); + + public abstract String getSharedLibrarySuffix(); + + public abstract String getStaticLibraryName(String libraryName); + + public abstract String getStaticLibrarySuffix(); + + public abstract String getLinkLibrarySuffix(); + + public abstract String getLinkLibraryName(String libraryPath); + + @UsedByScanPlugin + public abstract String getFamilyName(); + + /** + * Locates the given executable in the system path. Returns null if not found. + */ + @Nullable + public File findInPath(String name) { + String exeName = getExecutableName(name); + if (exeName.contains(File.separator)) { + File candidate = new File(exeName); + if (candidate.isFile()) { + return candidate; + } + return null; + } + for (File dir : getPath()) { + File candidate = new File(dir, exeName); + if (candidate.isFile()) { + return candidate; + } + } + + return null; + } + + public List findAllInPath(String name) { + List all = new LinkedList(); + + for (File dir : getPath()) { + File candidate = new File(dir, name); + if (candidate.isFile()) { + all.add(candidate); + } + } + + return all; + } + + public List getPath() { + String path = System.getenv(getPathVar()); + if (path == null) { + return Collections.emptyList(); + } + List entries = new ArrayList(); + for (String entry : path.split(Pattern.quote(File.pathSeparator))) { + entries.add(new File(entry)); + } + return entries; + } + + public String getPathVar() { + return "PATH"; + } + + static class Windows extends OperatingSystem { + private final String nativePrefix; + + Windows() { + nativePrefix = resolveNativePrefix(); + } + + @Override + public boolean isWindows() { + return true; + } + + @Override + public String getFamilyName() { + return "windows"; + } + + @Override + public String getScriptName(String scriptPath) { + return withExtension(scriptPath, ".bat"); + } + + @Override + public String getExecutableSuffix() { + return ".exe"; + } + + @Override + public String getExecutableName(String executablePath) { + return withExtension(executablePath, ".exe"); + } + + @Override + public String getSharedLibrarySuffix() { + return ".dll"; + } + + @Override + public String getSharedLibraryName(String libraryPath) { + return withExtension(libraryPath, ".dll"); + } + + @Override + public String getLinkLibrarySuffix() { + return ".lib"; + } + + @Override + public String getLinkLibraryName(String libraryPath) { + return withExtension(libraryPath, ".lib"); + } + + @Override + public String getStaticLibrarySuffix() { + return ".lib"; + } + + @Override + public String getStaticLibraryName(String libraryName) { + return withExtension(libraryName, ".lib"); + } + + @Override + public String getNativePrefix() { + return nativePrefix; + } + + private String resolveNativePrefix() { + String arch = System.getProperty("os.arch"); + if ("i386".equals(arch)) { + arch = "x86"; + } + return "win32-" + arch; + } + + @Override + public String getPathVar() { + return "Path"; + } + } + + static class Unix extends OperatingSystem { + private final String nativePrefix; + + Unix() { + this.nativePrefix = resolveNativePrefix(); + } + + @Override + public String getScriptName(String scriptPath) { + return scriptPath; + } + + @Override + public String getFamilyName() { + return "unknown"; + } + + @Override + public String getExecutableSuffix() { + return ""; + } + + @Override + public String getExecutableName(String executablePath) { + return executablePath; + } + + @Override + public String getSharedLibraryName(String libraryName) { + return getLibraryName(libraryName, getSharedLibrarySuffix()); + } + + private String getLibraryName(String libraryName, String suffix) { + if (libraryName.endsWith(suffix)) { + return libraryName; + } + int pos = libraryName.lastIndexOf('/'); + if (pos >= 0) { + return libraryName.substring(0, pos + 1) + "lib" + libraryName.substring(pos + 1) + suffix; + } else { + return "lib" + libraryName + suffix; + } + } + + @Override + public String getSharedLibrarySuffix() { + return ".so"; + } + + @Override + public String getLinkLibrarySuffix() { + return getSharedLibrarySuffix(); + } + + @Override + public String getLinkLibraryName(String libraryPath) { + return getSharedLibraryName(libraryPath); + } + + @Override + public String getStaticLibrarySuffix() { + return ".a"; + } + + @Override + public String getStaticLibraryName(String libraryName) { + return getLibraryName(libraryName, ".a"); + } + + @Override + public boolean isUnix() { + return true; + } + + @Override + public String getNativePrefix() { + return nativePrefix; + } + + private String resolveNativePrefix() { + String arch = getArch(); + String osPrefix = getOsPrefix(); + osPrefix += "-" + arch; + return osPrefix; + } + + protected String getArch() { + String arch = System.getProperty("os.arch"); + if ("x86".equals(arch)) { + arch = "i386"; + } + if ("x86_64".equals(arch)) { + arch = "amd64"; + } + if ("powerpc".equals(arch)) { + arch = "ppc"; + } + return arch; + } + + protected String getOsPrefix() { + String osPrefix = getName().toLowerCase(); + int space = osPrefix.indexOf(" "); + if (space != -1) { + osPrefix = osPrefix.substring(0, space); + } + return osPrefix; + } + } + + static class MacOs extends Unix { + @Override + public boolean isMacOsX() { + return true; + } + + @Override + public String getFamilyName() { + return "os x"; + } + + @Override + public String getSharedLibrarySuffix() { + return ".dylib"; + } + + @Override + public String getNativePrefix() { + return "darwin"; + } + } + + static class Linux extends Unix { + @Override + public boolean isLinux() { + return true; + } + + @Override + public String getFamilyName() { + return "linux"; + } + } + + static class FreeBSD extends Unix { + } + + static class Solaris extends Unix { + @Override + public String getFamilyName() { + return "solaris"; + } + + @Override + protected String getOsPrefix() { + return "sunos"; + } + + @Override + protected String getArch() { + String arch = System.getProperty("os.arch"); + if (arch.equals("i386") || arch.equals("x86")) { + return "x86"; + } + return super.getArch(); + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/internal/reflect/MutablePropertyDetails.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/internal/reflect/MutablePropertyDetails.java new file mode 100644 index 0000000..3a327ee --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/base-services/org/gradle/internal/reflect/MutablePropertyDetails.java @@ -0,0 +1,53 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.reflect; + +import java.lang.reflect.Method; +import java.util.List; + +class MutablePropertyDetails implements PropertyDetails { + private final String name; + private final MethodSet getters = new MethodSet(); + private final MethodSet setters = new MethodSet(); + + MutablePropertyDetails(String name) { + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public List getGetters() { + return getters.getValues(); + } + + @Override + public List getSetters() { + return setters.getValues(); + } + + void addGetter(Method method) { + getters.add(method); + } + + void addSetter(Method method) { + setters.add(method); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-cache-http/META-INF/services/org.gradle.internal.service.scopes.PluginServiceRegistry b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-cache-http/META-INF/services/org.gradle.internal.service.scopes.PluginServiceRegistry new file mode 100644 index 0000000..356a2f5 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-cache-http/META-INF/services/org.gradle.internal.service.scopes.PluginServiceRegistry @@ -0,0 +1 @@ +org.gradle.caching.http.internal.HttpBuildCacheServiceServices diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-cache-packaging/org/gradle/caching/internal/packaging/BuildCacheEntryPacker.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-cache-packaging/org/gradle/caching/internal/packaging/BuildCacheEntryPacker.java new file mode 100644 index 0000000..caa58c4 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-cache-packaging/org/gradle/caching/internal/packaging/BuildCacheEntryPacker.java @@ -0,0 +1,71 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.caching.internal.packaging; + +import org.gradle.caching.internal.CacheableEntity; +import org.gradle.caching.internal.origin.OriginMetadata; +import org.gradle.caching.internal.origin.OriginReader; +import org.gradle.caching.internal.origin.OriginWriter; +import org.gradle.internal.fingerprint.CurrentFileCollectionFingerprint; +import org.gradle.internal.snapshot.FileSystemLocationSnapshot; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.Map; + +public interface BuildCacheEntryPacker { + PackResult pack(CacheableEntity entity, Map fingerprints, OutputStream output, OriginWriter writeOrigin) throws IOException; + + class PackResult { + private final long entries; + + public PackResult(long entries) { + this.entries = entries; + } + + public long getEntries() { + return entries; + } + } + + UnpackResult unpack(CacheableEntity entity, InputStream input, OriginReader readOrigin) throws IOException; + + class UnpackResult { + private final OriginMetadata originMetadata; + private final long entries; + private final Map snapshots; + + public UnpackResult(OriginMetadata originMetadata, long entries, Map snapshots) { + this.originMetadata = originMetadata; + this.entries = entries; + this.snapshots = snapshots; + } + + public OriginMetadata getOriginMetadata() { + return originMetadata; + } + + public long getEntries() { + return entries; + } + + public Map getSnapshots() { + return snapshots; + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-cache/org/gradle/caching/configuration/internal/DefaultBuildCacheServiceRegistration.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-cache/org/gradle/caching/configuration/internal/DefaultBuildCacheServiceRegistration.java new file mode 100644 index 0000000..d04ad3d --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-cache/org/gradle/caching/configuration/internal/DefaultBuildCacheServiceRegistration.java @@ -0,0 +1,64 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.caching.configuration.internal; + +import org.gradle.caching.BuildCacheServiceFactory; +import org.gradle.caching.configuration.BuildCache; + +public class DefaultBuildCacheServiceRegistration implements BuildCacheServiceRegistration { + private final Class> factoryType; + private final Class configurationType; + + public DefaultBuildCacheServiceRegistration(Class configurationType, Class> factoryType) { + this.factoryType = factoryType; + this.configurationType = configurationType; + } + + @Override + public Class getConfigurationType() { + return configurationType; + } + + @Override + public Class> getFactoryType() { + return factoryType; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + DefaultBuildCacheServiceRegistration that = (DefaultBuildCacheServiceRegistration) o; + + if (!factoryType.equals(that.factoryType)) { + return false; + } + return configurationType.equals(that.configurationType); + } + + @Override + public int hashCode() { + int result = factoryType.hashCode(); + result = 31 * result + configurationType.hashCode(); + return result; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-cache/org/gradle/caching/internal/controller/RootBuildCacheControllerRef.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-cache/org/gradle/caching/internal/controller/RootBuildCacheControllerRef.java new file mode 100644 index 0000000..b07ffd8 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-cache/org/gradle/caching/internal/controller/RootBuildCacheControllerRef.java @@ -0,0 +1,77 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.caching.internal.controller; + +import javax.annotation.Nullable; + +public class RootBuildCacheControllerRef { + + private BuildCacheController buildCacheController; + + public void set(BuildCacheController buildCacheController) { + // This instance ends up in build/gradle scoped services for nesteds + // We don't want to invoke close at that time. + // Instead, close it at the root. + this.buildCacheController = new CloseShieldBuildCacheController(buildCacheController); + } + + public BuildCacheController getForNonRootBuild() { + if (!isSet()) { + throw new IllegalStateException("Root build cache controller not yet assigned"); + } + + return buildCacheController; + } + + public boolean isSet() { + return buildCacheController != null; + } + + private static class CloseShieldBuildCacheController implements BuildCacheController { + private final BuildCacheController delegate; + + private CloseShieldBuildCacheController(BuildCacheController delegate) { + this.delegate = delegate; + } + + @Override + public boolean isEnabled() { + return delegate.isEnabled(); + } + + @Override + public boolean isEmitDebugLogging() { + return delegate.isEmitDebugLogging(); + } + + @Override + @Nullable + public T load(BuildCacheLoadCommand command) { + return delegate.load(command); + } + + @Override + public void store(BuildCacheStoreCommand command) { + delegate.store(command); + } + + @Override + public void close() { + } + } + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-comparison/META-INF/services/org.gradle.configuration.project.ProjectConfigureAction b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-comparison/META-INF/services/org.gradle.configuration.project.ProjectConfigureAction new file mode 100644 index 0000000..a2789fd --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-comparison/META-INF/services/org.gradle.configuration.project.ProjectConfigureAction @@ -0,0 +1 @@ +org.gradle.api.plugins.buildcomparison.outcome.internal.tooling.ToolingRegistrationAction \ No newline at end of file diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-init/org/gradle/buildinit/plugins/internal/DependenciesBuilder.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-init/org/gradle/buildinit/plugins/internal/DependenciesBuilder.java new file mode 100644 index 0000000..c97416f --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-init/org/gradle/buildinit/plugins/internal/DependenciesBuilder.java @@ -0,0 +1,25 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.buildinit.plugins.internal; + +import javax.annotation.Nullable; + +public interface DependenciesBuilder { + void projectDependency(String configuration, @Nullable String comment, String projectPath); + + void dependency(String configuration, @Nullable String comment, String... dependencies); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-init/org/gradle/buildinit/tasks/package-info.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-init/org/gradle/buildinit/tasks/package-info.java new file mode 100644 index 0000000..9a81001 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-init/org/gradle/buildinit/tasks/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Build init plugins. + */ +package org.gradle.buildinit.tasks; diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-init/org/gradle/buildinit/tasks/templates/kotlinapp/AppTest.kt.template b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-init/org/gradle/buildinit/tasks/templates/kotlinapp/AppTest.kt.template new file mode 100644 index 0000000..5f1164a --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-init/org/gradle/buildinit/tasks/templates/kotlinapp/AppTest.kt.template @@ -0,0 +1,13 @@ +/* + * This Kotlin source file was generated by the Gradle 'init' task. + */ +${packageDecl.statement} +import kotlin.test.Test +import kotlin.test.assertNotNull + +class AppTest { + @Test fun testAppHasAGreeting() { + val classUnderTest = App() + assertNotNull(classUnderTest.greeting, "app should have a greeting") + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-init/org/gradle/buildinit/tasks/templates/kotlinlibrary/LibraryTest.kt.template b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-init/org/gradle/buildinit/tasks/templates/kotlinlibrary/LibraryTest.kt.template new file mode 100644 index 0000000..460b47f --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-init/org/gradle/buildinit/tasks/templates/kotlinlibrary/LibraryTest.kt.template @@ -0,0 +1,13 @@ +/* + * This Kotlin source file was generated by the Gradle 'init' task. + */ +${packageDecl.statement} +import kotlin.test.Test +import kotlin.test.assertTrue + +class LibraryTest { + @Test fun testSomeLibraryMethod() { + val classUnderTest = Library() + assertTrue(classUnderTest.someLibraryMethod(), "someLibraryMethod should return 'true'") + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-profile/org/gradle/profile/ReportGeneratingProfileListener.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-profile/org/gradle/profile/ReportGeneratingProfileListener.java new file mode 100644 index 0000000..c751544 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/build-profile/org/gradle/profile/ReportGeneratingProfileListener.java @@ -0,0 +1,64 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.profile; + +import org.gradle.api.invocation.Gradle; +import org.gradle.api.logging.LogLevel; +import org.gradle.initialization.StartParameterBuildOptions; +import org.gradle.internal.InternalBuildAdapter; +import org.gradle.internal.logging.ConsoleRenderer; +import org.gradle.internal.logging.text.StyledTextOutput; +import org.gradle.internal.logging.text.StyledTextOutputFactory; + +import java.io.File; +import java.text.SimpleDateFormat; +import java.util.Date; + +import static org.gradle.internal.logging.text.StyledTextOutput.Style.UserInput; + +public class ReportGeneratingProfileListener extends InternalBuildAdapter implements ProfileListener { + private static final SimpleDateFormat FILE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss"); + private final StyledTextOutputFactory textOutputFactory; + private File buildDir; + + public ReportGeneratingProfileListener(StyledTextOutputFactory textOutputFactory) { + this.textOutputFactory = textOutputFactory; + } + + @Override + public void projectsEvaluated(Gradle gradle) { + buildDir = gradle.getRootProject().getBuildDir(); + } + + public void buildFinished(BuildProfile buildProfile) { + ProfileReportRenderer renderer = new ProfileReportRenderer(); + File file = new File(buildDir, "reports/profile/profile-" + FILE_DATE_FORMAT.format(new Date(buildProfile.getBuildStarted())) + ".html"); + renderer.writeTo(buildProfile, file); + renderReportUrl(file); + } + + private void renderReportUrl(File reportFile) { + StyledTextOutput textOutput = textOutputFactory.create(ReportGeneratingProfileListener.class, LogLevel.LIFECYCLE); + textOutput.println(); + String reportUrl = new ConsoleRenderer().asClickableFileUrl(reportFile); + textOutput.formatln("See the profiling report at: %s", reportUrl); + textOutput.text("A fine-grained performance profile is available: use the "); + textOutput.withStyle(UserInput).format("--%s", StartParameterBuildOptions.BuildScanOption.LONG_OPTION); + textOutput.text(" option."); + textOutput.println(); + } +} + diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/code-quality/org/gradle/api/plugins/quality/Pmd.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/code-quality/org/gradle/api/plugins/quality/Pmd.java new file mode 100644 index 0000000..9d521fe --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/code-quality/org/gradle/api/plugins/quality/Pmd.java @@ -0,0 +1,326 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.plugins.quality; + +import groovy.lang.Closure; +import groovy.lang.DelegatesTo; +import org.gradle.api.Action; +import org.gradle.api.InvalidUserDataException; +import org.gradle.api.file.FileCollection; +import org.gradle.api.file.FileTree; +import org.gradle.api.internal.project.IsolatedAntBuilder; +import org.gradle.api.model.ObjectFactory; +import org.gradle.api.plugins.quality.internal.PmdInvoker; +import org.gradle.api.plugins.quality.internal.PmdReportsImpl; +import org.gradle.api.reporting.Reporting; +import org.gradle.api.resources.TextResource; +import org.gradle.api.tasks.CacheableTask; +import org.gradle.api.tasks.Classpath; +import org.gradle.api.tasks.Input; +import org.gradle.api.tasks.InputFiles; +import org.gradle.api.tasks.Nested; +import org.gradle.api.tasks.Optional; +import org.gradle.api.tasks.PathSensitive; +import org.gradle.api.tasks.PathSensitivity; +import org.gradle.api.tasks.SourceTask; +import org.gradle.api.tasks.TaskAction; +import org.gradle.api.tasks.VerificationTask; +import org.gradle.internal.nativeintegration.console.ConsoleDetector; +import org.gradle.internal.nativeintegration.console.ConsoleMetaData; +import org.gradle.internal.nativeintegration.services.NativeServices; +import org.gradle.util.ClosureBackedAction; + +import javax.annotation.Nullable; +import javax.inject.Inject; +import java.util.List; + +/** + * Runs a set of static code analysis rules on Java source code files and generates a report of problems found. + * + * @see PmdPlugin + * @see PmdExtension + */ +@CacheableTask +public class Pmd extends SourceTask implements VerificationTask, Reporting { + + private FileCollection pmdClasspath; + private List ruleSets; + private TargetJdk targetJdk; + private TextResource ruleSetConfig; + private FileCollection ruleSetFiles; + private final PmdReports reports; + private boolean ignoreFailures; + private int rulePriority; + private boolean consoleOutput; + private FileCollection classpath; + + public Pmd() { + reports = getObjectFactory().newInstance(PmdReportsImpl.class, this); + } + + @Inject + protected ObjectFactory getObjectFactory() { + throw new UnsupportedOperationException(); + } + + @Inject + public IsolatedAntBuilder getAntBuilder() { + throw new UnsupportedOperationException(); + } + + @TaskAction + public void run() { + PmdInvoker.invoke(this); + } + + public boolean stdOutIsAttachedToTerminal() { + ConsoleDetector consoleDetector = NativeServices.getInstance().get(ConsoleDetector.class); + ConsoleMetaData consoleMetaData = consoleDetector.getConsole(); + return consoleMetaData != null && consoleMetaData.isStdOut(); + } + + /** + * Configures the reports to be generated by this task. + */ + public PmdReports reports(@DelegatesTo(value = PmdReports.class, strategy = Closure.DELEGATE_FIRST) Closure closure) { + return reports(new ClosureBackedAction(closure)); + } + + /** + * Configures the reports to be generated by this task. + * + * @since 3.0 + */ + public PmdReports reports(Action configureAction) { + configureAction.execute(reports); + return reports; + } + + /** + * Validates the value is a valid PMD RulePriority (1-5) + * + * @param value rule priority threshold + */ + public static void validate(int value) { + if (value > 5 || value < 1) { + throw new InvalidUserDataException(String.format("Invalid rulePriority '%d'. Valid range 1 (highest) to 5 (lowest).", value)); + } + } + + /** + * {@inheritDoc} + */ + @Override + @PathSensitive(PathSensitivity.RELATIVE) + public FileTree getSource() { + return super.getSource(); + } + + /** + * The class path containing the PMD library to be used. + */ + @Classpath + public FileCollection getPmdClasspath() { + return pmdClasspath; + } + + /** + * The class path containing the PMD library to be used. + */ + public void setPmdClasspath(FileCollection pmdClasspath) { + this.pmdClasspath = pmdClasspath; + } + + /** + * The built-in rule sets to be used. See the official list of built-in rule sets. + * + * Example: ruleSets = ["basic", "braces"] + */ + @Input + public List getRuleSets() { + return ruleSets; + } + + /** + * The built-in rule sets to be used. See the official list of built-in rule sets. + * + * Example: ruleSets = ["basic", "braces"] + */ + public void setRuleSets(List ruleSets) { + this.ruleSets = ruleSets; + } + + /** + * The target JDK to use with PMD. + */ + @Input + public TargetJdk getTargetJdk() { + return targetJdk; + } + + /** + * The target JDK to use with PMD. + */ + public void setTargetJdk(TargetJdk targetJdk) { + this.targetJdk = targetJdk; + } + + /** + * The custom rule set to be used (if any). Replaces {@code ruleSetFiles}, except that it does not currently support multiple rule sets. + * + * See the official documentation for how to author a rule set. + * + * Example: ruleSetConfig = resources.text.fromFile(resources.file("config/pmd/myRuleSets.xml")) + * + * @since 2.2 + */ + @Nullable + @Optional + @Nested + public TextResource getRuleSetConfig() { + return ruleSetConfig; + } + + /** + * The custom rule set to be used (if any). Replaces {@code ruleSetFiles}, except that it does not currently support multiple rule sets. + * + * See the official documentation for how to author a rule set. + * + * Example: ruleSetConfig = resources.text.fromFile(resources.file("config/pmd/myRuleSets.xml")) + * + * @since 2.2 + */ + public void setRuleSetConfig(@Nullable TextResource ruleSetConfig) { + this.ruleSetConfig = ruleSetConfig; + } + + /** + * The custom rule set files to be used. See the official documentation for how to author a rule set file. + * + * Example: ruleSetFiles = files("config/pmd/myRuleSets.xml") + */ + @InputFiles + @PathSensitive(PathSensitivity.NONE) + public FileCollection getRuleSetFiles() { + return ruleSetFiles; + } + + /** + * The custom rule set files to be used. See the official documentation for how to author a rule set file. + * + * Example: ruleSetFiles = files("config/pmd/myRuleSets.xml") + */ + public void setRuleSetFiles(FileCollection ruleSetFiles) { + this.ruleSetFiles = ruleSetFiles; + } + + /** + * The reports to be generated by this task. + */ + @Nested + public final PmdReports getReports() { + return reports; + } + + /** + * Whether or not to allow the build to continue if there are warnings. + * + * Example: ignoreFailures = true + */ + public boolean getIgnoreFailures() { + return ignoreFailures; + } + + + /** + * Whether or not to allow the build to continue if there are warnings. + * + * Example: ignoreFailures = true + */ + public void setIgnoreFailures(boolean ignoreFailures) { + this.ignoreFailures = ignoreFailures; + } + + /** + * Specifies the rule priority threshold. + * + * @since 2.8 + * @see PmdExtension#rulePriority + */ + @Input + public int getRulePriority() { + return rulePriority; + } + + /** + * Sets the rule priority threshold. + * + * @since 2.8 + */ + public void setRulePriority(int intValue) { + validate(intValue); + rulePriority = intValue; + + } + + /** + * Whether or not to write PMD results to {@code System.out}. + * + * @since 2.1 + */ + @Input + public boolean isConsoleOutput() { + return consoleOutput; + } + + /** + * Whether or not to write PMD results to {@code System.out}. + * + * @since 2.1 + */ + public void setConsoleOutput(boolean consoleOutput) { + this.consoleOutput = consoleOutput; + } + + /** + * Compile class path for the classes to be analyzed. + * + * The classes on this class path are used during analysis but aren't analyzed themselves. + * + * This is only well supported for PMD 5.2.1 or better. + * + * @since 2.8 + */ + @Nullable + @Optional + @Classpath + public FileCollection getClasspath() { + return classpath; + } + + /** + * Compile class path for the classes to be analyzed. + * + * The classes on this class path are used during analysis but aren't analyzed themselves. + * + * This is only well supported for PMD 5.2.1 or better. + * + * @since 2.8 + */ + public void setClasspath(@Nullable FileCollection classpath) { + this.classpath = classpath; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/code-quality/org/gradle/api/plugins/quality/internal/package-info.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/code-quality/org/gradle/api/plugins/quality/internal/package-info.java new file mode 100644 index 0000000..c1179c6 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/code-quality/org/gradle/api/plugins/quality/internal/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@NonNullApi +package org.gradle.api.plugins.quality.internal; + +import org.gradle.api.NonNullApi; diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/api/AntBuilder.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/api/AntBuilder.java new file mode 100644 index 0000000..9f7a585 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/api/AntBuilder.java @@ -0,0 +1,119 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api; + +import java.util.Map; + +/** + *

An {@code AntBuilder} allows you to use Ant from your build script.

+ */ +public abstract class AntBuilder extends groovy.util.AntBuilder { + /** + * Returns the properties of the Ant project. This is a live map, you that you can make changes to the map and these + * changes are reflected in the Ant project. + * + * @return The properties. Never returns null. + */ + public abstract Map getProperties(); + + /** + * Returns the references of the Ant project. This is a live map, you that you can make changes to the map and these + * changes are reflected in the Ant project. + * + * @return The references. Never returns null. + */ + public abstract Map getReferences(); + + /** + * Imports an Ant build into the associated Gradle project. + * + * @param antBuildFile The build file. This is resolved as per {@link Project#file(Object)}. + */ + public abstract void importBuild(Object antBuildFile); + + /** + * Imports an Ant build into the associated Gradle project, potentially providing alternative names for Gradle tasks that correspond to Ant targets. + *

+ * For each Ant target that is to be converted to a Gradle task, the given {@code taskNamer} receives the Ant target name as input + * and is expected to return the desired name for the corresponding Gradle task. + * The transformer may be called multiple times with the same input. + * Implementations should ensure uniqueness of the return value for a distinct input. + * That is, no two inputs should yield the same return value. + * @param antBuildFile The build file. This is resolved as per {@link org.gradle.api.Project#file(Object)}. + * @param taskNamer A transformer that calculates the name of the Gradle task for a corresponding Ant target. + */ + public abstract void importBuild(Object antBuildFile, Transformer taskNamer); + + /** + * Returns this AntBuilder. Useful when you need to pass this builder to methods from within closures. + * @return this + */ + public AntBuilder getAnt() { + return this; + } + + /** + * Sets the Ant message priority that should correspond to the Gradle "lifecycle" log level. Any messages logged at this + * priority (or more critical priority) will be logged at least at lifecycle in Gradle's logger. If the Ant priority already maps to a + * higher Gradle log level, it will continue to be logged at that level. + * + * @param logLevel The Ant log level to map to the Gradle lifecycle log level + */ + public abstract void setLifecycleLogLevel(AntMessagePriority logLevel); + + /** + * Sets the Ant message priority that should correspond to the Gradle "lifecycle" log level. Any messages logged at this + * priority (or more critical priority) will be logged at least at lifecycle in Gradle's logger. If the Ant priority already maps to a + * higher Gradle log level, it will continue to be logged at that level. Acceptable values are "VERBOSE", "DEBUG", "INFO", "WARN", + * and "ERROR". + * + * @param logLevel The Ant log level to map to the Gradle lifecycle log level + */ + public void setLifecycleLogLevel(String logLevel) { + setLifecycleLogLevel(AntMessagePriority.valueOf(logLevel)); + } + + /** + * Returns the Ant message priority that corresponds to the Gradle "lifecycle" log level. + * + * @return logLevel The Ant log level that maps to the Gradle lifecycle log level + */ + public abstract AntMessagePriority getLifecycleLogLevel(); + + /** + * Represents the normal Ant message priorities. + */ + public enum AntMessagePriority { + DEBUG, VERBOSE, INFO, WARN, ERROR; + + public static AntMessagePriority from(int messagePriority) { + switch(messagePriority) { + case org.apache.tools.ant.Project.MSG_ERR: + return ERROR; + case org.apache.tools.ant.Project.MSG_WARN: + return WARN; + case org.apache.tools.ant.Project.MSG_INFO: + return INFO; + case org.apache.tools.ant.Project.MSG_VERBOSE: + return VERBOSE; + case org.apache.tools.ant.Project.MSG_DEBUG: + return DEBUG; + default: + throw new IllegalArgumentException(); + } + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/api/Script.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/api/Script.java new file mode 100644 index 0000000..0dfa568 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/api/Script.java @@ -0,0 +1,376 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api; + +import groovy.lang.Closure; +import org.gradle.api.file.ConfigurableFileCollection; +import org.gradle.api.file.ConfigurableFileTree; +import org.gradle.api.file.CopySpec; +import org.gradle.api.file.FileTree; +import org.gradle.api.initialization.dsl.ScriptHandler; +import org.gradle.api.logging.Logger; +import org.gradle.api.logging.LoggingManager; +import org.gradle.api.provider.Provider; +import org.gradle.api.resources.ResourceHandler; +import org.gradle.api.tasks.WorkResult; +import org.gradle.process.ExecResult; +import org.gradle.process.ExecSpec; +import org.gradle.process.JavaExecSpec; + +import java.io.File; +import java.net.URI; +import java.util.Map; +import java.util.concurrent.Callable; + +/** + *

This interface is implemented by all Gradle scripts to add in some Gradle-specific methods. As your compiled + * script class will implement this interface, you can use the methods and properties declared by this interface + * directly in your script.

+ * + *

Generally, a {@code Script} object will have a delegate object attached to it. For example, a build script will + * have a {@link Project} instance attached to it, and an initialization script will have a {@link + * org.gradle.api.invocation.Gradle} instance attached to it. Any property reference or method call which is not found + * on this {@code Script} object is forwarded to the delegate object.

+ */ +public interface Script { + /** + *

Configures the delegate object for this script using plugins or scripts. + * + *

The given closure is used to configure an {@link org.gradle.api.plugins.ObjectConfigurationAction} which is + * then used to configure the delegate object.

+ * + * @param closure The closure to configure the {@code ObjectConfigurationAction}. + */ + void apply(Closure closure); + + /** + *

Configures the delegate object for this script using plugins or scripts. + * + *

The following options are available:

+ * + *
  • {@code from}: A script to apply to the delegate object. Accepts any path supported by {@link + * #uri(Object)}.
  • + * + *
  • {@code plugin}: The id or implementation class of the plugin to apply to the delegate object.
  • + * + *
  • {@code to}: The target delegate object or objects.
+ * + *

For more detail, see {@link org.gradle.api.plugins.ObjectConfigurationAction}.

+ * + * @param options The options to use to configure the {@code ObjectConfigurationAction}. + */ + void apply(Map options); + + /** + * Returns the script handler for this script. You can use this handler to manage the classpath used to compile and + * execute this script. + * + * @return the classpath handler. Never returns null. + */ + ScriptHandler getBuildscript(); + + /** + * Configures the classpath for this script. + * + *

The given closure is executed against this script's {@link ScriptHandler}. The {@link ScriptHandler} is passed + * to the closure as the closure's delegate. + * + * @param configureClosure the closure to use to configure the script classpath. + */ + void buildscript(Closure configureClosure); + + /** + *

Resolves a file path relative to the directory containing this script. This works as described for {@link + * Project#file(Object)}

+ * + * @param path The object to resolve as a File. + * @return The resolved file. Never returns null. + */ + File file(Object path); + + /** + *

Resolves a file path relative to the directory containing this script and validates it using the given scheme. + * See {@link PathValidation} for the list of possible validations.

+ * + * @param path An object to resolve as a File. + * @param validation The validation to perform on the file. + * @return The resolved file. Never returns null. + * @throws InvalidUserDataException When the file does not meet the given validation constraint. + */ + File file(Object path, PathValidation validation) throws InvalidUserDataException; + + /** + *

Resolves a file path to a URI, relative to the directory containing this script. Evaluates the provided path + * object as described for {@link #file(Object)}, with the exception that any URI scheme is supported, not just + * 'file:' URIs.

+ * + * @param path The object to resolve as a URI. + * @return The resolved URI. Never returns null. + */ + URI uri(Object path); + + /** + *

Returns a {@link ConfigurableFileCollection} containing the given files. This works as described for {@link + * Project#files(Object...)}. Relative paths are resolved relative to the directory containing this script.

+ * + * @param paths The paths to the files. May be empty. + * @return The file collection. Never returns null. + */ + ConfigurableFileCollection files(Object... paths); + + /** + *

Creates a new {@code ConfigurableFileCollection} using the given paths. The file collection is configured + * using the given closure. This method works as described for {@link Project#files(Object, groovy.lang.Closure)}. + * Relative paths are resolved relative to the directory containing this script.

+ * + * @param paths The contents of the file collection. Evaluated as per {@link #files(Object...)}. + * @param configureClosure The closure to use to configure the file collection. + * @return the configured file tree. Never returns null. + */ + ConfigurableFileCollection files(Object paths, Closure configureClosure); + + /** + *

Returns the relative path from the directory containing this script to the given path. The given path object + * is (logically) resolved as described for {@link #file(Object)}, from which a relative path is calculated.

+ * + * @param path The path to convert to a relative path. + * @return The relative path. Never returns null. + */ + String relativePath(Object path); + + /** + *

Creates a new {@code ConfigurableFileTree} using the given base directory. The given baseDir path is evaluated + * as per {@link #file(Object)}.

+ * + *

The returned file tree is lazy, so that it scans for files only when the contents of the file tree are + * queried. The file tree is also live, so that it scans for files each time the contents of the file tree are + * queried.

+ * + * @param baseDir The base directory of the file tree. Evaluated as per {@link #file(Object)}. + * @return the file tree. Never returns null. + */ + ConfigurableFileTree fileTree(Object baseDir); + + /** + *

Creates a new {@code ConfigurableFileTree} using the provided map of arguments. The map will be applied as + * properties on the new file tree. Example:

+ *
+     * fileTree(dir:'src', excludes:['**/ignore/**','**/.svn/**'])
+     * 
+ *

The returned file tree is lazy, so that it scans for files only when the contents of the file tree are + * queried. The file tree is also live, so that it scans for files each time the contents of the file tree are + * queried.

+ * + * @param args map of property assignments to {@code ConfigurableFileTree} object + * @return the configured file tree. Never returns null. + */ + ConfigurableFileTree fileTree(Map args); + + /** + *

Creates a new {@code ConfigurableFileTree} using the given base directory. The given baseDir path is evaluated + * as per {@link #file(Object)}. The closure will be used to configure the new file tree. + * The file tree is passed to the closure as its delegate. Example:

+ * + *
+     * fileTree('src') {
+     *    exclude '**/.svn/**'
+     * }.copy { into 'dest'}
+     * 
+ * + *

The returned file tree is lazy, so that it scans for files only when the contents of the file tree are + * queried. The file tree is also live, so that it scans for files each time the contents of the file tree are + * queried.

+ * + * @param baseDir The base directory of the file tree. Evaluated as per {@link #file(Object)}. + * @param configureClosure Closure to configure the {@code ConfigurableFileTree} object. + * @return the configured file tree. Never returns null. + */ + ConfigurableFileTree fileTree(Object baseDir, Closure configureClosure); + + /** + *

Creates a new {@code FileTree} which contains the contents of the given ZIP file. The given zipPath path is + * evaluated as per {@link #file(Object)}. You can combine this method with the {@link #copy(groovy.lang.Closure)} + * method to unzip a ZIP file.

+ * + *

The returned file tree is lazy, so that it scans for files only when the contents of the file tree are + * queried. The file tree is also live, so that it scans for files each time the contents of the file tree are + * queried.

+ * + * @param zipPath The ZIP file. Evaluated as per {@link #file(Object)}. + * @return the file tree. Never returns null. + */ + FileTree zipTree(Object zipPath); + + /** + * Creates a new {@code FileTree} which contains the contents of the given TAR file. The given tarPath path can be: + *
    + *
  • an instance of {@link org.gradle.api.resources.Resource}
  • + *
  • any other object is evaluated as per {@link #file(Object)}
  • + *
+ * + * The returned file tree is lazy, so that it scans for files only when the contents of the file tree are + * queried. The file tree is also live, so that it scans for files each time the contents of the file tree are + * queried. + *

+ * Unless custom implementation of resources is passed, the tar tree attempts to guess the compression based on the file extension. + *

+ * You can combine this method with the {@link #copy(groovy.lang.Closure)} + * method to untar a TAR file: + * + *

+     * task untar(type: Copy) {
+     *   from tarTree('someCompressedTar.gzip')
+     *
+     *   //tar tree attempts to guess the compression based on the file extension
+     *   //however if you must specify the compression explicitly you can:
+     *   from tarTree(resources.gzip('someTar.ext'))
+     *
+     *   //in case you work with unconventionally compressed tars
+     *   //you can provide your own implementation of a ReadableResource:
+     *   //from tarTree(yourOwnResource as ReadableResource)
+     *
+     *   into 'dest'
+     * }
+     * 
+ * + * @param tarPath The TAR file or an instance of {@link org.gradle.api.resources.Resource}. + * @return the file tree. Never returns null. + */ + FileTree tarTree(Object tarPath); + + /** + * Copy the specified files. The given closure is used to configure a {@link org.gradle.api.file.CopySpec}, which + * is then used to copy the files. Example: + *
+     * copy {
+     *    from configurations.runtime
+     *    into 'build/deploy/lib'
+     * }
+     * 
+ * Note that CopySpecs can be nested: + *
+     * copy {
+     *    into 'build/webroot'
+     *    exclude '**/.svn/**'
+     *    from('src/main/webapp') {
+     *       include '**/*.jsp'
+     *       filter(ReplaceTokens, tokens:[copyright:'2009', version:'2.3.1'])
+     *    }
+     *    from('src/main/js') {
+     *       include '**/*.js'
+     *    }
+     * }
+     * 
+ * + * @param closure Closure to configure the CopySpec + * @return {@link org.gradle.api.tasks.WorkResult} that can be used to check if the copy did any work. + */ + WorkResult copy(Closure closure); + + /** + * Creates a {@link org.gradle.api.file.CopySpec} which can later be used to copy files or create an archive. The + * given closure is used to configure the {@link org.gradle.api.file.CopySpec} before it is returned by this + * method. + * + * @param closure Closure to configure the CopySpec + * @return The CopySpec + */ + CopySpec copySpec(Closure closure); + + /** + * Creates a directory and returns a file pointing to it. + * + * @param path The path for the directory to be created. Evaluated as per {@link #file(Object)}. + * @return the created directory + * @throws org.gradle.api.InvalidUserDataException If the path points to an existing file. + */ + File mkdir(Object path); + + /** + * Deletes files and directories. + * + * @param paths Any type of object accepted by {@link org.gradle.api.Project#files(Object...)} + * @return true if anything got deleted, false otherwise + */ + boolean delete(Object... paths); + + /** + * Executes a Java main class. The closure configures a {@link org.gradle.process.JavaExecSpec}. + * + * @param closure The closure for configuring the execution. + * @return the result of the execution + */ + ExecResult javaexec(Closure closure); + + /** + * Executes a Java main class. + * + * @param action The action for configuring the execution. + * @return the result of the execution + */ + ExecResult javaexec(Action action); + + /** + * Executes an external command. The closure configures a {@link org.gradle.process.ExecSpec}. + * + * @param closure The closure for configuring the execution. + * @return the result of the execution + */ + ExecResult exec(Closure closure); + + /** + * Executes an external command. + * + * @param action The action for configuring the execution. + * @return the result of the execution + */ + ExecResult exec(Action action); + + /** + * Returns the {@link org.gradle.api.logging.LoggingManager} which can be used to receive logging and to control the + * standard output/error capture for this script. By default, System.out is redirected to the Gradle logging system + * at the QUIET log level, and System.err is redirected at the ERROR log level. + * + * @return the LoggingManager. Never returns null. + */ + LoggingManager getLogging(); + + /** + * Returns the logger for this script. You can use this in your script to write log messages. + * + * @return The logger. Never returns null. + */ + Logger getLogger(); + + /** + * Provides access to resource-specific utility methods, for example factory methods that create various resources. + * + * @return Returned instance contains various resource-specific utility methods. + */ + ResourceHandler getResources(); + + /** + * Creates a {@code Provider} implementation based on the provided value. + * + * @param value The {@code java.util.concurrent.Callable} use to calculate the value. + * @return The provider. Never returns null. + * @throws org.gradle.api.InvalidUserDataException If the provided value is null. + * @see org.gradle.api.provider.ProviderFactory#provider(Callable) + * @since 4.0 + */ + @Incubating + Provider provider(Callable value); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/api/artifacts/DependencyResolutionListener.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/api/artifacts/DependencyResolutionListener.java new file mode 100644 index 0000000..0720806 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/api/artifacts/DependencyResolutionListener.java @@ -0,0 +1,35 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.artifacts; + +/** + * A {@code DependencyResolutionListener} is notified as dependencies are resolved. + */ +public interface DependencyResolutionListener { + /** + * This method is called immediately before a set of dependencies are resolved. + * + * @param dependencies The set of dependencies to be resolved. + */ + void beforeResolve(ResolvableDependencies dependencies); + + /** + * This method is called immediately after a set of dependencies are resolved. + * + * @param dependencies The set of dependencies resolved. + */ + void afterResolve(ResolvableDependencies dependencies); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/api/attributes/MultipleCandidatesDetails.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/api/attributes/MultipleCandidatesDetails.java new file mode 100644 index 0000000..bfbc801 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/api/attributes/MultipleCandidatesDetails.java @@ -0,0 +1,56 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.attributes; + +import org.gradle.api.Incubating; + +import javax.annotation.Nullable; +import java.util.Set; + +/** + * Provides context about candidates for an attribute. In particular, this class gives access to + * the list of candidates on the producer side. + * + * @param the concrete type of the attribute + * @since 3.3 + */ +public interface MultipleCandidatesDetails { + /** + * Returns the value of the attribute specified by the consumer. + * + * @return The value or {@code null} if the consumer did not specify a value. + * @since 4.1 + */ + @Incubating + @Nullable + T getConsumerValue(); + + /** + * A set of candidate values. + * + * @return the set of candidates + */ + Set getCandidateValues(); + + /** + * Calling this method indicates that the candidate is the closest match. It is allowed to call this method several times with + * different values, in which case it indicates that multiple candidates are equally compatible. + * + * @param candidate the closest match + */ + void closestMatch(T candidate); + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/api/model/ObjectFactory.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/api/model/ObjectFactory.java new file mode 100644 index 0000000..25584e2 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/api/model/ObjectFactory.java @@ -0,0 +1,160 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.model; + +import org.gradle.api.Incubating; +import org.gradle.api.Named; +import org.gradle.api.file.DirectoryProperty; +import org.gradle.api.file.RegularFileProperty; +import org.gradle.api.file.SourceDirectorySet; +import org.gradle.api.provider.ListProperty; +import org.gradle.api.provider.MapProperty; +import org.gradle.api.provider.Property; +import org.gradle.api.provider.SetProperty; +import org.gradle.api.reflect.ObjectInstantiationException; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * A factory for creating various kinds of model objects. + *

+ * An instance of the factory can be injected into a task or plugin by annotating a public constructor or property getter method with {@code javax.inject.Inject}. It is also available via {@link org.gradle.api.Project#getObjects()}. + * + * @since 4.0 + */ +@Incubating +public interface ObjectFactory { + /** + * Creates a simple immutable {@link Named} object of the given type and name. + * + *

The given type can be an interface that extends {@link Named} or an abstract class that 'implements' {@link Named}. An abstract class, if provided:

+ *
    + *
  • Must provide a zero-args constructor that is not private.
  • + *
  • Must not define or inherit any instance fields.
  • + *
  • Should not provide an implementation for {@link Named#getName()} and should define this method as abstract. Any implementation will be overridden.
  • + *
  • Must not define or inherit any other abstract methods.
  • + *
+ * + *

An interface, if provided, must not define or inherit any other methods.

+ * + *

Objects created using this method are not decorated or extensible.

+ * + * @throws ObjectInstantiationException On failure to create the new instance. + * @since 4.0 + */ + T named(Class type, String name) throws ObjectInstantiationException; + + /** + * Create a new instance of T, using {@code parameters} as the construction parameters. + * + *

The type must be a non-abstract class.

+ * + *

Objects created using this method are decorated and extensible, meaning that they have DSL support mixed in and can be extended using the `extensions` property, similar to the {@link org.gradle.api.Project} object.

+ * + *

An @Inject annotation is required on any constructor that accepts parameters because JSR-330 semantics for dependency injection are used. In addition to those parameters provided as an argument to this method, the following services are also available for injection:

+ * + *
    + *
  • {@link ObjectFactory}.
  • + *
  • {@link org.gradle.api.file.ProjectLayout}.
  • + *
  • {@link org.gradle.api.provider.ProviderFactory}.
  • + *
+ * + * @throws ObjectInstantiationException On failure to create the new instance. + * @since 4.2 + */ + T newInstance(Class type, Object... parameters) throws ObjectInstantiationException; + + /** + * Creates a {@link SourceDirectorySet}. + * + * @param name A short name for the set. + * @param displayName A human consumable display name for the set. + * @since 5.0 + */ + SourceDirectorySet sourceDirectorySet(String name, String displayName); + + /** + * Creates a {@link Property} implementation to hold values of the given type. The property has no initial value. + * + *

For certain types, there are more specialized property factory methods available:

+ *
    + *
  • For {@link List} properties, you should use {@link #listProperty(Class)}.
  • + *
  • For {@link Set} properties, you should use {@link #setProperty(Class)}.
  • + *
  • For {@link Map} properties, you should use {@link #mapProperty(Class, Class)}.
  • + *
  • For {@link org.gradle.api.file.Directory} properties, you should use {@link #directoryProperty()}.
  • + *
  • For {@link org.gradle.api.file.RegularFile} properties, you should use {@link #fileProperty()}.
  • + *
+ * + * @param valueType The type of the property. + * @return The property. Never returns null. + * @since 4.3 + */ + Property property(Class valueType); + + /** + * Creates a {@link ListProperty} implementation to hold a {@link List} of the given element type {@code T}. The property has an empty list as its initial value. + * + *

The implementation will return immutable {@link List} values from its query methods.

+ * + * @param elementType The type of element. + * @param The type of element. + * @return The property. Never returns null; + * @since 4.3 + */ + ListProperty listProperty(Class elementType); + + /** + * Creates a {@link SetProperty} implementation to hold a {@link Set} of the given element type {@code T}. The property has an empty set as its initial value. + * + *

The implementation will return immutable {@link Set} values from its query methods.

+ * + * @param elementType The type of element. + * @param The type of element. + * @return The property. Never returns null; + * @since 4.5 + */ + SetProperty setProperty(Class elementType); + + /** + * Creates a {@link MapProperty} implementation to hold a {@link Map} of the given key type {@code K} and value type {@code V}. The property has an empty map as its initial value. + * + *

The implementation will return immutable {@link Map} values from its query methods.

+ * @param keyType the type of key. + * @param valueType the type of value. + * @param the type of key. + * @param the type of value. + * @return the property. Never returns null. + * @since 5.1 + */ + MapProperty mapProperty(Class keyType, Class valueType); + + /** + * Creates a new {@link DirectoryProperty} that uses the project directory to resolve relative paths, if required. The property has no initial value. + * + * @since 5.0 + */ + DirectoryProperty directoryProperty(); + + /** + * Creates a new {@link RegularFileProperty} that uses the project directory to resolve relative paths, if required. The property has no initial value. + * + * @since 5.0 + */ + RegularFileProperty fileProperty(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/initialization/InitScriptFinder.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/initialization/InitScriptFinder.java new file mode 100644 index 0000000..6593bec --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/initialization/InitScriptFinder.java @@ -0,0 +1,26 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.initialization; + +import java.io.File; +import java.util.Collection; + +/** + * Interface for objects that can find init scripts for a given build. + */ +public interface InitScriptFinder { + void findScripts(Collection scripts); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/internal/deprecation/Deprecatable.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/internal/deprecation/Deprecatable.java new file mode 100644 index 0000000..b9c5f9f --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/internal/deprecation/Deprecatable.java @@ -0,0 +1,42 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.deprecation; + +import java.io.Serializable; +import java.util.Set; + +public interface Deprecatable extends Serializable { + + /** + * Adds a deprecation item. + * + * @param deprecation Deprecation item + */ + void addDeprecation(String deprecation); + + /** + * Gets all deprecation items. + * + * @return All deprecation items + */ + Set getDeprecations(); + + /** + * Checks all deprecations. + */ + void checkDeprecation(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/model/internal/type/GenericArrayTypeWrapper.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/model/internal/type/GenericArrayTypeWrapper.java new file mode 100644 index 0000000..e9b5ecd --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/model/internal/type/GenericArrayTypeWrapper.java @@ -0,0 +1,80 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.model.internal.type; + +import com.google.common.collect.ImmutableList; + +import java.lang.reflect.Array; + +class GenericArrayTypeWrapper implements TypeWrapper { + private final TypeWrapper componentType; + private final int hashCode; + + public GenericArrayTypeWrapper(TypeWrapper componentType, int hashCode) { + this.componentType = componentType; + this.hashCode = hashCode; + } + + public TypeWrapper getComponentType() { + return componentType; + } + + @Override + public Class getRawClass() { + // This could probably be more efficient + return Array.newInstance(componentType.getRawClass(), 0).getClass(); + } + + @Override + public boolean isAssignableFrom(TypeWrapper wrapper) { + if (wrapper instanceof GenericArrayTypeWrapper) { + GenericArrayTypeWrapper arrayType = (GenericArrayTypeWrapper) wrapper; + return componentType.isAssignableFrom(arrayType.componentType); + } + return false; + } + + @Override + public void collectClasses(ImmutableList.Builder> builder) { + componentType.collectClasses(builder); + } + + @Override + public boolean equals(Object o) { + if (o instanceof GenericArrayTypeWrapper) { + GenericArrayTypeWrapper that = (GenericArrayTypeWrapper) o; + return this == that || componentType.equals(that.componentType); + } else { + return false; + } + } + + @Override + public int hashCode() { + return hashCode; + } + + @Override + public String toString() { + return getRepresentation(true); + } + + @Override + public String getRepresentation(boolean full) { + return componentType.getRepresentation(full) + "[]"; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/model/internal/type/WildcardWrapper.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/model/internal/type/WildcardWrapper.java new file mode 100644 index 0000000..127dc01 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core-api/org/gradle/model/internal/type/WildcardWrapper.java @@ -0,0 +1,26 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.model.internal.type; + +import javax.annotation.Nullable; + +public interface WildcardWrapper extends TypeWrapper { + TypeWrapper getUpperBound(); + + @Nullable + TypeWrapper getLowerBound(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/DefaultMutationGuard.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/DefaultMutationGuard.java new file mode 100644 index 0000000..ab75faf --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/DefaultMutationGuard.java @@ -0,0 +1,48 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal; + +import org.gradle.api.Action; + +public class DefaultMutationGuard extends AbstractMutationGuard { + private final ThreadLocal mutationGuardState = new ThreadLocal() { + @Override + protected Boolean initialValue() { + return Boolean.TRUE; + } + }; + + @Override + public boolean isMutationAllowed() { + return mutationGuardState.get(); + } + + protected Action newActionWithMutation(final Action action, final boolean allowMutationMethods) { + return new Action() { + @Override + public void execute(T t) { + boolean oldIsMutationAllowed = isMutationAllowed(); + mutationGuardState.set(allowMutationMethods); + try { + action.execute(t); + } finally { + mutationGuardState.set(oldIsMutationAllowed); + } + } + }; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/GradleInternal.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/GradleInternal.java new file mode 100644 index 0000000..ff5aadd --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/GradleInternal.java @@ -0,0 +1,146 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal; + +import org.gradle.BuildListener; +import org.gradle.api.ProjectEvaluationListener; +import org.gradle.api.initialization.IncludedBuild; +import org.gradle.api.internal.initialization.ClassLoaderScope; +import org.gradle.api.internal.plugins.PluginAwareInternal; +import org.gradle.api.internal.project.ProjectInternal; +import org.gradle.api.invocation.Gradle; +import org.gradle.execution.taskgraph.TaskExecutionGraphInternal; +import org.gradle.internal.build.BuildState; +import org.gradle.internal.build.PublicBuildPath; +import org.gradle.internal.scan.UsedByScanPlugin; +import org.gradle.internal.service.ServiceRegistry; +import org.gradle.internal.service.scopes.ServiceRegistryFactory; +import org.gradle.util.Path; + +import javax.annotation.Nullable; +import java.util.Collection; + +/** + * An internal interface for Gradle that exposed objects and concepts that are not intended for public + * consumption. + */ +@UsedByScanPlugin +public interface GradleInternal extends Gradle, PluginAwareInternal { + /** + * {@inheritDoc} + */ + ProjectInternal getRootProject() throws IllegalStateException; + + GradleInternal getParent(); + + GradleInternal getRoot(); + + /** + * Returns the {@link BuildState} that manages the state of this instance. + */ + BuildState getOwner(); + + /** + * {@inheritDoc} + */ + TaskExecutionGraphInternal getTaskGraph(); + + /** + * Returns the default project. This is used to resolve relative names and paths provided on the UI. + */ + ProjectInternal getDefaultProject(); + + /** + * Returns the broadcaster for {@link ProjectEvaluationListener} events for this build + */ + ProjectEvaluationListener getProjectEvaluationBroadcaster(); + + /** + * The settings for this build. + * + * @throws IllegalStateException when the build is not loaded yet, see {@link #setSettings(SettingsInternal)} + * @return the settings for this build + */ + SettingsInternal getSettings() throws IllegalStateException; + + /** + * Called by the BuildLoader after the settings are loaded. + * Until the BuildLoader is executed, {@link #getSettings()} will throw {@link IllegalStateException}. + * + * @param settings The settings for this build. + */ + void setSettings(SettingsInternal settings); + + /** + * Called by the BuildLoader after the default project is determined. Until the BuildLoader + * is executed, {@link #getDefaultProject()} will return null. + * + * @param defaultProject The default project for this build. + */ + void setDefaultProject(ProjectInternal defaultProject); + + /** + * Called by the BuildLoader after the root project is determined. Until the BuildLoader + * is executed, {@link #getRootProject()} will throw {@link IllegalStateException}. + * + * @param rootProject The root project for this build. + */ + void setRootProject(ProjectInternal rootProject); + + /** + * Returns the broadcaster for {@link BuildListener} events + */ + BuildListener getBuildListenerBroadcaster(); + + @UsedByScanPlugin + ServiceRegistry getServices(); + + ServiceRegistryFactory getServiceRegistryFactory(); + + ClassLoaderScope getClassLoaderScope(); + + void setIncludedBuilds(Collection includedBuilds); + + /** + * Returns a unique path for this build within the current Gradle invocation. + * + * @throws IllegalStateException When the path is not yet known. The path is often a function of the name of the root project, which is not known when this `Gradle` instance is created. + */ + Path getIdentityPath() throws IllegalStateException; + + /** + * Returns a unique path for this build within the current Gradle invocation, or null when not yet known + */ + @Nullable + Path findIdentityPath(); + + void setIdentityPath(Path path); + + String contextualize(String description); + + PublicBuildPath getPublicBuildPath(); + + enum BuildType { + NONE, + TASKS, + MODEL + } + + void setBuildType(BuildType buildType); + + BuildType getBuildType(); + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/InjectUtil.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/InjectUtil.java new file mode 100644 index 0000000..852a020 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/InjectUtil.java @@ -0,0 +1,91 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal; + +import javax.inject.Inject; +import java.lang.reflect.Constructor; +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.List; + +public class InjectUtil { + /** + * Selects the single injectable constructor for the given type. + * The type must either have only one public or package-private default constructor, + * or it should have a single constructor annotated with {@literal @}{@link Inject}. + * + * @param type the type to find the injectable constructor of. + */ + public static Constructor selectConstructor(Class type) { + return selectConstructor(type, type); + } + + /** + * Selects the single injectable constructor for the given type. + * The type must either have only one public or package-private default constructor, + * or it should have a single constructor annotated with {@literal @}{@link Inject}. + * + * @param type the type to find the injectable constructor of. + * @param reportAs errors are reported against this type, useful when the real type is generated, and we'd like to show the original type in messages instead. + */ + public static Constructor selectConstructor(Class type, Class reportAs) { + Constructor[] constructors = type.getDeclaredConstructors(); + + if (constructors.length == 1) { + Constructor constructor = constructors[0]; + if (constructor.getParameterTypes().length == 0 && isPublicOrPackageScoped(type, constructor)) { + return constructor; + } + if (constructor.getAnnotation(Inject.class) != null) { + return constructor; + } + if (constructor.getParameterTypes().length == 0) { + throw new IllegalArgumentException(String.format("The constructor for class %s should be public or package protected or annotated with @Inject.", reportAs.getName())); + } else { + throw new IllegalArgumentException(String.format("The constructor for class %s should be annotated with @Inject.", reportAs.getName())); + } + } + + List> injectConstructors = new ArrayList>(); + for (Constructor constructor : constructors) { + if (constructor.getAnnotation(Inject.class) != null) { + injectConstructors.add(constructor); + } + } + + if (injectConstructors.isEmpty()) { + throw new IllegalArgumentException(String.format("Class %s has no constructor that is annotated with @Inject.", reportAs.getName())); + } + if (injectConstructors.size() > 1) { + throw new IllegalArgumentException(String.format("Class %s has multiple constructors that are annotated with @Inject.", reportAs.getName())); + } + return injectConstructors.get(0); + } + + private static boolean isPublicOrPackageScoped(Class type, Constructor constructor) { + if (isPackagePrivate(type.getModifiers())) { + return !Modifier.isPrivate(constructor.getModifiers()) && !Modifier.isProtected(constructor.getModifiers()); + } else { + return Modifier.isPublic(constructor.getModifiers()); + } + } + + private static boolean isPackagePrivate(int modifiers) { + return !Modifier.isPrivate(modifiers) && !Modifier.isProtected(modifiers) && !Modifier.isPublic(modifiers); + } + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/OverlappingOutputs.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/OverlappingOutputs.java new file mode 100644 index 0000000..2d625d2 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/OverlappingOutputs.java @@ -0,0 +1,105 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal; + +import com.google.common.collect.ImmutableSortedMap; +import org.gradle.internal.file.FileType; +import org.gradle.internal.fingerprint.CurrentFileCollectionFingerprint; +import org.gradle.internal.fingerprint.FileCollectionFingerprint; +import org.gradle.internal.fingerprint.FileSystemLocationFingerprint; +import org.gradle.internal.hash.HashCode; + +import javax.annotation.Nullable; +import java.util.Map; + +public class OverlappingOutputs { + private final String propertyName; + private final String overlappedFilePath; + + public OverlappingOutputs(String propertyName, String overlappedFilePath) { + this.propertyName = propertyName; + this.overlappedFilePath = overlappedFilePath; + } + + @Nullable + public static OverlappingOutputs detect(@Nullable ImmutableSortedMap previous, ImmutableSortedMap current) { + for (Map.Entry entry : current.entrySet()) { + String propertyName = entry.getKey(); + CurrentFileCollectionFingerprint beforeExecution = entry.getValue(); + FileCollectionFingerprint afterPreviousExecution = getFingerprintAfterPreviousExecution(previous, propertyName); + OverlappingOutputs overlappingOutputs = OverlappingOutputs.detect(propertyName, afterPreviousExecution, beforeExecution); + if (overlappingOutputs != null) { + return overlappingOutputs; + } + } + return null; + } + + private static FileCollectionFingerprint getFingerprintAfterPreviousExecution(@Nullable ImmutableSortedMap previous, String propertyName) { + if (previous != null) { + FileCollectionFingerprint afterPreviousExecution = previous.get(propertyName); + if (afterPreviousExecution != null) { + return afterPreviousExecution; + } + } + return FileCollectionFingerprint.EMPTY; + } + + + @Nullable + private static OverlappingOutputs detect(String propertyName, FileCollectionFingerprint previous, CurrentFileCollectionFingerprint before) { + Map previousFingerprints = previous.getFingerprints(); + Map beforeFingerprints = before.getFingerprints(); + + for (Map.Entry beforeEntry : beforeFingerprints.entrySet()) { + String path = beforeEntry.getKey(); + FileSystemLocationFingerprint beforeFingerprint = beforeEntry.getValue(); + HashCode contentHash = beforeFingerprint.getNormalizedContentHash(); + FileSystemLocationFingerprint previousFingerprint = previousFingerprints.get(path); + HashCode previousContentHash = previousFingerprint == null ? null : previousFingerprint.getNormalizedContentHash(); + // Missing files can be ignored + if (beforeFingerprint.getType() != FileType.Missing) { + if (createdSincePreviousExecution(previousContentHash) || changedSincePreviousExecution(contentHash, previousContentHash)) { + return new OverlappingOutputs(propertyName, path); + } + } + } + return null; + } + + private static boolean changedSincePreviousExecution(HashCode contentHash, HashCode previousContentHash) { + // _changed_ since last execution, possibly by another task + return !contentHash.equals(previousContentHash); + } + + private static boolean createdSincePreviousExecution(@Nullable HashCode previousContentHash) { + // created since last execution, possibly by another task + return previousContentHash == null; + } + + public String getPropertyName() { + return propertyName; + } + + public String getOverlappedFilePath() { + return overlappedFilePath; + } + + public String toString() { + return String.format("output property '%s' with path '%s'", propertyName, overlappedFilePath); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/changedetection/state/TaskExecution.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/changedetection/state/TaskExecution.java new file mode 100644 index 0000000..dd86768 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/changedetection/state/TaskExecution.java @@ -0,0 +1,25 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.changedetection.state; + +import org.gradle.internal.execution.history.ExecutionState; + +/** + * The state for a single task execution. + */ +public interface TaskExecution extends ExecutionState { + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/initialization/DefaultScriptHandlerFactory.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/initialization/DefaultScriptHandlerFactory.java new file mode 100644 index 0000000..2ffb6ae --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/initialization/DefaultScriptHandlerFactory.java @@ -0,0 +1,54 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.initialization; + +import org.gradle.api.internal.DomainObjectContext; +import org.gradle.api.internal.artifacts.DependencyManagementServices; +import org.gradle.api.internal.artifacts.DependencyResolutionServices; +import org.gradle.api.internal.artifacts.configurations.DependencyMetaDataProvider; +import org.gradle.api.internal.artifacts.dsl.dependencies.ProjectFinder; +import org.gradle.api.internal.artifacts.dsl.dependencies.UnknownProjectFinder; +import org.gradle.api.internal.file.FileResolver; +import org.gradle.groovy.scripts.ScriptSource; + +public class DefaultScriptHandlerFactory implements ScriptHandlerFactory { + private final DependencyManagementServices dependencyManagementServices; + private final DependencyMetaDataProvider dependencyMetaDataProvider; + private final ScriptClassPathResolver scriptClassPathResolver; + private final FileResolver fileResolver; + private final ProjectFinder projectFinder = new UnknownProjectFinder("Cannot use project dependencies in a script classpath definition."); + + public DefaultScriptHandlerFactory(DependencyManagementServices dependencyManagementServices, + FileResolver fileResolver, + DependencyMetaDataProvider dependencyMetaDataProvider, + ScriptClassPathResolver scriptClassPathResolver) { + this.dependencyManagementServices = dependencyManagementServices; + this.fileResolver = fileResolver; + this.dependencyMetaDataProvider = dependencyMetaDataProvider; + this.scriptClassPathResolver = scriptClassPathResolver; + } + + public ScriptHandlerInternal create(ScriptSource scriptSource, ClassLoaderScope classLoaderScope) { + return create(scriptSource, classLoaderScope, RootScriptDomainObjectContext.INSTANCE); + } + + public ScriptHandlerInternal create(ScriptSource scriptSource, ClassLoaderScope classLoaderScope, DomainObjectContext context) { + DependencyResolutionServices services = dependencyManagementServices.create(fileResolver, dependencyMetaDataProvider, projectFinder, context); + return new DefaultScriptHandler(scriptSource, services, classLoaderScope, scriptClassPathResolver); + } + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/plugins/ImperativeOnlyPluginTarget.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/plugins/ImperativeOnlyPluginTarget.java new file mode 100644 index 0000000..e97a5f9 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/plugins/ImperativeOnlyPluginTarget.java @@ -0,0 +1,58 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.plugins; + +import org.gradle.api.Plugin; +import org.gradle.configuration.ConfigurationTargetIdentifier; + +import javax.annotation.Nullable; + +import static org.gradle.internal.Cast.uncheckedCast; + +public class ImperativeOnlyPluginTarget implements PluginTarget { + + private final T target; + + public ImperativeOnlyPluginTarget(T target) { + this.target = target; + } + + @Override + public ConfigurationTargetIdentifier getConfigurationTargetIdentifier() { + return target.getConfigurationTargetIdentifier(); + } + + public void applyImperative(@Nullable String pluginId, Plugin plugin) { + // TODO validate that the plugin accepts this kind of argument + Plugin cast = uncheckedCast(plugin); + cast.apply(target); + } + + public void applyRules(@Nullable String pluginId, Class clazz) { + String message = String.format("Cannot apply model rules of plugin '%s' as the target '%s' is not model rule aware", clazz.getName(), target.toString()); + throw new UnsupportedOperationException(message); + } + + public void applyImperativeRulesHybrid(@Nullable String pluginId, Plugin plugin) { + applyRules(pluginId, plugin.getClass()); + } + + @Override + public String toString() { + return target.toString(); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/project/ant/AntLoggingAdapterFactory.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/project/ant/AntLoggingAdapterFactory.java new file mode 100644 index 0000000..afc97a8 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/project/ant/AntLoggingAdapterFactory.java @@ -0,0 +1,22 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.project.ant; + +import org.gradle.internal.Factory; + +public interface AntLoggingAdapterFactory extends Factory { +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/project/ant/DefaultAntLoggingAdapterFactory.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/project/ant/DefaultAntLoggingAdapterFactory.java new file mode 100644 index 0000000..9da4a0e --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/project/ant/DefaultAntLoggingAdapterFactory.java @@ -0,0 +1,24 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.project.ant; + +public class DefaultAntLoggingAdapterFactory implements AntLoggingAdapterFactory { + @Override + public AntLoggingAdapter create() { + return new AntLoggingAdapter(); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/project/taskfactory/TaskActionFactory.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/project/taskfactory/TaskActionFactory.java new file mode 100644 index 0000000..b044e7a --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/project/taskfactory/TaskActionFactory.java @@ -0,0 +1,31 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.project.taskfactory; + +import org.gradle.api.Action; +import org.gradle.api.NonNullApi; +import org.gradle.api.Task; +import org.gradle.internal.Factory; + +import javax.annotation.Nonnull; + +@NonNullApi +public interface TaskActionFactory extends Factory> { + @Override + @Nonnull + Action create(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/specs/ExplainingSpec.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/specs/ExplainingSpec.java new file mode 100644 index 0000000..8402af4 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/specs/ExplainingSpec.java @@ -0,0 +1,35 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.specs; + +import org.gradle.api.specs.Spec; + +/** + * A predicate against objects of type T that can explain the unsatisfied reason. + * + * @param The target type for this Spec + */ +public interface ExplainingSpec extends Spec { + + /** + * Explains why the spec is not satisfied. + * + * @param element candidate + * @return the description. Must not be null if the spec is not satisfied. Is null if spec is satisfied. + */ + String whyUnsatisfied(T element); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/tasks/options/MultipleValueOptionElement.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/tasks/options/MultipleValueOptionElement.java new file mode 100644 index 0000000..7730e69 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/tasks/options/MultipleValueOptionElement.java @@ -0,0 +1,54 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.options; + +import org.gradle.api.tasks.options.Option; +import org.gradle.internal.typeconversion.NotationParser; +import org.gradle.internal.typeconversion.TypeConversionException; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Set; + +/** + * An option with one or more values. + */ +public class MultipleValueOptionElement extends AbstractOptionElement { + private final PropertySetter setter; + private final NotationParser notationParser; + + public MultipleValueOptionElement(String optionName, Option option, Class elementType, PropertySetter setter, OptionValueNotationParserFactory notationParserFactory) { + super(optionName, option, List.class, setter.getDeclaringClass()); + this.setter = setter; + this.notationParser = createNotationParserOrFail(notationParserFactory, optionName, elementType, setter.getDeclaringClass()); + } + + @Override + public Set getAvailableValues() { + return Collections.emptySet(); + } + + @Override + public void apply(Object object, List parameterValues) throws TypeConversionException { + List values = new ArrayList(parameterValues.size()); + for (String parameterValue : parameterValues) { + values.add(notationParser.parseNotation(parameterValue)); + } + setter.setValue(object, values); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/tasks/properties/CompositePropertyVisitor.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/tasks/properties/CompositePropertyVisitor.java new file mode 100644 index 0000000..ee0a07d --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/tasks/properties/CompositePropertyVisitor.java @@ -0,0 +1,76 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.properties; + +import org.gradle.api.internal.tasks.TaskDestroyablePropertySpec; +import org.gradle.api.internal.tasks.TaskInputFilePropertySpec; +import org.gradle.api.internal.tasks.TaskInputPropertySpec; +import org.gradle.api.internal.tasks.TaskLocalStatePropertySpec; +import org.gradle.api.internal.tasks.TaskOutputFilePropertySpec; + +public class CompositePropertyVisitor implements PropertyVisitor { + private final PropertyVisitor[] visitors; + + public CompositePropertyVisitor(PropertyVisitor... visitors) { + this.visitors = visitors; + } + + @Override + public boolean visitOutputFilePropertiesOnly() { + for (PropertyVisitor visitor : visitors) { + if (!visitor.visitOutputFilePropertiesOnly()) { + return false; + } + } + return true; + } + + @Override + public void visitInputFileProperty(TaskInputFilePropertySpec inputFileProperty) { + for (PropertyVisitor visitor : visitors) { + visitor.visitInputFileProperty(inputFileProperty); + } + } + + @Override + public void visitInputProperty(TaskInputPropertySpec inputProperty) { + for (PropertyVisitor visitor : visitors) { + visitor.visitInputProperty(inputProperty); + } + } + + @Override + public void visitOutputFileProperty(TaskOutputFilePropertySpec outputFileProperty) { + for (PropertyVisitor visitor : visitors) { + visitor.visitOutputFileProperty(outputFileProperty); + } + } + + @Override + public void visitDestroyableProperty(TaskDestroyablePropertySpec destroyableProperty) { + for (PropertyVisitor visitor : visitors) { + visitor.visitDestroyableProperty(destroyableProperty); + } + } + + @Override + public void visitLocalStateProperty(TaskLocalStatePropertySpec localStateProperty) { + for (PropertyVisitor visitor : visitors) { + visitor.visitLocalStateProperty(localStateProperty); + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/tasks/properties/bean/MapRuntimeBeanNode.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/tasks/properties/bean/MapRuntimeBeanNode.java new file mode 100644 index 0000000..4ca58e0 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/tasks/properties/bean/MapRuntimeBeanNode.java @@ -0,0 +1,42 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.properties.bean; + +import com.google.common.base.Preconditions; +import org.gradle.api.internal.tasks.PropertySpecFactory; +import org.gradle.api.internal.tasks.properties.PropertyVisitor; +import org.gradle.api.internal.tasks.properties.TypeMetadata; + +import java.util.Map; +import java.util.Queue; + +class MapRuntimeBeanNode extends RuntimeBeanNode> { + public MapRuntimeBeanNode(RuntimeBeanNode parentNode, String propertyName, Map map, TypeMetadata typeMetadata) { + super(parentNode, propertyName, map, typeMetadata); + } + + @Override + public void visitNode(PropertyVisitor visitor, PropertySpecFactory specFactory, Queue> queue, RuntimeBeanNodeFactory nodeFactory) { + for (Map.Entry entry : getBean().entrySet()) { + RuntimeBeanNode childNode = createChildNode( + Preconditions.checkNotNull(entry.getKey(), "Null keys in nested map '%s' are not allowed.", getPropertyName()).toString(), + entry.getValue(), + nodeFactory); + queue.add(childNode); + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/tasks/properties/bean/package-info.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/tasks/properties/bean/package-info.java new file mode 100644 index 0000000..6ee6f2a --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/internal/tasks/properties/bean/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@NonNullApi +package org.gradle.api.internal.tasks.properties.bean; + +import org.gradle.api.NonNullApi; diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/tasks/options/package-info.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/tasks/options/package-info.java new file mode 100644 index 0000000..c7c90c2 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/api/tasks/options/package-info.java @@ -0,0 +1,23 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Annotations for exposing task properties as command line options. + * + * @since 4.6 + */ +@org.gradle.api.Incubating +package org.gradle.api.tasks.options; diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/configuration/ProjectScriptTarget.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/configuration/ProjectScriptTarget.java new file mode 100644 index 0000000..0f361e1 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/configuration/ProjectScriptTarget.java @@ -0,0 +1,80 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.configuration; + +import groovy.lang.Script; +import org.gradle.api.internal.plugins.PluginManagerInternal; +import org.gradle.api.internal.project.ProjectInternal; +import org.gradle.api.internal.project.ProjectScript; +import org.gradle.groovy.scripts.BasicScript; + +public class ProjectScriptTarget implements ScriptTarget { + private final ProjectInternal target; + + public ProjectScriptTarget(ProjectInternal target) { + this.target = target; + } + + @Override + public PluginManagerInternal getPluginManager() { + return target.getPluginManager(); + } + + @Override + public String getId() { + return "proj"; + } + + @Override + public String getClasspathBlockName() { + return "buildscript"; + } + + @Override + public boolean getSupportsPluginsBlock() { + return true; + } + + @Override + public boolean getSupportsPluginManagementBlock() { + return false; + } + + @Override + public boolean getSupportsMethodInheritance() { + return true; + } + + @Override + public Class getScriptClass() { + return ProjectScript.class; + } + + @Override + public void attachScript(Script script) { + target.setScript(script); + } + + @Override + public void addConfiguration(Runnable runnable, boolean deferrable) { + if (deferrable) { + target.addDeferredConfiguration(runnable); + } else { + runnable.run(); + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/configuration/project/NotifyProjectAfterEvaluatedBuildOperationType.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/configuration/project/NotifyProjectAfterEvaluatedBuildOperationType.java new file mode 100644 index 0000000..2a4bd36 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/configuration/project/NotifyProjectAfterEvaluatedBuildOperationType.java @@ -0,0 +1,69 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.configuration.project; + +import org.gradle.internal.operations.BuildOperationType; +import org.gradle.internal.scan.UsedByScanPlugin; +import org.gradle.util.Path; + +/** + * Execution of a project's afterEvaluate hooks + * + * @since 4.9 + */ +public final class NotifyProjectAfterEvaluatedBuildOperationType implements BuildOperationType { + + @UsedByScanPlugin + public interface Details { + + String getProjectPath(); + + String getBuildPath(); + + } + + public interface Result { + + } + + static class DetailsImpl implements Details { + + private final Path buildPath; + private final Path projectPath; + + DetailsImpl(Path projectPath, Path buildPath) { + this.projectPath = projectPath; + this.buildPath = buildPath; + } + + public String getProjectPath() { + return projectPath.getPath(); + } + + public String getBuildPath() { + return buildPath.getPath(); + } + + } + + final static Result RESULT = new Result() { + }; + + private NotifyProjectAfterEvaluatedBuildOperationType() { + } + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/initialization/BuildRequestContext.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/initialization/BuildRequestContext.java new file mode 100644 index 0000000..0e73950 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/initialization/BuildRequestContext.java @@ -0,0 +1,32 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.initialization; + +/** + * Provides access to services provided by build requester. + */ +public interface BuildRequestContext extends BuildRequestMetaData { + /** + * Returns the cancellation token through which the requester can cancel the build. + */ + BuildCancellationToken getCancellationToken(); + + /** + * Returns an event consumer that will forward events to the build requester. + */ + BuildEventConsumer getEventConsumer(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/initialization/EvaluateSettingsBuildOperationType.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/initialization/EvaluateSettingsBuildOperationType.java new file mode 100644 index 0000000..dcdde12 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/initialization/EvaluateSettingsBuildOperationType.java @@ -0,0 +1,45 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.initialization; + +import org.gradle.internal.operations.BuildOperationType; +import org.gradle.internal.scan.UsedByScanPlugin; + +public class EvaluateSettingsBuildOperationType implements BuildOperationType { + @UsedByScanPlugin + public interface Details { + /** + * @since 4.6 + */ + String getBuildPath(); + + /** + * The absolute path to the settings directory. + */ + String getSettingsDir(); + + /** + * The absolute path to the settings file. + */ + String getSettingsFile(); + } + + public interface Result { + } + + private EvaluateSettingsBuildOperationType(){} +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/initialization/ParallelismBuildOptions.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/initialization/ParallelismBuildOptions.java new file mode 100644 index 0000000..86f8146 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/initialization/ParallelismBuildOptions.java @@ -0,0 +1,84 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.initialization; + +import org.gradle.concurrent.ParallelismConfiguration; +import org.gradle.internal.buildoption.BooleanBuildOption; +import org.gradle.internal.buildoption.BooleanCommandLineOptionConfiguration; +import org.gradle.internal.buildoption.BuildOption; +import org.gradle.internal.buildoption.CommandLineOptionConfiguration; +import org.gradle.internal.buildoption.Origin; +import org.gradle.internal.buildoption.StringBuildOption; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class ParallelismBuildOptions { + + private static List> options; + + static { + List> options = new ArrayList>(); + options.add(new ParallelOption()); + options.add(new MaxWorkersOption()); + ParallelismBuildOptions.options = Collections.unmodifiableList(options); + } + + public static List> get() { + return options; + } + + private ParallelismBuildOptions() { + } + + public static class ParallelOption extends BooleanBuildOption { + public static final String GRADLE_PROPERTY = "org.gradle.parallel"; + + public ParallelOption() { + super(GRADLE_PROPERTY, BooleanCommandLineOptionConfiguration.create("parallel", "Build projects in parallel. Gradle will attempt to determine the optimal number of executor threads to use.", "Disables parallel execution to build projects.")); + } + + @Override + public void applyTo(boolean value, ParallelismConfiguration settings, Origin origin) { + settings.setParallelProjectExecutionEnabled(value); + } + } + + public static class MaxWorkersOption extends StringBuildOption { + public static final String GRADLE_PROPERTY = "org.gradle.workers.max"; + public static final String LONG_OPTION = "max-workers"; + public static final String HINT = "must be a positive, non-zero, integer"; + + public MaxWorkersOption() { + super(GRADLE_PROPERTY, CommandLineOptionConfiguration.create(LONG_OPTION, "Configure the number of concurrent workers Gradle is allowed to use.")); + } + + @Override + public void applyTo(String value, ParallelismConfiguration settings, Origin origin) { + try { + int workerCount = Integer.parseInt(value); + if (workerCount < 1) { + origin.handleInvalidValue(value, HINT); + } + settings.setMaxWorkerCount(workerCount); + } catch (NumberFormatException e) { + origin.handleInvalidValue(value, HINT); + } + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/initialization/exception/StackTraceSanitizingExceptionAnalyser.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/initialization/exception/StackTraceSanitizingExceptionAnalyser.java new file mode 100644 index 0000000..ca26e47 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/initialization/exception/StackTraceSanitizingExceptionAnalyser.java @@ -0,0 +1,31 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.initialization.exception; + +import org.codehaus.groovy.runtime.StackTraceUtils; + +public class StackTraceSanitizingExceptionAnalyser implements ExceptionAnalyser { + private final ExceptionAnalyser analyser; + + public StackTraceSanitizingExceptionAnalyser(ExceptionAnalyser analyser) { + this.analyser = analyser; + } + + public RuntimeException transform(Throwable exception) { + return (RuntimeException) StackTraceUtils.deepSanitize(analyser.transform(exception)); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/internal/filewatch/SingleFirePendingChangesListener.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/internal/filewatch/SingleFirePendingChangesListener.java new file mode 100644 index 0000000..11b5e0f --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/internal/filewatch/SingleFirePendingChangesListener.java @@ -0,0 +1,43 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.filewatch; + +import org.gradle.api.logging.Logger; +import org.gradle.api.logging.Logging; + +public class SingleFirePendingChangesListener implements PendingChangesListener { + private static final Logger LOGGER = Logging.getLogger(SingleFirePendingChangesListener.class); + + private final PendingChangesListener delegate; + private boolean seenChanges; + + public SingleFirePendingChangesListener(PendingChangesListener delegate) { + this.delegate = delegate; + } + + @Override + public void onPendingChanges() { + // Only fire once + if (!seenChanges) { + LOGGER.debug("notifying pending changes"); + delegate.onPendingChanges(); + seenChanges = true; + } else { + LOGGER.debug("already notified"); + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/internal/filewatch/jdk7/WatchServiceRegistrar.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/internal/filewatch/jdk7/WatchServiceRegistrar.java new file mode 100644 index 0000000..6f2e18c --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/internal/filewatch/jdk7/WatchServiceRegistrar.java @@ -0,0 +1,280 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.filewatch.jdk7; + +import com.google.common.base.Throwables; +import org.gradle.api.JavaVersion; +import org.gradle.api.internal.file.FileSystemSubset; +import org.gradle.api.logging.Logger; +import org.gradle.api.logging.Logging; +import org.gradle.internal.UncheckedException; +import org.gradle.internal.filewatch.FileWatcher; +import org.gradle.internal.filewatch.FileWatcherEvent; +import org.gradle.internal.filewatch.FileWatcherListener; +import org.gradle.internal.os.OperatingSystem; + +import java.io.File; +import java.io.IOException; +import java.nio.file.FileSystemException; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.NoSuchFileException; +import java.nio.file.Path; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.StandardWatchEventKinds; +import java.nio.file.WatchEvent; +import java.nio.file.WatchKey; +import java.nio.file.WatchService; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + +class WatchServiceRegistrar implements FileWatcherListener { + private final static Logger LOG = Logging.getLogger(WatchServiceRegistrar.class); + private static final boolean FILE_TREE_WATCHING_SUPPORTED = OperatingSystem.current().isWindows() && !JavaVersion.current().isJava9Compatible(); + private static final WatchEvent.Modifier[] WATCH_MODIFIERS = instantiateWatchModifiers(); + private static final WatchEvent.Kind[] WATCH_KINDS = new WatchEvent.Kind[]{StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY}; + + private final WatchService watchService; + private final FileWatcherListener delegate; + private final Lock lock = new ReentrantLock(true); + private final WatchPointsRegistry watchPointsRegistry; + private final HashMap watchKeys = new HashMap(); + + WatchServiceRegistrar(WatchService watchService, FileWatcherListener delegate) { + this.watchService = watchService; + this.delegate = delegate; + this.watchPointsRegistry = new WatchPointsRegistry(!FILE_TREE_WATCHING_SUPPORTED); + } + + private static WatchEvent.Modifier[] instantiateWatchModifiers() { + if (JavaVersion.current().isJava9Compatible()) { + return new WatchEvent.Modifier[]{}; + } else { + // use reflection to support older JVMs while supporting Java 9 + WatchEvent.Modifier highSensitive = instantiateEnum("com.sun.nio.file.SensitivityWatchEventModifier", "HIGH"); + if (FILE_TREE_WATCHING_SUPPORTED) { + WatchEvent.Modifier fileTree = instantiateEnum("com.sun.nio.file.ExtendedWatchEventModifier", "FILE_TREE"); + return new WatchEvent.Modifier[]{fileTree, highSensitive}; + } else { + return new WatchEvent.Modifier[]{highSensitive}; + } + } + } + + private static WatchEvent.Modifier instantiateEnum(String className, String enumName) { + try { + return (WatchEvent.Modifier) Enum.valueOf((Class) Class.forName(className), enumName); + } catch (ClassNotFoundException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + + void watch(FileSystemSubset fileSystemSubset) throws IOException { + lock.lock(); + try { + LOG.debug("Begin - adding watches for {}", fileSystemSubset); + final WatchPointsRegistry.Delta delta = watchPointsRegistry.appendFileSystemSubset(fileSystemSubset, getCurrentWatchPoints()); + Iterable startingWatchPoints = delta.getStartingWatchPoints(); + + for (File dir : startingWatchPoints) { + LOG.debug("Begin - handling starting point {}", dir); + final Path dirPath = dir.toPath(); + watchDir(dirPath); + if (!FILE_TREE_WATCHING_SUPPORTED) { + Files.walkFileTree(dirPath, new SimpleFileVisitor() { + @Override + public FileVisitResult preVisitDirectory(Path path, BasicFileAttributes attrs) throws IOException { + if (!path.equals(dirPath)) { + if (delta.shouldWatch(path.toFile())) { + watchDir(path); + return FileVisitResult.CONTINUE; + } else { + LOG.debug("Skipping watching for {}, filtered by WatchPointsRegistry", path); + return FileVisitResult.SKIP_SUBTREE; + } + } else { + return FileVisitResult.CONTINUE; + } + } + }); + } + LOG.debug("End - handling starting point {}", dir); + } + LOG.debug("End - adding watches for {}", fileSystemSubset); + } finally { + lock.unlock(); + } + } + + private Iterable getCurrentWatchPoints() { + List currentWatchPoints = new LinkedList(); + for (Map.Entry entry : watchKeys.entrySet()) { + if (entry.getValue().isValid()) { + currentWatchPoints.add(entry.getKey().toFile()); + } + } + return currentWatchPoints; + } + + protected void watchDir(Path dir) throws IOException { + LOG.debug("Registering watch for {}", dir); + if (Thread.currentThread().isInterrupted()) { + LOG.debug("Skipping adding watch since current thread is interrupted."); + } + + // check if directory is already watched + // on Windows, check if any parent is already watched + for (Path path = dir; path != null; path = FILE_TREE_WATCHING_SUPPORTED ? path.getParent() : null) { + WatchKey previousWatchKey = watchKeys.get(path); + if (previousWatchKey != null && previousWatchKey.isValid()) { + LOG.debug("Directory {} is already watched and the watch is valid, not adding another one.", path); + return; + } + } + + int retryCount = 0; + IOException lastException = null; + while (retryCount++ < 2) { + try { + WatchKey watchKey = dir.register(watchService, WATCH_KINDS, WATCH_MODIFIERS); + watchKeys.put(dir, watchKey); + return; + } catch (IOException e) { + LOG.debug("Exception in registering for watching of " + dir, e); + lastException = e; + + if (e instanceof NoSuchFileException) { + LOG.debug("Return silently since directory doesn't exist."); + return; + } + + if (e instanceof FileSystemException && e.getMessage() != null && e.getMessage().contains("Bad file descriptor")) { + // retry after getting "Bad file descriptor" exception + LOG.debug("Retrying after 'Bad file descriptor'"); + continue; + } + + // Windows at least will sometimes throw odd exceptions like java.nio.file.AccessDeniedException + // if the file gets deleted while the watch is being set up. + // So, we just ignore the exception if the dir doesn't exist anymore + if (!Files.exists(dir)) { + // return silently when directory doesn't exist + LOG.debug("Return silently since directory doesn't exist."); + return; + } else { + // no retry + throw e; + } + } + } + LOG.debug("Retry count exceeded, throwing last exception"); + throw lastException; + } + + + @Override + public void onChange(FileWatcher watcher, FileWatcherEvent event) { + lock.lock(); + try { + if (event.getType().equals(FileWatcherEvent.Type.UNDEFINED) || event.getFile() == null) { + LOG.debug("Calling onChange with event {}", event); + deliverEventToDelegate(watcher, event); + return; + } + + File file = event.getFile(); + maybeFire(watcher, event); + + if (event.getType().equals(FileWatcherEvent.Type.CREATE) && file.isDirectory()) { + try { + maybeWatchNewDirectory(watcher, file); + } catch (IOException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + } finally { + lock.unlock(); + } + } + + protected void deliverEventToDelegate(FileWatcher watcher, FileWatcherEvent event) { + if(!Thread.currentThread().isInterrupted()) { + try { + delegate.onChange(watcher, event); + } catch (RuntimeException e) { + if (Throwables.getRootCause(e) instanceof InterruptedException) { + // delivery was interrupted, return silently + return; + } + throw e; + } + } else { + LOG.debug("Skipping event delivery since current thread is interrupted."); + } + } + + private void maybeFire(FileWatcher watcher, FileWatcherEvent event) { + if (watchPointsRegistry.shouldFire(event.getFile())) { + LOG.debug("Calling onChange with event {}", event); + deliverEventToDelegate(watcher, event); + } else { + LOG.debug("Ignoring event {}", event); + } + } + + private void maybeWatchNewDirectory(FileWatcher watcher, File dir) throws IOException { + LOG.debug("Begin - maybeWatchNewDirectory {}", dir); + if (isStopRequested(watcher)) { + LOG.debug("Stop requested, returning."); + return; + } + if (!watchPointsRegistry.shouldWatch(dir)) { + LOG.debug("Ignoring watching {}", dir); + return; + } + if (dir.exists()) { + if (!FILE_TREE_WATCHING_SUPPORTED) { + watchDir(dir.toPath()); + } + File[] contents = dir.listFiles(); + if (contents != null) { + for (File file : contents) { + if (isStopRequested(watcher)) { + LOG.debug("Stop requested, returning."); + return; + } + maybeFire(watcher, FileWatcherEvent.create(file)); + if (file.isDirectory()) { + maybeWatchNewDirectory(watcher, file); + } + } + } + } + LOG.debug("End - maybeWatchNewDirectory {}", dir); + } + + private boolean isStopRequested(FileWatcher watcher) { + return Thread.currentThread().isInterrupted() || !watcher.isRunning(); + } + +} + diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/internal/fingerprint/classpath/impl/DefaultClasspathFingerprinter.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/internal/fingerprint/classpath/impl/DefaultClasspathFingerprinter.java new file mode 100644 index 0000000..c93a142 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/internal/fingerprint/classpath/impl/DefaultClasspathFingerprinter.java @@ -0,0 +1,63 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.fingerprint.classpath.impl; + +import org.gradle.api.file.FileCollection; +import org.gradle.api.internal.cache.StringInterner; +import org.gradle.api.internal.changedetection.state.ResourceFilter; +import org.gradle.api.internal.changedetection.state.ResourceSnapshotterCacheService; +import org.gradle.api.internal.changedetection.state.RuntimeClasspathResourceHasher; +import org.gradle.api.tasks.ClasspathNormalizer; +import org.gradle.api.tasks.FileNormalizer; +import org.gradle.internal.fingerprint.CurrentFileCollectionFingerprint; +import org.gradle.internal.fingerprint.classpath.ClasspathFingerprinter; +import org.gradle.internal.fingerprint.impl.AbstractFileCollectionFingerprinter; +import org.gradle.internal.snapshot.FileSystemSnapshotter; + +public class DefaultClasspathFingerprinter extends AbstractFileCollectionFingerprinter implements ClasspathFingerprinter { + private final ClasspathFingerprintingStrategy fingerprintingStrategy; + + public DefaultClasspathFingerprinter( + ResourceSnapshotterCacheService cacheService, + FileSystemSnapshotter fileSystemSnapshotter, + ResourceFilter classpathResourceFilter, + StringInterner stringInterner + ) { + super(stringInterner, fileSystemSnapshotter); + this.fingerprintingStrategy = ClasspathFingerprintingStrategy.runtimeClasspath( + classpathResourceFilter, + new RuntimeClasspathResourceHasher(), + cacheService, + stringInterner + ); + } + + @Override + public Class getRegisteredType() { + return ClasspathNormalizer.class; + } + + @Override + public CurrentFileCollectionFingerprint empty() { + return fingerprintingStrategy.getEmptyFingerprint(); + } + + @Override + public CurrentFileCollectionFingerprint fingerprint(FileCollection files) { + return super.fingerprint(files, fingerprintingStrategy); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/process/internal/worker/child/WorkerDirectoryProvider.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/process/internal/worker/child/WorkerDirectoryProvider.java new file mode 100644 index 0000000..037c880 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/core/org/gradle/process/internal/worker/child/WorkerDirectoryProvider.java @@ -0,0 +1,26 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.process.internal.worker.child; + +import java.io.File; + +public interface WorkerDirectoryProvider { + /** + * Returns a File object representing the working directory for workers. + */ + File getWorkingDirectory(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/ComponentMetadataProcessorFactory.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/ComponentMetadataProcessorFactory.java new file mode 100644 index 0000000..f87d197 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/ComponentMetadataProcessorFactory.java @@ -0,0 +1,37 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts; + +/** + * A factory for {@link ComponentMetadataProcessor}. + *

+ * In a build, {@link org.gradle.api.artifacts.ComponentMetadataRule component metadata rules} can be added to transform dependencies metadata. + * These are registered with the {@link org.gradle.api.artifacts.dsl.ComponentMetadataHandler ComponentMetadataHandler} which does not have contextual information, + * such as the repository from which the dependency comes from. + *

+ * The {@link MetadataResolutionContext} enables a {@link ComponentMetadataProcessor} to execute with the proper context. + */ +public interface ComponentMetadataProcessorFactory { + + /** + * Creates a contextual {@link ComponentMetadataProcessor} + * + * @param resolutionContext the provided context + * @return a {@code ComponentMetadataProcessor} + */ + ComponentMetadataProcessor createComponentMetadataProcessor(MetadataResolutionContext resolutionContext); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/DefaultDependencySet.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/DefaultDependencySet.java new file mode 100644 index 0000000..ad3535f --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/DefaultDependencySet.java @@ -0,0 +1,87 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts; + +import org.gradle.api.Action; +import org.gradle.api.Describable; +import org.gradle.api.DomainObjectSet; +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.artifacts.Dependency; +import org.gradle.api.artifacts.DependencySet; +import org.gradle.api.artifacts.ModuleDependency; +import org.gradle.api.internal.DelegatingDomainObjectSet; +import org.gradle.api.internal.artifacts.configurations.MutationValidator; +import org.gradle.api.internal.artifacts.dependencies.AbstractModuleDependency; +import org.gradle.api.tasks.TaskDependency; +import org.gradle.internal.Actions; + +import java.util.Collection; + +public class DefaultDependencySet extends DelegatingDomainObjectSet implements DependencySet { + private final Describable displayName; + private final Configuration clientConfiguration; + private final Action mutationValidator; + + public DefaultDependencySet(Describable displayName, final Configuration clientConfiguration, DomainObjectSet backingSet) { + super(backingSet); + this.displayName = displayName; + this.clientConfiguration = clientConfiguration; + this.mutationValidator = toMutationValidator(clientConfiguration); + } + + protected Action toMutationValidator(final Configuration clientConfiguration) { + return clientConfiguration instanceof MutationValidator ? new MutationValidationAction(clientConfiguration) : Actions.doNothing(); + } + + @Override + public String toString() { + return displayName.getDisplayName(); + } + + public TaskDependency getBuildDependencies() { + return clientConfiguration.getBuildDependencies(); + } + + @Override + public boolean add(final Dependency o) { + if (o instanceof AbstractModuleDependency) { + ((AbstractModuleDependency) o).addMutationValidator(mutationValidator); + } + return super.add(o); + } + + @Override + public boolean addAll(Collection dependencies) { + boolean added = false; + for (Dependency dependency : dependencies) { + added |= add(dependency); + } + return added; + } + + private static class MutationValidationAction implements Action { + private final Configuration clientConfiguration; + + public MutationValidationAction(Configuration clientConfiguration) { + this.clientConfiguration = clientConfiguration; + } + + @Override + public void execute(ModuleDependency moduleDependency) { + ((MutationValidator) clientConfiguration).validateMutation(MutationValidator.MutationType.DEPENDENCY_ATTRIBUTES); + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/DependencyGraphNodeResult.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/DependencyGraphNodeResult.java new file mode 100644 index 0000000..252ae44 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/DependencyGraphNodeResult.java @@ -0,0 +1,30 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts; + +import org.gradle.api.artifacts.ResolvedDependency; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.ResolvedArtifactSet; + +import java.util.Collection; + +public interface DependencyGraphNodeResult { + ResolvedDependency getPublicView(); + + Collection getOutgoingEdges(); + + ResolvedArtifactSet getArtifactsForNode(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/DownloadArtifactBuildOperationType.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/DownloadArtifactBuildOperationType.java new file mode 100644 index 0000000..853d7dd --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/DownloadArtifactBuildOperationType.java @@ -0,0 +1,60 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts; + +import org.gradle.internal.operations.BuildOperationType; +import org.gradle.internal.scan.UsedByScanPlugin; + +/** + * Details about an artifact being downloaded. + * + * @since 4.0 + */ +public final class DownloadArtifactBuildOperationType implements BuildOperationType { + + @UsedByScanPlugin + public interface Details { + + String getArtifactIdentifier(); + + } + + public interface Result { + + } + + public static class DetailsImpl implements Details { + + private String artifactIdentifier; + + public DetailsImpl(String artifactIdentifier) { + this.artifactIdentifier = artifactIdentifier; + } + + public String getArtifactIdentifier() { + return artifactIdentifier; + } + + } + + public final static Result RESULT = new Result() { + }; + + private DownloadArtifactBuildOperationType() { + } + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/dependencies/DefaultMutableVersionConstraint.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/dependencies/DefaultMutableVersionConstraint.java new file mode 100644 index 0000000..64145e4 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/dependencies/DefaultMutableVersionConstraint.java @@ -0,0 +1,136 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.dependencies; + +import com.google.common.collect.Lists; +import org.gradle.api.artifacts.VersionConstraint; +import org.gradle.api.internal.artifacts.ImmutableVersionConstraint; +import org.gradle.api.internal.artifacts.VersionConstraintInternal; + +import javax.annotation.Nullable; +import java.util.Collections; +import java.util.List; + +import static com.google.common.base.Strings.nullToEmpty; + +public class DefaultMutableVersionConstraint extends AbstractVersionConstraint implements VersionConstraintInternal { + private String requiredVersion; + private String preferredVersion; + private String strictVersion; + private String branch; + private final List rejectedVersions = Lists.newArrayListWithExpectedSize(1); + + public DefaultMutableVersionConstraint(VersionConstraint versionConstraint) { + this(versionConstraint.getPreferredVersion(), versionConstraint.getRequiredVersion(), versionConstraint.getStrictVersion(), versionConstraint.getRejectedVersions()); + } + + public DefaultMutableVersionConstraint(String version) { + this(null, version, null); + } + + private DefaultMutableVersionConstraint(String preferredVersion, String requiredVersion, String strictVersion) { + this(preferredVersion, requiredVersion, strictVersion, Collections.emptyList()); + } + + private DefaultMutableVersionConstraint(String preferredVersion, String requiredVersion, String strictVersion, List rejects) { + updateVersions(preferredVersion, requiredVersion, strictVersion); + for (String reject : rejects) { + this.rejectedVersions.add(nullToEmpty(reject)); + } + } + + private void updateVersions(String preferredVersion, String requiredVersion, String strictVersion) { + this.preferredVersion = nullToEmpty(preferredVersion); + this.requiredVersion = nullToEmpty(requiredVersion); + this.strictVersion = nullToEmpty(strictVersion); + this.rejectedVersions.clear(); + } + + public static DefaultMutableVersionConstraint withVersion(String version) { + return new DefaultMutableVersionConstraint(version); + } + + public static DefaultMutableVersionConstraint withStrictVersion(String version) { + return new DefaultMutableVersionConstraint(null, version, version); + } + + @Override + public ImmutableVersionConstraint asImmutable() { + return new DefaultImmutableVersionConstraint(preferredVersion, requiredVersion, strictVersion, rejectedVersions, branch); + } + + @Nullable + @Override + public String getBranch() { + return branch; + } + + @Override + public void setBranch(String branch) { + this.branch = branch; + } + + @Override + public String getRequiredVersion() { + return requiredVersion; + } + + @Override + public void require(String version) { + updateVersions(preferredVersion, version, null); + } + + @Override + public String getPreferredVersion() { + return preferredVersion; + } + + @Override + public void prefer(String version) { + updateVersions(version, requiredVersion, strictVersion); + } + + @Override + public String getStrictVersion() { + return strictVersion; + } + + @Override + public void strictly(String version) { + updateVersions(null, version, version); + } + + @Override + public void reject(String... versions) { + this.rejectedVersions.clear(); + Collections.addAll(rejectedVersions, versions); + } + + @Override + public void rejectAll() { + updateVersions(null, null, null); + this.rejectedVersions.add("+"); + } + + @Override + public List getRejectedVersions() { + return rejectedVersions; + } + + public String getVersion() { + return requiredVersion.isEmpty() ? preferredVersion : requiredVersion; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/dsl/DefaultComponentMetadataProcessor.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/dsl/DefaultComponentMetadataProcessor.java new file mode 100644 index 0000000..f7e79a8 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/dsl/DefaultComponentMetadataProcessor.java @@ -0,0 +1,400 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.dsl; + +import com.google.common.collect.Lists; +import org.gradle.api.Action; +import org.gradle.api.InvalidUserCodeException; +import org.gradle.api.Transformer; +import org.gradle.api.artifacts.ComponentMetadata; +import org.gradle.api.artifacts.ComponentMetadataContext; +import org.gradle.api.artifacts.ComponentMetadataDetails; +import org.gradle.api.artifacts.ModuleVersionIdentifier; +import org.gradle.api.artifacts.VariantMetadata; +import org.gradle.api.artifacts.component.ComponentIdentifier; +import org.gradle.api.artifacts.ivy.IvyModuleDescriptor; +import org.gradle.api.attributes.AttributeContainer; +import org.gradle.api.internal.artifacts.ComponentMetadataProcessor; +import org.gradle.api.internal.artifacts.MetadataResolutionContext; +import org.gradle.api.internal.artifacts.ivyservice.DefaultIvyModuleDescriptor; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.UserProvidedMetadata; +import org.gradle.api.internal.artifacts.repositories.resolver.ComponentMetadataDetailsAdapter; +import org.gradle.api.internal.artifacts.repositories.resolver.DependencyConstraintMetadataImpl; +import org.gradle.api.internal.artifacts.repositories.resolver.DirectDependencyMetadataImpl; +import org.gradle.api.internal.attributes.AttributeContainerInternal; +import org.gradle.api.internal.attributes.ImmutableAttributesFactory; +import org.gradle.api.internal.project.ProjectInternal; +import org.gradle.internal.Actions; +import org.gradle.internal.action.ConfigurableRule; +import org.gradle.internal.action.DefaultConfigurableRules; +import org.gradle.internal.action.InstantiatingAction; +import org.gradle.internal.component.external.model.ModuleComponentResolveMetadata; +import org.gradle.internal.component.external.model.MutableModuleComponentResolveMetadata; +import org.gradle.internal.component.external.model.ivy.DefaultIvyModuleResolveMetadata; +import org.gradle.internal.component.external.model.ivy.IvyModuleResolveMetadata; +import org.gradle.internal.component.external.model.ivy.RealisedIvyModuleResolveMetadata; +import org.gradle.internal.component.external.model.maven.DefaultMavenModuleResolveMetadata; +import org.gradle.internal.component.external.model.maven.RealisedMavenModuleResolveMetadata; +import org.gradle.internal.reflect.Instantiator; +import org.gradle.internal.resolve.ModuleVersionResolveException; +import org.gradle.internal.resolve.caching.ComponentMetadataRuleExecutor; +import org.gradle.internal.rules.RuleAction; +import org.gradle.internal.rules.SpecRuleAction; +import org.gradle.internal.serialize.InputStreamBackedDecoder; +import org.gradle.internal.serialize.OutputStreamBackedEncoder; +import org.gradle.internal.serialize.Serializer; +import org.gradle.internal.typeconversion.NotationParser; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import static org.gradle.api.internal.artifacts.repositories.resolver.VirtualComponentHelper.makeVirtual; + +public class DefaultComponentMetadataProcessor implements ComponentMetadataProcessor { + + private final static boolean FORCE_REALIZE = Boolean.getBoolean("org.gradle.integtest.force.realize.metadata"); + + private static final Transformer DETAILS_TO_RESULT = new Transformer() { + @Override + public ModuleComponentResolveMetadata transform(WrappingComponentMetadataContext componentMetadataContext) { + ModuleComponentResolveMetadata metadata = componentMetadataContext.getMutableMetadata().asImmutable(); + return realizeMetadata(metadata); + } + }; + + private ModuleComponentResolveMetadata maybeForceRealisation(ModuleComponentResolveMetadata metadata) { + if (FORCE_REALIZE) { + metadata = realizeMetadata(metadata); + metadata = forceSerialization(metadata); + } + return metadata; + } + + private static ModuleComponentResolveMetadata realizeMetadata(ModuleComponentResolveMetadata metadata) { + if (metadata instanceof DefaultIvyModuleResolveMetadata) { + metadata = RealisedIvyModuleResolveMetadata.transform((DefaultIvyModuleResolveMetadata) metadata); + } else if (metadata instanceof DefaultMavenModuleResolveMetadata) { + metadata = RealisedMavenModuleResolveMetadata.transform((DefaultMavenModuleResolveMetadata) metadata); + } else { + throw new IllegalStateException("Invalid type received: " + metadata.getClass()); + } + return metadata; + } + + private ModuleComponentResolveMetadata forceSerialization(ModuleComponentResolveMetadata metadata) { + Serializer serializer = ruleExecutor.getComponentMetadataContextSerializer(); + ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + byte[] bytes; + try { + serializer.write(new OutputStreamBackedEncoder(byteArrayOutputStream), metadata); + bytes = byteArrayOutputStream.toByteArray(); + } catch (Exception e) { + throw new RuntimeException(e); + } finally { + try { + byteArrayOutputStream.close(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + try { + ModuleComponentResolveMetadata forceRead = serializer.read(new InputStreamBackedDecoder(new ByteArrayInputStream(bytes))); + // TODO: CC cannot enable this assertion because moduleSource is not serialized, so doesn't appear in the deserialized form + //assert metadata.equals(forceRead); + metadata = forceRead; + } catch (Exception e) { + throw new RuntimeException(e); + } + return metadata; + } + + private final Instantiator instantiator; + private final NotationParser dependencyMetadataNotationParser; + private final NotationParser dependencyConstraintMetadataNotationParser; + private final NotationParser componentIdentifierNotationParser; + private final ImmutableAttributesFactory attributesFactory; + private final ComponentMetadataRuleExecutor ruleExecutor; + private final MetadataResolutionContext metadataResolutionContext; + private final ComponentMetadataRuleContainer metadataRuleContainer; + + public DefaultComponentMetadataProcessor(ComponentMetadataRuleContainer metadataRuleContainer, + Instantiator instantiator, + NotationParser dependencyMetadataNotationParser, + NotationParser dependencyConstraintMetadataNotationParser, + NotationParser componentIdentifierNotationParser, + ImmutableAttributesFactory attributesFactory, + ComponentMetadataRuleExecutor ruleExecutor, + MetadataResolutionContext resolutionContext) { + this.metadataRuleContainer = metadataRuleContainer; + this.instantiator = instantiator; + this.dependencyMetadataNotationParser = dependencyMetadataNotationParser; + this.dependencyConstraintMetadataNotationParser = dependencyConstraintMetadataNotationParser; + this.componentIdentifierNotationParser = componentIdentifierNotationParser; + this.attributesFactory = attributesFactory; + this.ruleExecutor = ruleExecutor; + this.metadataResolutionContext = resolutionContext; + } + + @Override + public ModuleComponentResolveMetadata processMetadata(ModuleComponentResolveMetadata metadata) { + metadata.getVariantMetadataRules().setVariantDerivationStrategy(metadataRuleContainer.getVariantDerivationStrategy()); + ModuleComponentResolveMetadata updatedMetadata; + if (metadataRuleContainer.isEmpty()) { + updatedMetadata = maybeForceRealisation(metadata); + } else if (metadataRuleContainer.isClassBasedRulesOnly()) { + Action action = collectRulesAndCreateAction(metadataRuleContainer.getOnlyClassRules(), metadata.getModuleVersionId(), metadataResolutionContext.getInjectingInstantiator()); + if (action instanceof InstantiatingAction) { + InstantiatingAction ia = (InstantiatingAction) action; + if (ia.getRules().isCacheable()) { + updatedMetadata = processClassRuleWithCaching(ia, metadata, metadataResolutionContext); + } else { + MutableModuleComponentResolveMetadata mutableMetadata = metadata.asMutable(); + processClassRule(action, metadata, createDetails(mutableMetadata)); + updatedMetadata = maybeForceRealisation(mutableMetadata.asImmutable()); + } + } else { + updatedMetadata = maybeForceRealisation(metadata); + } + } else { + MutableModuleComponentResolveMetadata mutableMetadata = metadata.asMutable(); + ComponentMetadataDetails details = createDetails(mutableMetadata); + processAllRules(metadata, details, metadata.getModuleVersionId()); + updatedMetadata = maybeForceRealisation(mutableMetadata.asImmutable()); + } + + if (!updatedMetadata.getStatusScheme().contains(updatedMetadata.getStatus())) { + throw new ModuleVersionResolveException(updatedMetadata.getModuleVersionId(), String.format("Unexpected status '%s' specified for %s. Expected one of: %s", updatedMetadata.getStatus(), updatedMetadata.getId().getDisplayName(), updatedMetadata.getStatusScheme())); + } + return updatedMetadata; + } + + protected ComponentMetadataDetails createDetails(MutableModuleComponentResolveMetadata mutableMetadata) { + return instantiator.newInstance(ComponentMetadataDetailsAdapter.class, mutableMetadata, instantiator, dependencyMetadataNotationParser, dependencyConstraintMetadataNotationParser, componentIdentifierNotationParser); + } + + @Override + public ComponentMetadata processMetadata(ComponentMetadata metadata) { + ComponentMetadata updatedMetadata; + if (metadataRuleContainer.isEmpty()) { + updatedMetadata = metadata; + } else { + ShallowComponentMetadataAdapter details = new ShallowComponentMetadataAdapter(componentIdentifierNotationParser, metadata, attributesFactory); + processAllRules(null, details, metadata.getId()); + updatedMetadata = details.asImmutable(); + } + if (!updatedMetadata.getStatusScheme().contains(updatedMetadata.getStatus())) { + throw new ModuleVersionResolveException(updatedMetadata.getId(), String.format("Unexpected status '%s' specified for %s. Expected one of: %s", updatedMetadata.getStatus(), updatedMetadata.getId().toString(), updatedMetadata.getStatusScheme())); + } + return updatedMetadata; + } + + @Override + public int getRulesHash() { + return metadataRuleContainer.getRulesHash(); + } + + private void processAllRules(ModuleComponentResolveMetadata metadata, ComponentMetadataDetails details, ModuleVersionIdentifier id) { + for (MetadataRuleWrapper wrapper : metadataRuleContainer) { + if (wrapper.isClassBased()) { + Collection rules = wrapper.getClassRules(); + Action action = collectRulesAndCreateAction(rules, id, instantiator); + processClassRule(action, metadata, details); + } else { + processRule(wrapper.getRule(), metadata, details); + } + } + } + + private void processClassRule(Action action, final ModuleComponentResolveMetadata metadata, final ComponentMetadataDetails details) { + DefaultComponentMetadataContext componentMetadataContext = new DefaultComponentMetadataContext(details, metadata); + try { + action.execute(componentMetadataContext); + } catch (InvalidUserCodeException e) { + throw e; + } catch (Exception e) { + throw new InvalidUserCodeException(String.format("There was an error while evaluating a component metadata rule for %s.", details.getId()), e); + } + } + + private ModuleComponentResolveMetadata processClassRuleWithCaching(InstantiatingAction action, final ModuleComponentResolveMetadata metadata, MetadataResolutionContext metadataResolutionContext) { + try { + return ruleExecutor.execute(metadata, action, DETAILS_TO_RESULT, + new Transformer() { + @Override + public WrappingComponentMetadataContext transform(ModuleComponentResolveMetadata moduleVersionIdentifier) { + return new WrappingComponentMetadataContext(metadata, instantiator, dependencyMetadataNotationParser, dependencyConstraintMetadataNotationParser, componentIdentifierNotationParser); + } + }, metadataResolutionContext.getCachePolicy()); + } catch (InvalidUserCodeException e) { + throw e; + } catch (Exception e) { + throw new InvalidUserCodeException(String.format("There was an error while evaluating a component metadata rule for %s.", metadata.getModuleVersionId()), e); + } + } + + private Action collectRulesAndCreateAction(Collection rules, ModuleVersionIdentifier id, Instantiator instantiator) { + if (rules.isEmpty()) { + return Actions.doNothing(); + } + ArrayList> collectedRules = new ArrayList>(); + for (SpecConfigurableRule classBasedRule : rules) { + if (classBasedRule.getSpec().isSatisfiedBy(id)) { + collectedRules.add(classBasedRule.getConfigurableRule()); + } + } + return new InstantiatingAction(new DefaultConfigurableRules(collectedRules), instantiator, new ExceptionHandler()); + } + + + private void processRule(SpecRuleAction specRuleAction, ModuleComponentResolveMetadata metadata, final ComponentMetadataDetails details) { + if (!specRuleAction.getSpec().isSatisfiedBy(details)) { + return; + } + + final List inputs = Lists.newArrayList(); + final RuleAction action = specRuleAction.getAction(); + for (Class inputType : action.getInputTypes()) { + if (inputType == IvyModuleDescriptor.class) { + // Ignore the rule if it expects Ivy metadata and this isn't an Ivy module + if (!(metadata instanceof IvyModuleResolveMetadata)) { + return; + } + + IvyModuleResolveMetadata ivyMetadata = (IvyModuleResolveMetadata) metadata; + inputs.add(new DefaultIvyModuleDescriptor(ivyMetadata.getExtraAttributes(), ivyMetadata.getBranch(), ivyMetadata.getStatus())); + continue; + } + + // We've already validated the inputs: should never get here. + throw new IllegalStateException(); + } + + try { + synchronized (this) { + action.execute(details, inputs); + } + } catch (InvalidUserCodeException e) { + throw e; + } catch (Exception e) { + throw new InvalidUserCodeException(String.format("There was an error while evaluating a component metadata rule for %s.", details.getId()), e); + } + } + + private static class ExceptionHandler implements InstantiatingAction.ExceptionHandler { + + @Override + public void handleException(ComponentMetadataContext context, Throwable throwable) { + throw new InvalidUserCodeException(String.format("There was an error while evaluating a component metadata rule for %s.", context.getDetails().getId()), throwable); + } + } + + static class ShallowComponentMetadataAdapter implements ComponentMetadataDetails { + private final NotationParser componentIdentifierNotationParser; + private final ModuleVersionIdentifier id; + private boolean changing; + private List statusScheme; + private AttributeContainerInternal attributes; + private final List owners; + + public ShallowComponentMetadataAdapter(NotationParser componentIdentifierNotationParser, ComponentMetadata source, ImmutableAttributesFactory attributesFactory) { + this.componentIdentifierNotationParser = componentIdentifierNotationParser; + id = source.getId(); + changing = source.isChanging(); + statusScheme = source.getStatusScheme(); + attributes = attributesFactory.mutable((AttributeContainerInternal) source.getAttributes()); + owners = Lists.newArrayListWithExpectedSize(1); + } + + @Override + public void setChanging(boolean changing) { + this.changing = changing; + } + + @Override + public void setStatus(String status) { + this.attributes.attribute(ProjectInternal.STATUS_ATTRIBUTE, status); + } + + @Override + public void setStatusScheme(List statusScheme) { + this.statusScheme = statusScheme; + } + + @Override + public void withVariant(String name, Action action) { + + } + + @Override + public void allVariants(Action action) { + + } + + @Override + public void belongsTo(Object notation) { + belongsTo(notation, true); + } + + @Override + public void belongsTo(Object notation, boolean virtual) { + ComponentIdentifier id = componentIdentifierNotationParser.parseNotation(notation); + if (virtual) { + id = makeVirtual(id); + } + owners.add(id); + } + + @Override + public ModuleVersionIdentifier getId() { + return id; + } + + @Override + public boolean isChanging() { + return changing; + } + + @Override + public String getStatus() { + return attributes.getAttribute(ProjectInternal.STATUS_ATTRIBUTE); + } + + @Override + public List getStatusScheme() { + return statusScheme; + } + + @Override + public ComponentMetadataDetails attributes(Action action) { + action.execute(attributes); + return this; + } + + @Override + public AttributeContainer getAttributes() { + return attributes; + } + + public ComponentMetadata asImmutable() { + return new UserProvidedMetadata(id, statusScheme, attributes.asImmutable()); + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/dsl/DefaultRepositoryHandler.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/dsl/DefaultRepositoryHandler.java new file mode 100644 index 0000000..7a27882 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/dsl/DefaultRepositoryHandler.java @@ -0,0 +1,116 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.dsl; + +import groovy.lang.Closure; +import org.gradle.api.Action; +import org.gradle.api.artifacts.dsl.RepositoryHandler; +import org.gradle.api.artifacts.repositories.ArtifactRepository; +import org.gradle.api.artifacts.repositories.FlatDirectoryArtifactRepository; +import org.gradle.api.artifacts.repositories.IvyArtifactRepository; +import org.gradle.api.artifacts.repositories.MavenArtifactRepository; +import org.gradle.api.internal.ConfigureByMapAction; +import org.gradle.api.internal.CollectionCallbackActionDecorator; +import org.gradle.api.internal.artifacts.BaseRepositoryFactory; +import org.gradle.api.internal.artifacts.DefaultArtifactRepositoryContainer; +import org.gradle.internal.reflect.Instantiator; +import org.gradle.util.ConfigureUtil; + +import java.util.HashMap; +import java.util.Map; + +import static org.gradle.util.CollectionUtils.flattenCollections; + +public class DefaultRepositoryHandler extends DefaultArtifactRepositoryContainer implements RepositoryHandler { + + public static final String GRADLE_PLUGIN_PORTAL_REPO_NAME = "Gradle Central Plugin Repository"; + public static final String DEFAULT_BINTRAY_JCENTER_REPO_NAME = "BintrayJCenter"; + public static final String BINTRAY_JCENTER_URL = "https://jcenter.bintray.com/"; + public static final String GOOGLE_REPO_NAME = "Google"; + + public static final String FLAT_DIR_DEFAULT_NAME = "flatDir"; + private static final String MAVEN_REPO_DEFAULT_NAME = "maven"; + private static final String IVY_REPO_DEFAULT_NAME = "ivy"; + + private final BaseRepositoryFactory repositoryFactory; + + public DefaultRepositoryHandler(BaseRepositoryFactory repositoryFactory, Instantiator instantiator, CollectionCallbackActionDecorator decorator) { + super(instantiator, decorator); + this.repositoryFactory = repositoryFactory; + } + + public FlatDirectoryArtifactRepository flatDir(Action action) { + return addRepository(repositoryFactory.createFlatDirRepository(), FLAT_DIR_DEFAULT_NAME, action); + } + + public FlatDirectoryArtifactRepository flatDir(Closure configureClosure) { + return flatDir(ConfigureUtil.configureUsing(configureClosure)); + } + + public FlatDirectoryArtifactRepository flatDir(Map args) { + Map modifiedArgs = new HashMap(args); + if (modifiedArgs.containsKey("dirs")) { + modifiedArgs.put("dirs", flattenCollections(modifiedArgs.get("dirs"))); + } + return flatDir(new ConfigureByMapAction(modifiedArgs)); + } + + @Override + public ArtifactRepository gradlePluginPortal() { + return addRepository(repositoryFactory.createGradlePluginPortal(), GRADLE_PLUGIN_PORTAL_REPO_NAME); + } + + public MavenArtifactRepository mavenCentral() { + return addRepository(repositoryFactory.createMavenCentralRepository(), DEFAULT_MAVEN_CENTRAL_REPO_NAME); + } + + public MavenArtifactRepository jcenter() { + return addRepository(repositoryFactory.createJCenterRepository(), DEFAULT_BINTRAY_JCENTER_REPO_NAME); + } + + public MavenArtifactRepository jcenter(Action action) { + return addRepository(repositoryFactory.createJCenterRepository(), DEFAULT_BINTRAY_JCENTER_REPO_NAME, action); + } + + public MavenArtifactRepository mavenCentral(Map args) { + Map modifiedArgs = new HashMap(args); + return addRepository(repositoryFactory.createMavenCentralRepository(), DEFAULT_MAVEN_CENTRAL_REPO_NAME, new ConfigureByMapAction(modifiedArgs)); + } + + public MavenArtifactRepository mavenLocal() { + return addRepository(repositoryFactory.createMavenLocalRepository(), DEFAULT_MAVEN_LOCAL_REPO_NAME); + } + + public MavenArtifactRepository google() { + return addRepository(repositoryFactory.createGoogleRepository(), GOOGLE_REPO_NAME); + } + + public MavenArtifactRepository maven(Action action) { + return addRepository(repositoryFactory.createMavenRepository(), MAVEN_REPO_DEFAULT_NAME, action); + } + + public MavenArtifactRepository maven(Closure closure) { + return maven(ConfigureUtil.configureUsing(closure)); + } + + public IvyArtifactRepository ivy(Action action) { + return addRepository(repositoryFactory.createIvyRepository(), IVY_REPO_DEFAULT_NAME, action); + } + + public IvyArtifactRepository ivy(Closure closure) { + return ivy(ConfigureUtil.configureUsing(closure)); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/dsl/dependencies/ModuleFactoryHelper.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/dsl/dependencies/ModuleFactoryHelper.java new file mode 100644 index 0000000..1946e14 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/dsl/dependencies/ModuleFactoryHelper.java @@ -0,0 +1,37 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.dsl.dependencies; + +import org.gradle.api.artifacts.DependencyArtifact; +import org.gradle.api.artifacts.ExternalDependency; +import org.gradle.api.internal.artifacts.dependencies.DefaultDependencyArtifact; + +public class ModuleFactoryHelper { + public static void addExplicitArtifactsIfDefined(ExternalDependency moduleDependency, String artifactType, String classifier) { + String actualArtifactType = artifactType; + if (actualArtifactType == null) { + if (classifier != null) { + actualArtifactType = DependencyArtifact.DEFAULT_TYPE; + } + } else { + moduleDependency.setTransitive(false); + } + if (actualArtifactType != null) { + moduleDependency.addArtifact(new DefaultDependencyArtifact(moduleDependency.getName(), + actualArtifactType, actualArtifactType, classifier, null)); + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/ivyresolve/parser/DescriptorParseContext.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/ivyresolve/parser/DescriptorParseContext.java new file mode 100644 index 0000000..83dbac1 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/ivyresolve/parser/DescriptorParseContext.java @@ -0,0 +1,28 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser; + +import org.gradle.api.artifacts.component.ModuleComponentIdentifier; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionSelector; +import org.gradle.api.internal.component.ArtifactType; +import org.gradle.internal.component.external.model.ModuleDependencyMetadata; +import org.gradle.internal.resource.local.LocallyAvailableExternalResource; + +public interface DescriptorParseContext { + LocallyAvailableExternalResource getMetaDataArtifact(ModuleComponentIdentifier componentIdentifier, ArtifactType artifactType); + + LocallyAvailableExternalResource getMetaDataArtifact(ModuleDependencyMetadata dependencyMetadata, VersionSelector acceptor, ArtifactType artifactType); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/projectmodule/ProjectPublicationRegistry.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/projectmodule/ProjectPublicationRegistry.java new file mode 100644 index 0000000..60540b6 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/projectmodule/ProjectPublicationRegistry.java @@ -0,0 +1,50 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.ivyservice.projectmodule; + +import org.gradle.api.internal.project.ProjectInternal; +import org.gradle.util.Path; + +import javax.annotation.concurrent.ThreadSafe; +import java.util.Collection; + +/** + * A build scoped service that collects information on the local "publications" of each project within a build. A "publication" here means some buildable thing that the project produces that can be consumed outside of the project. + * + * The information is gathered from multiple sources ({@code publishing.publications} container, {@code uploadArchives} task, etc.). + */ +@ThreadSafe +public interface ProjectPublicationRegistry { + void registerPublication(ProjectInternal project, ProjectPublication publication); + + /** + * Returns the known publications for the given project. + */ + Collection getPublications(Class type, Path projectIdentityPath); + + /** + * Returns all known publications. + */ + Collection> getPublications(Class type); + + interface Reference { + T get(); + + // Should use ProjectState instead + ProjectInternal getProducingProject(); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/artifact/ArtifactSet.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/artifact/ArtifactSet.java new file mode 100644 index 0000000..3739a0e --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/artifact/ArtifactSet.java @@ -0,0 +1,40 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact; + +import org.gradle.api.artifacts.component.ComponentIdentifier; +import org.gradle.api.internal.artifacts.transform.VariantSelector; +import org.gradle.api.specs.Spec; + +/** + * Represents a container of artifacts, possibly made up of several different variants. + * + * Instances are retained during the lifetime of a build, so should avoid retaining unnecessary state. + */ +public interface ArtifactSet { + ArtifactSet NO_ARTIFACTS = new ArtifactSet() { + @Override + public ResolvedArtifactSet select(Spec componentFilter, VariantSelector selector) { + return ResolvedArtifactSet.EMPTY; + } + }; + + /** + * Selects the artifacts of this set that meet the given criteria. Implementation should be eager where possible, so that selection happens immediately, but may be lazy. + */ + ResolvedArtifactSet select(Spec componentFilter, VariantSelector selector); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/excludes/GroupNameExcludeSpec.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/excludes/GroupNameExcludeSpec.java new file mode 100644 index 0000000..30f35da --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/excludes/GroupNameExcludeSpec.java @@ -0,0 +1,58 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes; + +import org.gradle.api.artifacts.ModuleIdentifier; + +/** + * A ModuleResolutionFilter that excludes any module with a matching group. + * Does not exclude any artifacts. + */ +class GroupNameExcludeSpec extends AbstractModuleExclusion { + final String group; + + GroupNameExcludeSpec(String group) { + this.group = group; + } + + @Override + public String toString() { + return "{group " + group + "}"; + } + + @Override + protected boolean doEquals(Object o) { + GroupNameExcludeSpec other = (GroupNameExcludeSpec) o; + return group.equals(other.group); + } + + @Override + protected int doHashCode() { + return group.hashCode(); + } + + @Override + public boolean doExcludesSameModulesAs(AbstractModuleExclusion other) { + GroupNameExcludeSpec groupNameExcludeSpec = (GroupNameExcludeSpec) other; + return group.equals(groupNameExcludeSpec.group); + } + + @Override + public boolean excludeModule(ModuleIdentifier module) { + return module.getGroup().equals(group); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/graph/ResolvedGraphComponent.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/graph/ResolvedGraphComponent.java new file mode 100644 index 0000000..2897031 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/graph/ResolvedGraphComponent.java @@ -0,0 +1,72 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph; + +import org.gradle.api.artifacts.ModuleVersionIdentifier; +import org.gradle.api.artifacts.component.ComponentIdentifier; +import org.gradle.api.artifacts.result.ComponentSelectionReason; +import org.gradle.api.attributes.AttributeContainer; +import org.gradle.internal.DisplayName; + +import javax.annotation.Nullable; + +/** + * The final representation of a component in the resolved dependency graph. + * This is the type that is serialized on resolve and deserialized when we later need to build a `ResolutionResult`. + */ +public interface ResolvedGraphComponent { + /** + * Returns a simple id for this component, unique across components in the same graph. + * This id cannot be used across graphs. + */ + Long getResultId(); + + /** + * Returns a unique id for this component. + */ + ComponentIdentifier getComponentId(); + + /** + * Returns the module version for this component. + */ + ModuleVersionIdentifier getModuleVersion(); + + /** + * The reason this component was selected in the graph. + */ + ComponentSelectionReason getSelectionReason(); + + /** + * Returns the name of the resolved variant. This can currently be 2 different things: for legacy components, + * it's going to be the name of a "configuration" (either a project configuration, an Ivy configuration name or a Maven "scope"). + * For components with variants, it's going to be the name of the variant. This name is going to be used for reporting purposes. + */ + DisplayName getVariantName(); + + /** + * Returns the attributes of the resolved variant. This is going to be used for reporting purposes. In practice, variant attributes + * should effectively be what defines the _identity_ of the variant. In practice, because we have multiple kind of components, it's + * not necessarily the case. + */ + AttributeContainer getVariantAttributes(); + + /** + * Returns the name of the repository used to source this component, or {@code null} if this component was not resolved from a repository. + */ + @Nullable + String getRepositoryName(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/repositories/resolver/DependencyConstraintsMetadataAdapter.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/repositories/resolver/DependencyConstraintsMetadataAdapter.java new file mode 100644 index 0000000..c9098c2 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/repositories/resolver/DependencyConstraintsMetadataAdapter.java @@ -0,0 +1,45 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.repositories.resolver; + +import org.gradle.api.artifacts.DependencyConstraintMetadata; +import org.gradle.api.artifacts.DependencyConstraintsMetadata; +import org.gradle.api.internal.attributes.ImmutableAttributesFactory; +import org.gradle.internal.reflect.Instantiator; +import org.gradle.internal.typeconversion.NotationParser; + +import java.util.List; + +public class DependencyConstraintsMetadataAdapter extends AbstractDependenciesMetadataAdapter implements DependencyConstraintsMetadata { + + public DependencyConstraintsMetadataAdapter(ImmutableAttributesFactory attributesFactory, + List dependenciesMetadata, + Instantiator instantiator, + NotationParser dependencyConstraintsNotationParser) { + super(attributesFactory, dependenciesMetadata, instantiator, dependencyConstraintsNotationParser); + } + + @Override + protected Class adapterImplementationType() { + return DependencyConstraintMetadataAdapter.class; + } + + @Override + protected boolean isConstraint() { + return true; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/transform/DefaultTransformationRegistration.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/transform/DefaultTransformationRegistration.java new file mode 100644 index 0000000..5dc3fce --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/artifacts/transform/DefaultTransformationRegistration.java @@ -0,0 +1,79 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.transform; + +import org.gradle.api.artifacts.transform.ArtifactTransform; +import org.gradle.api.artifacts.transform.VariantTransformConfigurationException; +import org.gradle.api.internal.InstantiatorFactory; +import org.gradle.api.internal.artifacts.VariantTransformRegistry; +import org.gradle.api.internal.attributes.AttributeContainerInternal; +import org.gradle.api.internal.attributes.ImmutableAttributes; +import org.gradle.internal.classloader.ClassLoaderHierarchyHasher; +import org.gradle.internal.hash.Hasher; +import org.gradle.internal.hash.Hashing; +import org.gradle.internal.isolation.Isolatable; +import org.gradle.internal.isolation.IsolatableFactory; +import org.gradle.model.internal.type.ModelType; + +import java.util.Arrays; + +public class DefaultTransformationRegistration implements VariantTransformRegistry.Registration { + + private final ImmutableAttributes from; + private final ImmutableAttributes to; + private final TransformationStep transformationStep; + + public static VariantTransformRegistry.Registration create(ImmutableAttributes from, ImmutableAttributes to, Class implementation, Object[] params, IsolatableFactory isolatableFactory, ClassLoaderHierarchyHasher classLoaderHierarchyHasher, InstantiatorFactory instantiatorFactory, TransformerInvoker transformerInvoker) { + Hasher hasher = Hashing.newHasher(); + hasher.putString(implementation.getName()); + hasher.putHash(classLoaderHierarchyHasher.getClassLoaderHash(implementation.getClassLoader())); + + // TODO - should snapshot later? + Isolatable paramsSnapshot; + try { + paramsSnapshot = isolatableFactory.isolate(params); + } catch (Exception e) { + throw new VariantTransformConfigurationException(String.format("Could not snapshot configuration values for transform %s: %s", ModelType.of(implementation).getDisplayName(), Arrays.asList(params)), e); + } + + paramsSnapshot.appendToHasher(hasher); + + Transformer transformer = new DefaultTransformer(implementation, paramsSnapshot, hasher.hash(), instantiatorFactory, from); + return new DefaultTransformationRegistration(from, to, new TransformationStep(transformer, transformerInvoker)); + } + + public DefaultTransformationRegistration(ImmutableAttributes from, ImmutableAttributes to, TransformationStep transformationStep) { + this.from = from; + this.to = to; + this.transformationStep = transformationStep; + } + + @Override + public AttributeContainerInternal getFrom() { + return from; + } + + @Override + public AttributeContainerInternal getTo() { + return to; + } + + @Override + public TransformationStep getTransformationStep() { + return transformationStep; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/notations/DependencyFilesNotationConverter.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/notations/DependencyFilesNotationConverter.java new file mode 100644 index 0000000..1349d21 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/api/internal/notations/DependencyFilesNotationConverter.java @@ -0,0 +1,42 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.notations; + +import org.gradle.api.artifacts.SelfResolvingDependency; +import org.gradle.api.file.FileCollection; +import org.gradle.api.internal.artifacts.dependencies.DefaultSelfResolvingDependency; +import org.gradle.internal.exceptions.DiagnosticsVisitor; +import org.gradle.internal.reflect.Instantiator; +import org.gradle.internal.typeconversion.NotationConvertResult; +import org.gradle.internal.typeconversion.NotationConverter; +import org.gradle.internal.typeconversion.TypeConversionException; + +public class DependencyFilesNotationConverter implements NotationConverter { + private final Instantiator instantiator; + + public DependencyFilesNotationConverter(Instantiator instantiator) { + this.instantiator = instantiator; + } + + @Override + public void describe(DiagnosticsVisitor visitor) { + visitor.candidate("FileCollections").example("files('some.jar', 'someOther.jar')"); + } + + public void convert(FileCollection notation, NotationConvertResult result) throws TypeConversionException { + result.converted(instantiator.newInstance(DefaultSelfResolvingDependency.class, notation)); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/internal/component/IncompatibleConfigurationSelectionException.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/internal/component/IncompatibleConfigurationSelectionException.java new file mode 100644 index 0000000..b7629dc --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/internal/component/IncompatibleConfigurationSelectionException.java @@ -0,0 +1,43 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.component; + +import org.gradle.api.internal.attributes.AttributeContainerInternal; +import org.gradle.internal.component.model.AttributeMatcher; +import org.gradle.internal.component.model.ComponentResolveMetadata; +import org.gradle.internal.text.TreeFormatter; + +import static org.gradle.internal.component.AmbiguousConfigurationSelectionException.formatConfiguration; + +public class IncompatibleConfigurationSelectionException extends RuntimeException { + public IncompatibleConfigurationSelectionException( + AttributeContainerInternal fromConfigurationAttributes, + AttributeMatcher attributeMatcher, + ComponentResolveMetadata targetComponent, + String targetConfiguration, + boolean variantAware) { + super(generateMessage(fromConfigurationAttributes, attributeMatcher, targetComponent, targetConfiguration, variantAware)); + } + + private static String generateMessage(AttributeContainerInternal fromConfigurationAttributes, AttributeMatcher attributeMatcher, ComponentResolveMetadata targetComponent, String targetConfiguration, boolean variantAware) { + TreeFormatter formatter = new TreeFormatter(); + formatter.node((variantAware ? "Variant '" : "Configuration '") + targetConfiguration + "' in " + targetComponent.getId().getDisplayName() + " does not match the consumer attributes"); + formatConfiguration(formatter, fromConfigurationAttributes, attributeMatcher, targetComponent.getConfiguration(targetConfiguration), variantAware); + return formatter.toString(); + } + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/internal/component/external/ivypublish/IvyModuleDescriptorWriter.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/internal/component/external/ivypublish/IvyModuleDescriptorWriter.java new file mode 100644 index 0000000..92d1487 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/internal/component/external/ivypublish/IvyModuleDescriptorWriter.java @@ -0,0 +1,26 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.component.external.ivypublish; + +import java.io.File; + +/** + * Generates `ivy.xml` files for `Upload` task. + */ +public interface IvyModuleDescriptorWriter { + void write(IvyModulePublishMetadata module, File output); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/internal/component/model/ComponentOverrideMetadata.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/internal/component/model/ComponentOverrideMetadata.java new file mode 100644 index 0000000..c759fe6 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/internal/component/model/ComponentOverrideMetadata.java @@ -0,0 +1,49 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.component.model; + +import org.gradle.api.artifacts.ClientModule; + +import java.util.List; + +/** + * Metadata about a component that will override the information obtained when resolving, typically specified by a dependency descriptor. + * Metadata supplied in this way is applied inconsistently, because multiple dependencies can point to the same component with different + * override metadata, and only one of these overrides will be used during dependency resolution. + */ +public interface ComponentOverrideMetadata { + + /** + * If the dependency declared artifacts for the component, return them. Empty otherwise. + */ + List getArtifacts(); + + /** + * If the request originated from a ClientModule, return it. Null otherwise. + */ + ClientModule getClientModule(); + + /** + * Return true if the dependency declaration defines this component as changing. + */ + boolean isChanging(); + + /** + * Return a copy of this override metadata with `isChanging()` set to true. + */ + ComponentOverrideMetadata withChanging(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/internal/resolve/result/DefaultBuildableComponentArtifactsResolveResult.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/internal/resolve/result/DefaultBuildableComponentArtifactsResolveResult.java new file mode 100644 index 0000000..a8af00e --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/dependency-management/org/gradle/internal/resolve/result/DefaultBuildableComponentArtifactsResolveResult.java @@ -0,0 +1,23 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.resolve.result; + +import org.gradle.internal.component.model.ComponentArtifacts; +import org.gradle.internal.resolve.ArtifactResolveException; + +public class DefaultBuildableComponentArtifactsResolveResult extends DefaultBuildableTypedResolveResult implements BuildableComponentArtifactsResolveResult { +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/diagnostics/org/gradle/api/reporting/dependents/DependentComponentsReport.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/diagnostics/org/gradle/api/reporting/dependents/DependentComponentsReport.java new file mode 100644 index 0000000..129fbfe --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/diagnostics/org/gradle/api/reporting/dependents/DependentComponentsReport.java @@ -0,0 +1,184 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.reporting.dependents; + +import com.google.common.base.Joiner; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import org.gradle.api.DefaultTask; +import org.gradle.api.Incubating; +import org.gradle.api.InvalidUserDataException; +import org.gradle.api.Project; +import org.gradle.api.tasks.options.Option; +import org.gradle.api.reporting.dependents.internal.TextDependentComponentsReportRenderer; +import org.gradle.api.tasks.Console; +import org.gradle.api.tasks.TaskAction; +import org.gradle.internal.logging.text.StyledTextOutput; +import org.gradle.internal.logging.text.StyledTextOutputFactory; +import org.gradle.model.internal.registry.ModelRegistry; +import org.gradle.platform.base.ComponentSpec; +import org.gradle.platform.base.internal.dependents.DependentBinariesResolver; + +import javax.inject.Inject; +import java.util.List; +import java.util.Set; + +import static org.gradle.api.reporting.dependents.internal.DependentComponentsUtils.getAllComponents; +import static org.gradle.api.reporting.dependents.internal.DependentComponentsUtils.getAllTestSuites; + +/** + * Displays dependent components. + */ +@Incubating +public class DependentComponentsReport extends DefaultTask { + + private boolean showNonBuildable; + private boolean showTestSuites; + private List components; + + /** + * Should this include non-buildable components in the report? + */ + @Console + public boolean isShowNonBuildable() { + return showNonBuildable; + } + + @Option(option = "non-buildable", description = "Show non-buildable components.") + public void setShowNonBuildable(boolean showNonBuildable) { + this.showNonBuildable = showNonBuildable; + } + + /** + * Should this include test suites in the report? + */ + @Console + public boolean isShowTestSuites() { + return showTestSuites; + } + + @Option(option = "test-suites", description = "Show test suites components.") + public void setShowTestSuites(boolean showTestSuites) { + this.showTestSuites = showTestSuites; + } + + /** + * Should this include both non-buildable and test suites in the report? + */ + @Console + public boolean getShowAll() { + return showNonBuildable && showTestSuites; + } + + /** + * Set this to include both non buildable components and test suites in the report. + */ + @Option(option = "all", description = "Show all components (non-buildable and test suites).") + public void setShowAll(boolean showAll) { + this.showNonBuildable = showAll; + this.showTestSuites = showAll; + } + + /** + * Returns the components to generate the report for. + * Defaults to all components of this project. + * + * @return the components. + */ + @Console + public List getComponents() { + return components; + } + + /** + * Sets the components to generate the report for. + * + * @param components the components. + */ + @Option(option = "component", description = "Component to generate the report for (can be specified more than once).") + public void setComponents(List components) { + this.components = components; + } + + @Inject + protected StyledTextOutputFactory getTextOutputFactory() { + throw new UnsupportedOperationException(); + } + + @Inject + protected ModelRegistry getModelRegistry() { + throw new UnsupportedOperationException(); + } + + @TaskAction + public void report() { + // Output reports per execution, not mixed. + // Cross-project ModelRegistry operations do not happen concurrently. + synchronized (DependentComponentsReport.class) { + Project project = getProject(); + ModelRegistry modelRegistry = getModelRegistry(); + DependentBinariesResolver dependentBinariesResolver = modelRegistry.find("dependentBinariesResolver", DependentBinariesResolver.class); + + StyledTextOutput textOutput = getTextOutputFactory().create(DependentComponentsReport.class); + TextDependentComponentsReportRenderer reportRenderer = new TextDependentComponentsReportRenderer(dependentBinariesResolver, showNonBuildable, showTestSuites); + + reportRenderer.setOutput(textOutput); + reportRenderer.startProject(project); + + Set allComponents = getAllComponents(modelRegistry); + if (showTestSuites) { + allComponents.addAll(getAllTestSuites(modelRegistry)); + } + reportRenderer.renderComponents(getReportedComponents(allComponents)); + reportRenderer.renderLegend(); + + reportRenderer.completeProject(project); + reportRenderer.complete(); + } + } + + private Set getReportedComponents(Set allComponents) { + if (components == null || components.isEmpty()) { + return allComponents; + } + Set reportedComponents = Sets.newLinkedHashSet(); + List notFound = Lists.newArrayList(components); + for (ComponentSpec candidate : allComponents) { + String candidateName = candidate.getName(); + if (components.contains(candidateName)) { + reportedComponents.add(candidate); + notFound.remove(candidateName); + } + } + if (!notFound.isEmpty()) { + onComponentsNotFound(notFound); + } + return reportedComponents; + } + + private void onComponentsNotFound(List notFound) { + StringBuilder error = new StringBuilder("Component"); + if (notFound.size() == 1) { + error.append(" '").append(notFound.get(0)); + } else { + String last = notFound.remove(notFound.size() - 1); + error.append("s '").append(Joiner.on("', '").join(notFound)).append("' and '").append(last); + } + error.append("' not found."); + throw new InvalidUserDataException(error.toString()); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/execution/org/gradle/internal/execution/history/ExecutionHistoryCacheAccess.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/execution/org/gradle/internal/execution/history/ExecutionHistoryCacheAccess.java new file mode 100644 index 0000000..bec7a53 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/execution/org/gradle/internal/execution/history/ExecutionHistoryCacheAccess.java @@ -0,0 +1,33 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.internal.execution.history; + +import org.gradle.cache.PersistentIndexedCache; +import org.gradle.cache.PersistentIndexedCacheParameters; +import org.gradle.internal.serialize.Serializer; + +/** + * Provides access to the persistent execution history store. + */ +public interface ExecutionHistoryCacheAccess { + /** + * See {@link org.gradle.cache.PersistentStore#createCache(String, Class, Serializer)} for more details. + * + * @param maxEntriesToKeepInMemory The max number of entries to keep in memory, scaled according to available heap. + * @param cacheInMemoryForShortLivedProcesses When true, entries are cached in memory. When false, entries are cached in memory only when it possible that another build will be run in this process. + */ + PersistentIndexedCache createCache(PersistentIndexedCacheParameters parameters, int maxEntriesToKeepInMemory, boolean cacheInMemoryForShortLivedProcesses); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/execution/org/gradle/internal/execution/history/changes/DefaultExecutionStateChanges.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/execution/org/gradle/internal/execution/history/changes/DefaultExecutionStateChanges.java new file mode 100644 index 0000000..fce75c1 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/execution/org/gradle/internal/execution/history/changes/DefaultExecutionStateChanges.java @@ -0,0 +1,120 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.execution.history.changes; + +import org.gradle.api.Describable; +import org.gradle.internal.change.CachingChangeContainer; +import org.gradle.internal.change.Change; +import org.gradle.internal.change.ChangeContainer; +import org.gradle.internal.change.ChangeDetectorVisitor; +import org.gradle.internal.change.ChangeVisitor; +import org.gradle.internal.change.CollectingChangeVisitor; +import org.gradle.internal.change.ErrorHandlingChangeContainer; +import org.gradle.internal.change.SummarizingChangeContainer; +import org.gradle.internal.execution.history.AfterPreviousExecutionState; +import org.gradle.internal.execution.history.BeforeExecutionState; + +public class DefaultExecutionStateChanges implements ExecutionStateChanges { + + private final AfterPreviousExecutionState previousExecution; + private final ChangeContainer inputFileChanges; + private final ChangeContainer allChanges; + private final ChangeContainer rebuildTriggeringChanges; + + public DefaultExecutionStateChanges(AfterPreviousExecutionState lastExecution, BeforeExecutionState thisExecution, Describable executable) { + this.previousExecution = lastExecution; + + // Capture changes in execution outcome + ChangeContainer previousSuccessState = new PreviousSuccessChanges( + lastExecution.isSuccessful()); + + // Capture changes to implementation + ChangeContainer implementationChanges = new ImplementationChanges( + lastExecution.getImplementation(), lastExecution.getAdditionalImplementations(), + thisExecution.getImplementation(), thisExecution.getAdditionalImplementations(), + executable); + + // Capture non-file input changes + ChangeContainer inputPropertyChanges = new PropertyChanges( + lastExecution.getInputProperties(), + thisExecution.getInputProperties(), + "Input", + executable); + ChangeContainer inputPropertyValueChanges = new InputValueChanges( + lastExecution.getInputProperties(), + thisExecution.getInputProperties(), + executable); + + // Capture input files state + ChangeContainer inputFilePropertyChanges = new PropertyChanges( + lastExecution.getInputFileProperties(), + thisExecution.getInputFileProperties(), + "Input file", + executable); + InputFileChanges directInputFileChanges = new InputFileChanges( + lastExecution.getInputFileProperties(), + thisExecution.getInputFileProperties()); + ChangeContainer inputFileChanges = caching(directInputFileChanges); + this.inputFileChanges = errorHandling(executable, inputFileChanges); + + // Capture output files state + ChangeContainer outputFilePropertyChanges = new PropertyChanges( + lastExecution.getOutputFileProperties(), + thisExecution.getOutputFileProperties(), + "Output", + executable); + OutputFileChanges uncachedOutputChanges = new OutputFileChanges( + lastExecution.getOutputFileProperties(), + thisExecution.getOutputFileProperties()); + ChangeContainer outputFileChanges = caching(uncachedOutputChanges); + + this.allChanges = errorHandling(executable, new SummarizingChangeContainer(previousSuccessState, implementationChanges, inputPropertyChanges, inputPropertyValueChanges, outputFilePropertyChanges, outputFileChanges, inputFilePropertyChanges, inputFileChanges)); + this.rebuildTriggeringChanges = errorHandling(executable, new SummarizingChangeContainer(previousSuccessState, implementationChanges, inputPropertyChanges, inputPropertyValueChanges, inputFilePropertyChanges, outputFilePropertyChanges, outputFileChanges)); + } + + private static ChangeContainer caching(ChangeContainer wrapped) { + return new CachingChangeContainer(MAX_OUT_OF_DATE_MESSAGES, wrapped); + } + + private static ChangeContainer errorHandling(Describable executable, ChangeContainer wrapped) { + return new ErrorHandlingChangeContainer(executable, wrapped); + } + + @Override + public Iterable getInputFilesChanges() { + CollectingChangeVisitor visitor = new CollectingChangeVisitor(); + inputFileChanges.accept(visitor); + return visitor.getChanges(); + } + + @Override + public void visitAllChanges(ChangeVisitor visitor) { + allChanges.accept(visitor); + } + + @Override + public boolean isRebuildRequired() { + ChangeDetectorVisitor changeDetectorVisitor = new ChangeDetectorVisitor(); + rebuildTriggeringChanges.accept(changeDetectorVisitor); + return changeDetectorVisitor.hasAnyChanges(); + } + + @Override + public AfterPreviousExecutionState getPreviousExecution() { + return previousExecution; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/files/org/gradle/api/internal/file/collections/ArchiveFileTree.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/files/org/gradle/api/internal/file/collections/ArchiveFileTree.java new file mode 100644 index 0000000..8344184 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/files/org/gradle/api/internal/file/collections/ArchiveFileTree.java @@ -0,0 +1,28 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.file.collections; + +import javax.annotation.Nullable; +import java.io.File; + +/** + * A file tree which represents an archive fileTree. + */ +public interface ArchiveFileTree extends FileSystemMirroringFileTree { + + @Nullable File getBackingFile(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/ide-native/org/gradle/ide/xcode/internal/XcodeBinary.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/ide-native/org/gradle/ide/xcode/internal/XcodeBinary.java new file mode 100644 index 0000000..8c9abaf --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/ide-native/org/gradle/ide/xcode/internal/XcodeBinary.java @@ -0,0 +1,44 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.ide.xcode.internal; + +import org.gradle.api.file.FileSystemLocation; +import org.gradle.api.provider.Provider; + +public class XcodeBinary { + private final String buildConfigurationName; + private final Provider outputFile; + private final String architectureName; + + public XcodeBinary(String buildConfigurationName, Provider outputFile, String architectureName) { + this.buildConfigurationName = buildConfigurationName; + this.outputFile = outputFile; + this.architectureName = architectureName; + } + + public String getBuildConfigurationName() { + return buildConfigurationName; + } + + public Provider getOutputFile() { + return outputFile; + } + + public String getArchitectureName() { + return architectureName; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/ide-native/org/gradle/ide/xcode/internal/XcodeUtils.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/ide-native/org/gradle/ide/xcode/internal/XcodeUtils.java new file mode 100644 index 0000000..d051941 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/ide-native/org/gradle/ide/xcode/internal/XcodeUtils.java @@ -0,0 +1,45 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.ide.xcode.internal; + +import org.apache.commons.lang.StringUtils; +import org.gradle.api.Transformer; +import org.gradle.util.CollectionUtils; + +import java.io.File; +import java.util.Arrays; + +public class XcodeUtils { + private XcodeUtils() {} + + public static String toSpaceSeparatedList(File... files) { + return toSpaceSeparatedList(Arrays.asList(files)); + } + + public static String toSpaceSeparatedList(Iterable it) { + return StringUtils.join(CollectionUtils.collect(it, new Transformer() { + @Override + public String transform(File file) { + return quote(file.getAbsolutePath()); + } + }), ' '); + } + + private static String quote(String value) { + return "\"" + value + "\""; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/ide-native/org/gradle/ide/xcode/internal/xcodeproj/XCConfigurationList.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/ide-native/org/gradle/ide/xcode/internal/xcodeproj/XCConfigurationList.java new file mode 100644 index 0000000..f6c27e1 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/ide-native/org/gradle/ide/xcode/internal/xcodeproj/XCConfigurationList.java @@ -0,0 +1,80 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.ide.xcode.internal.xcodeproj; + +import com.google.common.base.Optional; +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import com.google.common.collect.Lists; + +import java.util.Collections; +import java.util.Comparator; +import java.util.List; + +/** + * List of build configurations. + */ +public class XCConfigurationList extends PBXProjectItem { + private final LoadingCache buildConfigurationsByName; + private List buildConfigurations; + private Optional defaultConfigurationName; + private boolean defaultConfigurationIsVisible; + + public XCConfigurationList() { + buildConfigurations = Lists.newArrayList(); + defaultConfigurationName = Optional.absent(); + defaultConfigurationIsVisible = false; + + buildConfigurationsByName = CacheBuilder.newBuilder().build( + new CacheLoader() { + @Override + public XCBuildConfiguration load(String key) throws Exception { + XCBuildConfiguration configuration = new XCBuildConfiguration(key); + buildConfigurations.add(configuration); + return configuration; + } + }); + } + + public LoadingCache getBuildConfigurationsByName() { + return buildConfigurationsByName; + } + + @Override + public String isa() { + return "XCConfigurationList"; + } + + @Override + public void serializeInto(XcodeprojSerializer s) { + super.serializeInto(s); + + Collections.sort(buildConfigurations, new Comparator() { + @Override + public int compare(XCBuildConfiguration o1, XCBuildConfiguration o2) { + return o1.getName().compareTo(o2.getName()); + } + }); + s.addField("buildConfigurations", buildConfigurations); + + if (defaultConfigurationName.isPresent()) { + s.addField("defaultConfigurationName", defaultConfigurationName.get()); + } + s.addField("defaultConfigurationIsVisible", defaultConfigurationIsVisible); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/ide/org/gradle/plugins/ide/eclipse/internal/EclipsePluginConstants.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/ide/org/gradle/plugins/ide/eclipse/internal/EclipsePluginConstants.java new file mode 100644 index 0000000..7da59d9 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/ide/org/gradle/plugins/ide/eclipse/internal/EclipsePluginConstants.java @@ -0,0 +1,28 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.plugins.ide.eclipse.internal; + +public class EclipsePluginConstants { + + public static final String DEFAULT_PROJECT_OUTPUT_PATH = "bin/default"; + public static final String GRADLE_USED_BY_SCOPE_ATTRIBUTE_NAME = "gradle_used_by_scope"; + public static final String GRADLE_SCOPE_ATTRIBUTE_NAME = "gradle_scope"; + + private EclipsePluginConstants() { + } + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/ide/org/gradle/plugins/ide/eclipse/internal/LinkedResourcesCreator.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/ide/org/gradle/plugins/ide/eclipse/internal/LinkedResourcesCreator.java new file mode 100644 index 0000000..e0ef1af --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/ide/org/gradle/plugins/ide/eclipse/internal/LinkedResourcesCreator.java @@ -0,0 +1,50 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.plugins.ide.eclipse.internal; + +import com.google.common.base.Function; +import com.google.common.collect.Sets; +import org.gradle.api.Project; +import org.gradle.api.plugins.JavaPluginConvention; +import org.gradle.api.tasks.SourceSetContainer; +import org.gradle.plugins.ide.eclipse.model.EclipseClasspath; +import org.gradle.plugins.ide.eclipse.model.EclipseModel; +import org.gradle.plugins.ide.eclipse.model.Link; +import org.gradle.plugins.ide.eclipse.model.SourceFolder; +import org.gradle.plugins.ide.eclipse.model.internal.SourceFoldersCreator; + +import java.io.File; +import java.util.List; +import java.util.Set; + +public class LinkedResourcesCreator { + public Set links(final Project project) { + SourceSetContainer sourceSets = project.getConvention().getPlugin(JavaPluginConvention.class).getSourceSets(); + EclipseClasspath classpath = project.getExtensions().getByType(EclipseModel.class).getClasspath(); + File defaultOutputDir = classpath == null ? project.file(EclipsePluginConstants.DEFAULT_PROJECT_OUTPUT_PATH) : classpath.getDefaultOutputDir(); + List sourceFolders = new SourceFoldersCreator().getBasicExternalSourceFolders(sourceSets, new Function() { + @Override + public String apply(File dir) { + return project.relativePath(dir); + } + }, defaultOutputDir); + Set links = Sets.newLinkedHashSetWithExpectedSize(sourceFolders.size()); + for (SourceFolder sourceFolder : sourceFolders) { + links.add(new Link(sourceFolder.getName(), "2", sourceFolder.getAbsolutePath(), null)); + } + return links; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/ide/org/gradle/plugins/ide/eclipse/model/WtpFacet.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/ide/org/gradle/plugins/ide/eclipse/model/WtpFacet.java new file mode 100644 index 0000000..61941ba --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/ide/org/gradle/plugins/ide/eclipse/model/WtpFacet.java @@ -0,0 +1,114 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.plugins.ide.eclipse.model; + + +import com.google.common.base.Objects; +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import groovy.util.Node; +import groovy.util.NodeList; +import org.gradle.internal.xml.XmlTransformer; +import org.gradle.plugins.ide.internal.generator.XmlPersistableConfigurationObject; + +import java.util.List; + +/** + * Creates the .settings/org.eclipse.wst.common.project.facet.core.xml file for WTP projects. + */ +public class WtpFacet extends XmlPersistableConfigurationObject { + private List facets = Lists.newArrayList(); // TODO: turn into Set? + + public WtpFacet(XmlTransformer xmlTransformer) { + super(xmlTransformer); + } + + public List getFacets() { + return facets; + } + + public void setFacets(List facets) { + this.facets = facets; + } + + @Override + protected void load(Node xml) { + NodeList fixed = (NodeList) xml.get("fixed"); + NodeList installed = (NodeList) xml.get("installed"); + for (Object n : fixed) { + facets.add(new Facet((Node) n)); + } + for (Object n : installed) { + facets.add(new Facet((Node) n)); + } + } + + @Override + protected void store(Node xml) { + removeConfigurableDataFromXml(); + for (Facet facet : facets) { + facet.appendNode(xml); + } + } + + @Override + protected String getDefaultResourceName() { + return "defaultWtpFacet.xml"; + } + + public void configure(List facets) { + this.facets.addAll(facets); + removeDuplicates(); + } + + private void removeDuplicates() { + this.facets = Lists.newArrayList(Sets.newLinkedHashSet(facets)); + } + + private void removeConfigurableDataFromXml() { + Node xml = getXml(); + NodeList fixed = (NodeList) xml.get("fixed"); + NodeList installed = (NodeList) xml.get("installed"); + for (Object n : fixed) { + xml.remove((Node)n); + } + for (Object n : installed) { + xml.remove((Node)n); + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + WtpFacet wtpFacet = (WtpFacet) o; + return Objects.equal(facets, wtpFacet.facets); + } + + @Override + public int hashCode() { + return Objects.hashCode(facets); + } + + public String toString() { + return "WtpFacet{facets=" + facets + "}"; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/ide/org/gradle/plugins/ide/eclipse/model/defaultJdtPrefs.properties b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/ide/org/gradle/plugins/ide/eclipse/model/defaultJdtPrefs.properties new file mode 100644 index 0000000..416f4fb --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/ide/org/gradle/plugins/ide/eclipse/model/defaultJdtPrefs.properties @@ -0,0 +1,11 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-android-performance-testing/org/gradle/performance/android/GetModel.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-android-performance-testing/org/gradle/performance/android/GetModel.java new file mode 100644 index 0000000..86fb7aa --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-android-performance-testing/org/gradle/performance/android/GetModel.java @@ -0,0 +1,44 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.performance.android; + +import com.android.builder.model.AndroidProject; +import org.gradle.tooling.BuildAction; +import org.gradle.tooling.BuildController; +import org.gradle.tooling.model.gradle.BasicGradleProject; +import org.gradle.tooling.model.gradle.GradleBuild; + +import java.util.Map; +import java.util.TreeMap; + +public class GetModel implements BuildAction> { + @Override + public Map execute(BuildController controller) { + System.out.println("* Building models"); + Timer timer = new Timer(); + GradleBuild build = controller.getBuildModel(); + Map result = new TreeMap(); + for (BasicGradleProject project : build.getProjects()) { + AndroidProject androidProject = controller.findModel(project, AndroidProject.class); + result.put(project.getPath(), androidProject); + } + timer.stop(); + System.out.println("building models took " + timer.duration()); + +// new Inspector().inspectModel(result); + return result; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/integtests/fixtures/executer/GradleDistribution.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/integtests/fixtures/executer/GradleDistribution.java new file mode 100644 index 0000000..11e230f --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/integtests/fixtures/executer/GradleDistribution.java @@ -0,0 +1,158 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.integtests.fixtures.executer; + +import org.gradle.api.JavaVersion; +import org.gradle.cache.internal.CacheVersion; +import org.gradle.internal.jvm.Jvm; +import org.gradle.internal.os.OperatingSystem; +import org.gradle.test.fixtures.file.TestDirectoryProvider; +import org.gradle.test.fixtures.file.TestFile; +import org.gradle.util.GradleVersion; + +public interface GradleDistribution { + /** + * Returns the root directory of the installed distribution + */ + TestFile getGradleHomeDir(); + + /** + * Returns the binary distribution. + */ + TestFile getBinDistribution(); + + /** + * Returns the version of this distribution. + */ + GradleVersion getVersion(); + + /** + * Creates an executer which will use this distribution. + */ + GradleExecuter executer(TestDirectoryProvider testDirectoryProvider, IntegrationTestBuildContext buildContext); + + /** + * Returns true if this distribution supports the given JVM. + */ + boolean worksWith(Jvm jvm); + + /** + * Returns true if this distribution supports the given Operating system. + */ + boolean worksWith(OperatingSystem os); + + /** + * Returns true if the configuring daemon idle timeout feature is supported by this distribution. + */ + boolean isDaemonIdleTimeoutConfigurable(); + + /** + * Returns true if the tooling API is supported by this distribution. + */ + boolean isToolingApiSupported(); + + /** + * Returns true if the tooling API of this distribution supports the given target JVM. + */ + boolean isToolingApiTargetJvmSupported(JavaVersion javaVersion); + + /** + * Returns true if the tooling API of this distribution correctly handles logging in embedded mode. + */ + boolean isToolingApiLoggingInEmbeddedModeSupported(); + + /** + * Returns true if the tooling API of this distribution incorrectly locks build action implementation classes. + */ + boolean isToolingApiLocksBuildActionClasses(); + + /** + * Returns the version of the artifact cache layout + */ + CacheVersion getArtifactCacheLayoutVersion(); + + /** + * Returns true if the wrapper from this distribution can execute a build using the specified version. + */ + boolean wrapperCanExecute(GradleVersion version); + + /** + * Early versions had bugs that prevented any values having spaces in them in GRADLE_OPTS or JAVA_OPTS. + * + * See https://issues.gradle.org/browse/GRADLE-1730 + */ + boolean isSupportsSpacesInGradleAndJavaOpts(); + + /** + * The 'ivy' repository was introduced in Milestone-3, but early versions didn't work with spaces in the artifact pattern. + */ + boolean isFullySupportsIvyRepository(); + + /** + * Returns true if the wrapper for this version honours the --gradle-user-home command-line option. + */ + boolean isWrapperSupportsGradleUserHomeCommandLineOption(); + + /** + * Returns true if this version always adds a task execution exception around all failures, such as input fingerprinting or property validation failures, rather than only around task action failures. + */ + boolean isAddsTaskExecutionExceptionAroundAllTaskFailures(); + + /** + * Returns true if this version retains the original build failure on cancellation (with all context) in the client and build logging, rather than discarding contextual exceptions. + */ + boolean isToolingApiRetainsOriginalFailureOnCancel(); + + /** + * Returns true if this version has a useful cause attached to the exception thrown by the tooling API client on build cancel. + */ + boolean isToolingApiHasCauseOnCancel(); + + /** + * Returns true if this version does not occasionally add additional 'build cancelled' exceptions when tasks are cancelled. + */ + boolean isToolingApiDoesNotAddCausesOnTaskCancel(); + + /** + * Returns true if this version has a useful cause attached to the exception thrown by the tooling API client when daemon is killed to force cancellation. + */ + boolean isToolingApiHasCauseOnForcedCancel(); + + /** + * Returns true if this version logs a 'build failed' message on build cancellation. + */ + boolean isToolingApiLogsFailureOnCancel(); + + /** + * Returns true if this version retains the original exception as cause on phased action fail. + */ + boolean isToolingApiHasCauseOnPhasedActionFail(); + + /** + * Returns true if this version logs errors to stdout instead of stderr. + */ + boolean isToolingApiMergesStderrIntoStdout(); + + /** + * Returns the logging output stream that this version logs build failures to when invoked via the tooling API. + */ + T selectOutputWithFailureLogging(T stdout, T stderr); + + /** + * Returns true if this version logs different build outcome messages for tooling API requests that run tasks and to requests that do not run tasks (eg fetch a model). + */ + boolean isToolingApiLogsConfigureSummary(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/integtests/fixtures/executer/ProjectLifecycleFixture.groovy b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/integtests/fixtures/executer/ProjectLifecycleFixture.groovy new file mode 100644 index 0000000..235df46 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/integtests/fixtures/executer/ProjectLifecycleFixture.groovy @@ -0,0 +1,58 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.integtests.fixtures.executer + +import org.gradle.test.fixtures.file.TestDirectoryProvider +import org.gradle.test.fixtures.file.TestFile + +import static java.util.Arrays.asList + +class ProjectLifecycleFixture extends InitScriptExecuterFixture { + + private TestFile fixtureData + + ProjectLifecycleFixture(GradleExecuter executer, TestDirectoryProvider testDir) { + super(executer, testDir) + } + + List configuredProjects + + String initScriptContent() { + fixtureData = testDir.testDirectory.file("lifecycle-fixture-data.txt") + """File outputFile = file("${fixtureData.toURI()}") + outputFile.text = '' + def listener = new ProjectEvaluationListener() { + void afterEvaluate(Project project, ProjectState state) { + outputFile << project.path + ";" + } + void beforeEvaluate(Project project) {} + } + gradle.addListener(listener) + buildFinished { + gradle.removeListener(listener) + }""" + } + + void afterBuild() { + configuredProjects = asList(fixtureData.text.split(";")) + assert fixtureData.delete() + } + + void assertProjectsConfigured(String ... projectPaths) { + assert configuredProjects == projectPaths + } +} \ No newline at end of file diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/integtests/fixtures/executer/UnderDevelopmentGradleDistribution.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/integtests/fixtures/executer/UnderDevelopmentGradleDistribution.java new file mode 100644 index 0000000..44fde28 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/integtests/fixtures/executer/UnderDevelopmentGradleDistribution.java @@ -0,0 +1,40 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.integtests.fixtures.executer; + +import org.gradle.test.fixtures.file.TestDirectoryProvider; + +public class UnderDevelopmentGradleDistribution extends DefaultGradleDistribution { + + public UnderDevelopmentGradleDistribution() { + this(IntegrationTestBuildContext.INSTANCE); + } + + public UnderDevelopmentGradleDistribution(IntegrationTestBuildContext buildContext) { + super( + buildContext.getVersion(), + buildContext.getGradleHomeDir(), + buildContext.getDistributionsDir().file(String.format("gradle-%s-bin.zip", buildContext.getVersion().getBaseVersion().getVersion())) + ); + } + + @Override + public GradleExecuter executer(TestDirectoryProvider testDirectoryProvider, IntegrationTestBuildContext buildContext) { + return new GradleContextualExecuter(this, testDirectoryProvider, buildContext).withWarningMode(null); + } +} + diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/integtests/fixtures/jvm/WindowsOracleJvmLocator.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/integtests/fixtures/jvm/WindowsOracleJvmLocator.java new file mode 100644 index 0000000..d4f672c --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/integtests/fixtures/jvm/WindowsOracleJvmLocator.java @@ -0,0 +1,68 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.integtests.fixtures.jvm; + +import net.rubygrapefruit.platform.MissingRegistryEntryException; +import net.rubygrapefruit.platform.SystemInfo; +import net.rubygrapefruit.platform.WindowsRegistry; +import org.gradle.api.JavaVersion; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +/** + * Uses windows registry to find installed Sun/Oracle JVMs + */ +class WindowsOracleJvmLocator { + private final WindowsRegistry windowsRegistry; + private final SystemInfo systemInfo; + + WindowsOracleJvmLocator(WindowsRegistry windowsRegistry, SystemInfo systemInfo) { + this.windowsRegistry = windowsRegistry; + this.systemInfo = systemInfo; + } + + public Collection findJvms() { + JvmInstallation.Arch defaultArch = systemInfo.getArchitecture() == SystemInfo.Architecture.i386 ? JvmInstallation.Arch.i386 : JvmInstallation.Arch.x86_64; + List jvms = new ArrayList(); + findJvms(windowsRegistry, "SOFTWARE\\JavaSoft\\Java Development Kit", jvms, true, defaultArch); + findJvms(windowsRegistry, "SOFTWARE\\JavaSoft\\Java Runtime Environment", jvms, false, defaultArch); + findJvms(windowsRegistry, "SOFTWARE\\Wow6432Node\\JavaSoft\\Java Development Kit", jvms, true, JvmInstallation.Arch.i386); + findJvms(windowsRegistry, "SOFTWARE\\Wow6432Node\\JavaSoft\\Java Runtime Environment", jvms, false, JvmInstallation.Arch.i386); + return jvms; + } + + private void findJvms(WindowsRegistry windowsRegistry, String sdkSubkey, Collection jvms, boolean jdk, JvmInstallation.Arch arch) { + List versions; + try { + versions = windowsRegistry.getSubkeys(WindowsRegistry.Key.HKEY_LOCAL_MACHINE, sdkSubkey); + } catch (MissingRegistryEntryException e) { + // Ignore + return; + } + + for (String version : versions) { + if (version.matches("\\d+\\.\\d+")) { + continue; + } + String javaHome = windowsRegistry.getStringValue(WindowsRegistry.Key.HKEY_LOCAL_MACHINE, sdkSubkey + '\\' + version, "JavaHome"); + jvms.add(new JvmInstallation(JavaVersion.toVersion(version), version, new File(javaHome), jdk, arch)); + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/integtests/fixtures/logging/GroupedTaskFixture.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/integtests/fixtures/logging/GroupedTaskFixture.java new file mode 100644 index 0000000..7ab1d0a --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/integtests/fixtures/logging/GroupedTaskFixture.java @@ -0,0 +1,67 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.integtests.fixtures.logging; + +import org.gradle.api.specs.Spec; + +import java.util.ArrayList; +import java.util.List; + +import static org.gradle.util.CollectionUtils.filter; +import static org.gradle.util.CollectionUtils.join; + +public class GroupedTaskFixture { + + private final String taskName; + + private String taskOutcome; + + private final List outputs = new ArrayList(1); + + public GroupedTaskFixture(String taskName) { + this.taskName = taskName; + } + + protected void addOutput(String output) { + outputs.add(output); + } + + public void setOutcome(String taskOutcome) { + if (this.taskOutcome != null) { + throw new AssertionError(taskName + " task's outcome is set twice!"); + } + this.taskOutcome = taskOutcome; + } + + public String getOutcome(){ + return taskOutcome; + } + + public String getName() { + return taskName; + } + + public String getOutput() { + List nonEmptyOutputs = filter(outputs, new Spec() { + @Override + public boolean isSatisfiedBy(String string) { + return !string.equals(""); + } + }); + return join("\n", nonEmptyOutputs); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/integtests/fixtures/longlived/PersistentBuildProcessIntegrationTest.groovy b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/integtests/fixtures/longlived/PersistentBuildProcessIntegrationTest.groovy new file mode 100644 index 0000000..460f82c --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/integtests/fixtures/longlived/PersistentBuildProcessIntegrationTest.groovy @@ -0,0 +1,32 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.integtests.fixtures.longlived + +import org.gradle.integtests.fixtures.AbstractIntegrationSpec +import org.gradle.integtests.fixtures.executer.GradleContextualExecuter +import org.gradle.util.Requires + +/** + * Base class for test that test the behaviour of Gradle when running subsequent builds in the same build process. + */ +@Requires(adhoc = { GradleContextualExecuter.longLivingProcess }) +class PersistentBuildProcessIntegrationTest extends AbstractIntegrationSpec { + + def setup() { + executer.requireIsolatedDaemons() + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/internal/scan/config/fixtures/BuildScanPluginFixture.groovy b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/internal/scan/config/fixtures/BuildScanPluginFixture.groovy new file mode 100644 index 0000000..23cc2f5 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/internal/scan/config/fixtures/BuildScanPluginFixture.groovy @@ -0,0 +1,163 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.scan.config.fixtures + +import groovy.json.JsonSlurper +import org.gradle.integtests.fixtures.executer.GradleExecuter +import org.gradle.internal.scan.config.BuildScanConfig +import org.gradle.internal.scan.config.BuildScanPluginApplied +import org.gradle.plugin.management.internal.autoapply.AutoAppliedBuildScanPlugin +import org.gradle.test.fixtures.file.TestFile +import org.gradle.test.fixtures.maven.MavenFileRepository +import org.gradle.test.fixtures.plugin.PluginBuilder + +import static org.gradle.test.fixtures.plugin.PluginBuilder.packageName + +@SuppressWarnings("GrMethodMayBeStatic") +class BuildScanPluginFixture { + + private static final String PLUGIN_NOT_APPLIED_MSG = """Build scan cannot be created because the build scan plugin was not applied. +For more information on how to apply the build scan plugin, please visit https://gradle.com/scans/help/gradle-cli.""" + + public static final String BUILD_SCAN_PLUGIN_ID = AutoAppliedBuildScanPlugin.ID.id + public static final String PUBLISHING_BUILD_SCAN_MESSAGE_PREFIX = 'PUBLISHING BUILD SCAN v' + public static final String DUMMY_BUILD_SCAN_PLUGIN_IMPL_CLASS = 'DummyBuildScanPlugin' + public static final String FULLY_QUALIFIED_DUMMY_BUILD_SCAN_PLUGIN_IMPL_CLASS = "${packageName}.${DUMMY_BUILD_SCAN_PLUGIN_IMPL_CLASS}" + + private final TestFile projectDir + private final MavenFileRepository mavenRepo + private final GradleExecuter pluginBuildExecuter + + boolean collectConfig = true + boolean logConfig + boolean logApplied + + protected boolean added + + String runtimeVersion = AutoAppliedBuildScanPlugin.VERSION + String artifactVersion = AutoAppliedBuildScanPlugin.VERSION + + BuildScanPluginFixture(TestFile projectDir, MavenFileRepository mavenRepo, GradleExecuter pluginBuildExecuter) { + this.projectDir = projectDir + this.mavenRepo = mavenRepo + this.pluginBuildExecuter = pluginBuildExecuter + } + + String pluginManagement() { + """ + pluginManagement { + repositories { + maven { url '${mavenRepo.uri}' } + } + } + """ + } + + void publishDummyBuildScanPlugin(GradleExecuter executer) { + executer.beforeExecute { + publishDummyBuildScanPluginNow() + } + } + + void publishDummyBuildScanPluginNow() { + if (added) { + return + } + + added = true + + def buildFile = projectDir.file("build.gradle") + buildFile << """ + org.gradle.internal.scan.config.BuildScanPluginMetadata buildScanPluginMetadata = { "${runtimeVersion}" } as org.gradle.internal.scan.config.BuildScanPluginMetadata + def buildScanPluginConfig + if ($collectConfig) { + def c = project.gradle.services.get(org.gradle.internal.scan.config.BuildScanConfigProvider).collect(buildScanPluginMetadata) + buildScanPluginConfig = c + if ($logConfig) { + println "buildScan.enabled: " + c.enabled + println "buildScan.disabled: " + c.disabled + println "buildScan.unsupportedMessage: " + c.unsupportedMessage + println "buildScan.attributes: " + groovy.json.JsonOutput.toJson(c.attributes) + } + } + """ + if (logApplied) { + buildFile << """ + def pluginApplied = services.get(${BuildScanPluginApplied.name}).isBuildScanPluginApplied() + println "buildScan plugin applied: " + pluginApplied + """ + } + + def builder = new PluginBuilder(projectDir.file('plugin-' + AutoAppliedBuildScanPlugin.ID.id)) + builder.addPlugin(""" + project.gradle.buildFinished { + println '${PUBLISHING_BUILD_SCAN_MESSAGE_PREFIX}${runtimeVersion}' + } +""", BUILD_SCAN_PLUGIN_ID, DUMMY_BUILD_SCAN_PLUGIN_IMPL_CLASS) + + builder.publishAs("com.gradle:build-scan-plugin:${artifactVersion}", mavenRepo, pluginBuildExecuter) + } + + void assertDisabled(String output, boolean disabled) { + assert output.contains("buildScan.disabled: $disabled") + } + + void assertEnabled(String output, boolean enabled) { + assert output.contains("buildScan.enabled: $enabled") + } + + void assertUnsupportedMessage(String output, String unsupported) { + assert output.contains("buildScan.unsupportedMessage: $unsupported") + } + + BuildScanConfig.Attributes attributes(String output) { + def all = allAttributes(output) + all.empty ? null : all.first() + } + + List allAttributes(String output) { + output.findAll("buildScan\\.attributes: \\{(.+)\\}\\\n") { + it[1] + }.collect { + def map = new JsonSlurper().parseText("{" + it + "}") + new BuildScanConfig.Attributes() { + @Override + boolean isRootProjectHasVcsMappings() { + return map.rootProjectHasVcsMappings + } + + @Override + boolean isTaskExecutingBuild() { + return map.taskExecutingBuild + } + } + } + } + + void issuedNoPluginWarning(String output) { + assert output.contains(PLUGIN_NOT_APPLIED_MSG) + } + + void didNotIssuedNoPluginWarning(String output) { + assert !output.contains(PLUGIN_NOT_APPLIED_MSG) + } + + void issuedNoPluginWarningCount(String output, int count) { + assert output.count(PLUGIN_NOT_APPLIED_MSG) == count + } + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/test/fixtures/GradleMetadataAwarePublishingSpec.groovy b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/test/fixtures/GradleMetadataAwarePublishingSpec.groovy new file mode 100644 index 0000000..9332a81 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/test/fixtures/GradleMetadataAwarePublishingSpec.groovy @@ -0,0 +1,66 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.test.fixtures + +import groovy.transform.CompileStatic +import groovy.transform.SelfType +import org.gradle.integtests.fixtures.AbstractIntegrationSpec +import org.gradle.integtests.fixtures.FeaturePreviewsFixture +import org.gradle.test.fixtures.ivy.IvyModule +import org.gradle.test.fixtures.maven.MavenModule + +@CompileStatic +@SelfType(AbstractIntegrationSpec) +trait GradleMetadataAwarePublishingSpec { + boolean publishModuleMetadata = true + boolean requiresExternalDependencies + + // cannot use "setup" because of a bug with Spock + void prepare() { + executer.beforeExecute { + if (publishModuleMetadata) { + FeaturePreviewsFixture.enableGradleMetadata(settingsFile) + } + } + } + + void disableModuleMetadataPublishing() { + publishModuleMetadata = false + } + + static String sq(String input) { + return escapeForSingleQuoting(input) + } + + static String escapeForSingleQuoting(String input) { + return input.replace('\\', '\\\\').replace('\'', '\\\'') + } + + static String convertDependencyNotation(Object notation) { + if (notation instanceof CharSequence) { + return notation + } + if (notation instanceof IvyModule) { + return "group: '${sq(notation.organisation)}', name: '${sq(notation.module)}', version: '${sq(notation.revision)}'" + } + if (notation instanceof MavenModule) { + return "group: '${sq(notation.groupId)}', name: '${sq(notation.artifactId)}', version: '${sq(notation.version)}'" + } + throw new UnsupportedOperationException("Unsupported dependency notation: $notation") + } + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/test/fixtures/plugin/PluginBuilder.groovy b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/test/fixtures/plugin/PluginBuilder.groovy new file mode 100644 index 0000000..9f38325 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/test/fixtures/plugin/PluginBuilder.groovy @@ -0,0 +1,247 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.test.fixtures.plugin + +import com.google.common.base.Splitter +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.api.Task +import org.gradle.integtests.fixtures.executer.GradleExecuter +import org.gradle.model.ModelMap +import org.gradle.model.Mutate +import org.gradle.model.RuleSource +import org.gradle.test.fixtures.HttpModule +import org.gradle.test.fixtures.Module +import org.gradle.test.fixtures.file.TestFile +import org.gradle.test.fixtures.ivy.IvyRepository +import org.gradle.test.fixtures.maven.MavenRepository +import org.gradle.test.fixtures.server.http.MavenHttpPluginRepository +import org.gradle.util.TextUtil + +class PluginBuilder { + static final String PLUGIN_MARKER_SUFFIX = ".gradle.plugin"; + + final TestFile projectDir + + static String packageName = "org.gradle.test" + + final Map pluginIds = [:] + + PluginBuilder(TestFile projectDir) { + this.projectDir = projectDir + } + + TestFile file(String path) { + projectDir.file(path) + } + + TestFile groovy(String path) { + file("src/main/groovy/${packageName.replaceAll("\\.", "/")}/$path") + } + + @SuppressWarnings("GrMethodMayBeStatic") + String generateManagedBuildScript() { + """ + apply plugin: "groovy" + dependencies { + compile localGroovy() + compile gradleApi() + } + """ + } + + String generateBuildScript(String additions = "") { + file("build.gradle").text = (generateManagedBuildScript() + additions) + } + + void publishTo(GradleExecuter executer, TestFile testFile) { + generateBuildScript """ + jar { + archiveName = "$testFile.name" + destinationDir = file("${TextUtil.escapeString(testFile.parentFile.absolutePath)}") + } + """ + + writePluginDescriptors(pluginIds) + projectDir.file('settings.gradle').write('') + executer.inDirectory(projectDir).withTasks("jar").run() + } + + PluginPublicationResults publishAs(String coordinates, MavenRepository mavenRepo, GradleExecuter executer) { + List gav = Splitter.on(":").splitToList(coordinates) + return publishAs(gav.get(0), gav.get(1), gav.get(2), mavenRepo, executer) + } + + PluginHttpPublicationResults publishAs(String group, String artifact, String version, MavenHttpPluginRepository mavenRepo, GradleExecuter executer) { + return new PluginHttpPublicationResults(publishAs(group, artifact, version, mavenRepo as MavenRepository, executer)) + } + + PluginPublicationResults publishAs(String group, String artifact, String version, MavenRepository mavenRepo, GradleExecuter executer) { + + // The implementation jar module. + def module = mavenRepo.module(group, artifact, version) + def pluginModule = module.publish() + def artifactFile = module.getArtifactFile() + + def markerModules = new ArrayList() + + pluginIds.keySet().each { id -> + // The marker files for each plugin. + def marker = mavenRepo.module(id, id + PLUGIN_MARKER_SUFFIX, version) + marker.dependsOn(module) + markerModules.add(marker.publish()) + } + + publishTo(executer, artifactFile) + + return new PluginPublicationResults(pluginModule, markerModules) + } + + PluginPublicationResults publishAs(String coordinates, IvyRepository ivyRepo, GradleExecuter executer) { + List omr = Splitter.on(":").splitToList(coordinates) + + // The implementation jar module. + def module = ivyRepo.module(omr.get(0), omr.get(1), omr.get(2)) + def artifactFile = module.artifact([:]).getJarFile() + module.publish() + + def markerModules = new ArrayList() + + pluginIds.keySet().each { id -> + // The marker files for each plugin. + def marker = ivyRepo.module(id, id + PLUGIN_MARKER_SUFFIX, omr[2]) + marker.dependsOn(module) + marker.publish() + markerModules.add(marker) + } + + publishTo(executer, artifactFile); + + return new PluginPublicationResults(module, markerModules) + } + + void generateForBuildSrc() { + generateBuildScript() + writePluginDescriptors(pluginIds) + } + + protected void writePluginDescriptors(Map pluginIds) { + descriptorsDir.deleteDir() + pluginIds.each { id, className -> + descriptorsDir.file("${id}.properties") << "implementation-class=${packageName}.${className}" + } + } + + TestFile getDescriptorsDir() { + file("src/main/resources/META-INF/gradle-plugins") + } + + private addPluginSource(String id, String className, String impl) { + pluginIds[id] = className + + groovy("${className}.groovy") << impl + } + + PluginBuilder addPlugin(String impl, String id = "test-plugin", String className = "TestPlugin") { + addPluginSource(id, className, """ + package $packageName + + class $className implements $Plugin.name<$Project.name> { + void apply($Project.name project) { + $impl + } + } + """) + this + } + + PluginBuilder addUnloadablePlugin(String id = "test-plugin", String className = "TestPlugin") { + addPluginSource(id, className, """ + package $packageName + + class $className implements $Plugin.name<$Project.name> { + static { throw new Exception("unloadable plugin class") } + void apply($Project.name project) { + } + } + """) + this + } + + PluginBuilder addNonConstructablePlugin(String id = "test-plugin", String className = "TestPlugin") { + addPluginSource(id, className, """ + package $packageName + + class $className implements $Plugin.name<$Project.name> { + $className() { throw new RuntimeException("broken plugin") } + void apply($Project.name project) { + } + } + """) + this + } + + PluginBuilder addPluginWithPrintlnTask(String taskName, String message, String id = "test-plugin", String className = "TestPlugin") { + addPlugin("project.task(\"$taskName\") { doLast { println \"$message\" } }", id, className) + this + } + + PluginBuilder addRuleSource(String pluginId) { + String className = "TestRuleSource" + addPluginSource(pluginId, className, """ + package $packageName + + class $className extends $RuleSource.name { + @$Mutate.name + void addTask($ModelMap.name<$Task.name> tasks) { + tasks.create("fromModelRule") { + it.doLast { + println "Model rule provided task executed" + } + } + } + } + """) + this + } + + class PluginPublicationResults { + final Module pluginModule + final List markerModules + + PluginPublicationResults(pluginModule, markerModules) { + this.pluginModule = pluginModule + this.markerModules = markerModules + } + } + + class PluginHttpPublicationResults extends PluginPublicationResults { + final HttpModule pluginModule + final List markerModules + + PluginHttpPublicationResults(PluginPublicationResults results) { + super(results.pluginModule, results.markerModules) + this.pluginModule = results.pluginModule as HttpModule + this.markerModules = results.markerModules as List + } + + PluginHttpPublicationResults allowAll() { + ([pluginModule] + markerModules)*.allowAll() + return this + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/test/fixtures/server/http/RepositoryHttpServer.groovy b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/test/fixtures/server/http/RepositoryHttpServer.groovy new file mode 100644 index 0000000..68d839c --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/test/fixtures/server/http/RepositoryHttpServer.groovy @@ -0,0 +1,62 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.test.fixtures.server.http + +import org.gradle.test.fixtures.HttpRepository +import org.gradle.test.fixtures.file.TestDirectoryProvider +import org.gradle.test.fixtures.ivy.IvyFileRepository +import org.gradle.test.fixtures.server.RepositoryServer +import org.gradle.util.GradleVersion + +import static org.gradle.test.matchers.UserAgentMatcher.matchesNameAndVersion + +class RepositoryHttpServer extends HttpServer implements RepositoryServer { + + private TestDirectoryProvider testDirectoryProvider + private String gradleVersion + + RepositoryHttpServer(TestDirectoryProvider testDirectoryProvider) { + this(testDirectoryProvider, GradleVersion.current().getVersion()) + } + + RepositoryHttpServer(TestDirectoryProvider testDirectoryProvider, String gradleVersion) { + this.testDirectoryProvider = testDirectoryProvider + this.gradleVersion = gradleVersion + } + + @Override + protected void before() throws Throwable { + start() + expectUserAgent(matchesNameAndVersion("Gradle", gradleVersion)) + } + + private IvyFileRepository getBackingRepository(boolean m2Compatible = false, String dirPattern = null, String ivyFilePattern = null, String artifactFilePattern = null) { + new IvyFileRepository(testDirectoryProvider.testDirectory.file('ivy-repo'), m2Compatible, dirPattern, ivyFilePattern, artifactFilePattern) + } + + IvyHttpRepository getRemoteIvyRepo(boolean m2Compatible = false, String dirPattern = null, String ivyFilePattern = null, String artifactFilePattern = null) { + return new IvyHttpRepository(this, '/repo', HttpRepository.MetadataType.DEFAULT, getBackingRepository(m2Compatible, dirPattern, ivyFilePattern, artifactFilePattern), m2Compatible) + } + + IvyHttpRepository getRemoteIvyRepo(String contextPath) { + new IvyHttpRepository(this, contextPath, backingRepository) + } + + String getValidCredentials() { + return "" + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/test/fixtures/server/http/TestUserRealm.groovy b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/test/fixtures/server/http/TestUserRealm.groovy new file mode 100644 index 0000000..c3f4a7f --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/org/gradle/test/fixtures/server/http/TestUserRealm.groovy @@ -0,0 +1,70 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.test.fixtures.server.http; + +import org.mortbay.jetty.Request; +import org.mortbay.jetty.security.Password; +import org.mortbay.jetty.security.UserRealm; + +import java.security.Principal; + +class TestUserRealm implements UserRealm { + String username + String password + + Principal authenticate(String username, Object credentials, Request request) { + Password passwordCred = new Password(password) + if (username == this.username && passwordCred.check(credentials)) { + return getPrincipal(username) + } + return null + } + + String getName() { + return "test" + } + + Principal getPrincipal(String username) { + return new Principal() { + String getName() { + return username + } + } + } + + boolean reauthenticate(Principal user) { + return false + } + + boolean isUserInRole(Principal user, String role) { + return false + } + + void disassociate(Principal user) { + } + + Principal pushRole(Principal user, String role) { + return user + } + + Principal popRole(Principal user) { + return user + } + + void logout(Principal user) { + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/test-key-store/trustStore b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/test-key-store/trustStore new file mode 100644 index 0000000..209c33e Binary files /dev/null and b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-integ-testing/test-key-store/trustStore differ diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-performance-testing/org/gradle/performance/results/ScenarioDefinition.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-performance-testing/org/gradle/performance/results/ScenarioDefinition.java new file mode 100644 index 0000000..8d97ba8 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-performance-testing/org/gradle/performance/results/ScenarioDefinition.java @@ -0,0 +1,59 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.performance.results; + +import javax.annotation.Nullable; +import java.util.List; + +public interface ScenarioDefinition { + /** + * A human consumable display name for this definition. + */ + String getDisplayName(); + + /** + * The test project name. + */ + String getTestProject(); + + /** + * The tasks executed. + */ + List getTasks(); + + /** + * The clean tasks executed. + */ + List getCleanTasks(); + + /** + * The Gradle arguments. + */ + List getArgs(); + + /** + * The Gradle JVM args. Null if not known + */ + @Nullable + List getGradleOpts(); + + /** + * Was the daemon used. Null if not known + */ + @Nullable + Boolean getDaemon(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-performance-testing/org/gradle/performance/results/SlackReporter.groovy b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-performance-testing/org/gradle/performance/results/SlackReporter.groovy new file mode 100644 index 0000000..f339b1e --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-performance-testing/org/gradle/performance/results/SlackReporter.groovy @@ -0,0 +1,121 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.performance.results + +import com.google.common.base.Charsets +import org.apache.http.HttpStatus +import org.apache.http.client.methods.HttpPost +import org.apache.http.entity.StringEntity +import org.apache.http.impl.client.CloseableHttpClient +import org.apache.http.impl.client.HttpClients +import org.mortbay.util.ajax.JSON +import org.slf4j.Logger +import org.slf4j.LoggerFactory + +class SlackReporter implements DataReporter { + private static final Logger LOGGER = LoggerFactory.getLogger(SlackReporter) + private static final String[] NOTIFY_BRANCHES = ["master", "release"] + private static final String SLACK_WEBHOOK_URL_ENV = "SLACK_WEBHOOK_URL" + private static final String SLACK_PERFORMANCE_REPORT_CHANNEL_ENV = "SLACK_PERFORMANCE_REPORT_CHANNEL" + private static final String BUILD__URL_ENV = "BUILD_URL" + private static final String[] EXCLAMATIONS = ["Hurrah!", "Whoopee!", "Excellent!", "Yippee!", "Splendid!", "OMG!", "Amazing!", "Fantastic!", "Awesome!", "Brilliant!"] + + private final URI webhook + private final String slackPerformanceReportChannel + private final CloseableHttpClient httpClient + private final String buildUrl + private final DataReporter delegate + + SlackReporter(URI webhook, String slackPerformanceReportChannel, DataReporter delegate) { + this.webhook = webhook + this.slackPerformanceReportChannel = slackPerformanceReportChannel + this.delegate = delegate + this.httpClient = HttpClients.createDefault() + this.buildUrl = System.getenv(BUILD__URL_ENV) + } + + @Override + void report(CrossVersionPerformanceResults results) { + delegate.report(results) + + if (!NOTIFY_BRANCHES.contains(results.vcsBranch)) { + return + } + + def significantlyFasterThanBaselines = results.baselineVersions.every { it.significantlySlowerThan(results.current) } + if (!significantlyFasterThanBaselines) { + return + } + + def exclamation = EXCLAMATIONS[new Random().nextInt(EXCLAMATIONS.length)] + def changes = "" + def message = "$exclamation Looks like *${results.testId}* is now faster on `${results.vcsBranch}` after $changes." + if (buildUrl) { + message += " (<$buildUrl|Go to build>)" + } + + def stats = results.baselineVersions.collect { baseline -> + baseline.getSpeedStatsAgainst(results.displayName, results.current).trim() + } + + def json = JSON.toString( + text: message, + username: "Performance tests", + icon_emoji: ":dash:", + channel: slackPerformanceReportChannel, + attachments: stats.collect { + [ + text: "```\n$it\n```", + mrkdwn_in: ["text"] + ] + } + ) + + def post = new HttpPost(webhook) + post.setHeader("Accept", "application/json") + post.setHeader("Content-type", "application/json") + post.setEntity(new StringEntity(json, Charsets.UTF_8)) + + def response = httpClient.execute(post) + try { + if (response.statusLine.statusCode != HttpStatus.SC_OK) { + LOGGER.warn("Could not notify Slack: {}", response.statusLine) + } + } finally { + response.close() + } + } + + static DataReporter wrap(DataReporter reporter) { + def slackWebhookUrl = System.getenv(SLACK_WEBHOOK_URL_ENV) + def slackPerformanceReportChannel = System.getenv(SLACK_PERFORMANCE_REPORT_CHANNEL_ENV) + if (slackWebhookUrl) { + new SlackReporter(URI.create(slackWebhookUrl), slackPerformanceReportChannel, reporter) + } else { + return reporter + } + } + + @Override + void close() { + try { + httpClient.close() + } finally { + delegate.close() + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-performance-testing/org/gradle/reporting/report.js b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-performance-testing/org/gradle/reporting/report.js new file mode 100644 index 0000000..8aecac0 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-performance-testing/org/gradle/reporting/report.js @@ -0,0 +1,63 @@ +$(document).ready(function () { + + // Attach controls for column groups in tables + var controls = $("div#controls"); + var groups = []; + var slices = []; + $("tr.control-groups").closest("table").find("tr").each(function() { + var row = $(this); + if (row.hasClass('control-groups')) { + var currentCol = 0; + slices = []; + row.find("th").each(function(){ + var e = $(this); + var title = e.text().trim(); + var startCol = currentCol; + currentCol += parseInt(e.attr('colspan')); + var endCol = currentCol; + if (title.length == 0) { + return; + } + var id = title.replace(/[^\w]/g, '-').toLowerCase(); + if (groups.indexOf(id) < 0) { + groups.push(id); + var div = controls.append("
"); + div.append(""); + var checkbox = $("", {type: "checkbox", id: id, checked: true}); + div.append(checkbox); + checkbox.change(function () { + if (checkbox.is(':checked')) { + $("." + id).show(); + } else { + $("." + id).hide(); + } + }); + } + e.addClass(id); + for (var i = startCol; i < endCol; i++) { + slices[i] = id; + } + }); + } else { + row.find("td,th").each(function(index){ + $(this).addClass(slices[index]); + }) + } + }); + + // Add alternate row styles for tables + $("table").each(function () { + var counter = 0; + $(this).find("tr").each(function () { + var e = $(this); + if (e.children("th").length > 0) { + counter = 0; + return; + } + if (counter % 2 == 0) { + e.addClass("table-row-even"); + } + counter++; + }) + }); +}); diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-testing/org/gradle/util/RedirectStdIn.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-testing/org/gradle/util/RedirectStdIn.java new file mode 100644 index 0000000..e7ceada --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/internal-testing/org/gradle/util/RedirectStdIn.java @@ -0,0 +1,84 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.util; + +import org.gradle.internal.UncheckedException; +import org.gradle.internal.concurrent.CompositeStoppable; +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.Statement; + +import java.io.IOException; +import java.io.InputStream; +import java.io.PipedInputStream; +import java.io.PipedOutputStream; + +/** + * A Junit rule which restores System.in at the end of the test. + * + * Provides a pipe for providing input to System.in in the tests + */ +public class RedirectStdIn implements TestRule { + private PipedInputStream emulatedSystemIn = new PipedInputStream(); + private PipedOutputStream stdinPipe; + + @Override + public Statement apply(final Statement base, Description description) { + return new Statement() { + @Override + public void evaluate() throws Throwable { + final InputStream originalStdIn = System.in; + initPipe(); + System.setIn(emulatedSystemIn); + try { + base.evaluate(); + } finally { + System.setIn(originalStdIn); + closePipe(); + } + } + }; + } + + public PipedOutputStream getStdinPipe() { + initPipe(); + return stdinPipe; + } + + private void initPipe() { + if (stdinPipe == null) { + emulatedSystemIn = new PipedInputStream(); + try { + stdinPipe = new PipedOutputStream(emulatedSystemIn); + } catch (IOException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + } + + public void resetStdinPipe() { + closePipe(); + initPipe(); + System.setIn(emulatedSystemIn); + } + + private void closePipe() { + CompositeStoppable.stoppable(stdinPipe, emulatedSystemIn).stop(); + stdinPipe = null; + emulatedSystemIn = null; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/jacoco/org/gradle/testing/jacoco/tasks/JacocoReportsContainer.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/jacoco/org/gradle/testing/jacoco/tasks/JacocoReportsContainer.java new file mode 100644 index 0000000..59f62e3 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/jacoco/org/gradle/testing/jacoco/tasks/JacocoReportsContainer.java @@ -0,0 +1,52 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.testing.jacoco.tasks; + +import org.gradle.api.reporting.ConfigurableReport; +import org.gradle.api.reporting.DirectoryReport; +import org.gradle.api.reporting.ReportContainer; +import org.gradle.api.reporting.SingleFileReport; +import org.gradle.api.tasks.Internal; + +/** + * The reporting configuration for the {@link JacocoReport} task. + */ +public interface JacocoReportsContainer extends ReportContainer { + /** + * The JaCoCo HTML report + * + * @return The JaCoCo HTML report + */ + @Internal + DirectoryReport getHtml(); + + /** + * The JaCoCo (single file) XML report + * + * @return The JaCoCo (single file) XML report + */ + @Internal + SingleFileReport getXml(); + + /** + * The JaCoCo (single file) CSV report + * + * @return The JaCoCo (single file) CSV report + */ + @Internal + SingleFileReport getCsv(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-groovy/org/gradle/api/tasks/javadoc/Groovydoc.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-groovy/org/gradle/api/tasks/javadoc/Groovydoc.java new file mode 100644 index 0000000..cc277d2 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-groovy/org/gradle/api/tasks/javadoc/Groovydoc.java @@ -0,0 +1,450 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.tasks.javadoc; + +import org.gradle.api.InvalidUserDataException; +import org.gradle.api.file.FileCollection; +import org.gradle.api.file.FileTree; +import org.gradle.api.internal.ClassPathRegistry; +import org.gradle.api.internal.project.IsolatedAntBuilder; +import org.gradle.api.internal.tasks.AntGroovydoc; +import org.gradle.api.logging.LogLevel; +import org.gradle.api.resources.TextResource; +import org.gradle.api.tasks.CacheableTask; +import org.gradle.api.tasks.Classpath; +import org.gradle.api.tasks.Input; +import org.gradle.api.tasks.Internal; +import org.gradle.api.tasks.Nested; +import org.gradle.api.tasks.Optional; +import org.gradle.api.tasks.OutputDirectory; +import org.gradle.api.tasks.PathSensitive; +import org.gradle.api.tasks.PathSensitivity; +import org.gradle.api.tasks.SourceTask; +import org.gradle.api.tasks.TaskAction; +import org.gradle.util.GFileUtils; + +import javax.annotation.Nullable; +import java.io.File; +import java.io.Serializable; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; + +// This import must be here due to a clash in Java 8 between this and java.util.Optional. +// Be careful running “Optimize Imports” as it will wipe this out. +// If there's no import below this comment, this has happened. + +/** + *

Generates HTML API documentation for Groovy source, and optionally, Java source. + * + *

This task uses Groovy's Groovydoc tool to generate the API documentation. Please note + * that the Groovydoc tool has some limitations at the moment. The version of the Groovydoc + * that is used, is the one from the Groovy dependency defined in the build script. + */ +@CacheableTask +public class Groovydoc extends SourceTask { + private FileCollection groovyClasspath; + + private FileCollection classpath; + + private File destinationDir; + + private AntGroovydoc antGroovydoc; + + private boolean use; + + private boolean noTimestamp; + + private boolean noVersionStamp; + + private String windowTitle; + + private String docTitle; + + private String header; + + private String footer; + + private TextResource overview; + + private Set links = new LinkedHashSet(); + + boolean includePrivate; + + public Groovydoc() { + getLogging().captureStandardOutput(LogLevel.INFO); + } + + @TaskAction + protected void generate() { + checkGroovyClasspathNonEmpty(getGroovyClasspath().getFiles()); + GFileUtils.cleanDirectory(getDestinationDir()); + getAntGroovydoc().execute(getSource(), getDestinationDir(), isUse(), isNoTimestamp(), isNoVersionStamp(), getWindowTitle(), + getDocTitle(), getHeader(), getFooter(), getPathToOverview(), isIncludePrivate(), getLinks(), getGroovyClasspath(), + getClasspath(), getProject()); + } + + @Nullable + private String getPathToOverview() { + TextResource overview = getOverviewText(); + if (overview!=null) { + return overview.asFile().getAbsolutePath(); + } + return null; + } + + private void checkGroovyClasspathNonEmpty(Collection classpath) { + if (classpath.isEmpty()) { + throw new InvalidUserDataException("You must assign a Groovy library to the groovy configuration!"); + } + } + + /** + * {@inheritDoc} + */ + @PathSensitive(PathSensitivity.RELATIVE) + @Override + public FileTree getSource() { + return super.getSource(); + } + + /** + * Returns the directory to generate the documentation into. + * + * @return The directory to generate the documentation into + */ + @OutputDirectory + public File getDestinationDir() { + return destinationDir; + } + + /** + * Sets the directory to generate the documentation into. + */ + public void setDestinationDir(File destinationDir) { + this.destinationDir = destinationDir; + } + + /** + * Returns the classpath containing the Groovy library to be used. + * + * @return The classpath containing the Groovy library to be used + */ + @Classpath + public FileCollection getGroovyClasspath() { + return groovyClasspath; + } + + /** + * Sets the classpath containing the Groovy library to be used. + */ + public void setGroovyClasspath(FileCollection groovyClasspath) { + this.groovyClasspath = groovyClasspath; + } + + /** + * Returns the classpath used to locate classes referenced by the documented sources. + * + * @return The classpath used to locate classes referenced by the documented sources + */ + @Classpath + public FileCollection getClasspath() { + return classpath; + } + + /** + * Sets the classpath used to locate classes referenced by the documented sources. + */ + public void setClasspath(FileCollection classpath) { + this.classpath = classpath; + } + + @Internal + public AntGroovydoc getAntGroovydoc() { + if (antGroovydoc == null) { + IsolatedAntBuilder antBuilder = getServices().get(IsolatedAntBuilder.class); + ClassPathRegistry classPathRegistry = getServices().get(ClassPathRegistry.class); + antGroovydoc = new AntGroovydoc(antBuilder, classPathRegistry); + } + return antGroovydoc; + } + + public void setAntGroovydoc(AntGroovydoc antGroovydoc) { + this.antGroovydoc = antGroovydoc; + } + + /** + * Returns whether to create class and package usage pages. + */ + @Input + public boolean isUse() { + return use; + } + + /** + * Sets whether to create class and package usage pages. + */ + public void setUse(boolean use) { + this.use = use; + } + + /** + * Returns whether to include timestamp within hidden comment in generated HTML (Groovy >= 2.4.6). + */ + @Input + public boolean isNoTimestamp() { + return noTimestamp; + } + + /** + * Sets whether to include timestamp within hidden comment in generated HTML (Groovy >= 2.4.6). + */ + public void setNoTimestamp(boolean noTimestamp) { + this.noTimestamp = noTimestamp; + } + + /** + * Returns whether to include version stamp within hidden comment in generated HTML (Groovy >= 2.4.6). + */ + @Input + public boolean isNoVersionStamp() { + return noVersionStamp; + } + + /** + * Sets whether to include version stamp within hidden comment in generated HTML (Groovy >= 2.4.6). + */ + public void setNoVersionStamp(boolean noVersionStamp) { + this.noVersionStamp = noVersionStamp; + } + + /** + * Returns the browser window title for the documentation. Set to {@code null} when there is no window title. + */ + @Nullable + @Optional + @Input + public String getWindowTitle() { + return windowTitle; + } + + /** + * Sets the browser window title for the documentation. + * + * @param windowTitle A text for the windows title + */ + public void setWindowTitle(@Nullable String windowTitle) { + this.windowTitle = windowTitle; + } + + /** + * Returns the title for the package index(first) page. Set to {@code null} when there is no document title. + */ + @Nullable + @Optional + @Input + public String getDocTitle() { + return docTitle; + } + + /** + * Sets title for the package index(first) page (optional). + * + * @param docTitle the docTitle as HTML + */ + public void setDocTitle(@Nullable String docTitle) { + this.docTitle = docTitle; + } + + /** + * Returns the HTML header for each page. Set to {@code null} when there is no header. + */ + @Nullable + @Optional + @Input + public String getHeader() { + return header; + } + + /** + * Sets header text for each page (optional). + * + * @param header the header as HTML + */ + public void setHeader(@Nullable String header) { + this.header = header; + } + + /** + * Returns the HTML footer for each page. Set to {@code null} when there is no footer. + */ + @Nullable + @Optional + @Input + public String getFooter() { + return footer; + } + + /** + * Sets footer text for each page (optional). + * + * @param footer the footer as HTML + */ + public void setFooter(@Nullable String footer) { + this.footer = footer; + } + + /** + * Returns a HTML text to be used for overview documentation. Set to {@code null} when there is no overview text. + */ + @Nullable + @Optional + @Nested + public TextResource getOverviewText() { + return overview; + } + + /** + * Sets a HTML text to be used for overview documentation (optional). + *

+ * Example: {@code overviewText = resources.text.fromFile("/overview.html")} + */ + public void setOverviewText(@Nullable TextResource overviewText) { + this.overview = overviewText; + } + + /** + * Returns whether to include all classes and members (i.e. including private ones). + */ + @Input + public boolean isIncludePrivate() { + return includePrivate; + } + + /** + * Sets whether to include all classes and members (i.e. including private ones) if set to true. + */ + public void setIncludePrivate(boolean includePrivate) { + this.includePrivate = includePrivate; + } + + /** + * Returns the links to groovydoc/javadoc output at the given URL. + */ + @Input + public Set getLinks() { + return Collections.unmodifiableSet(links); + } + + /** + * Sets links to groovydoc/javadoc output at the given URL. + * + * @param links The links to set + * @see #link(String, String...) + */ + public void setLinks(Set links) { + this.links = links; + } + + /** + * Add links to groovydoc/javadoc output at the given URL. + * + * @param url Base URL of external site + * @param packages list of package prefixes + */ + public void link(String url, String... packages) { + links.add(new Link(url, packages)); + } + + /** + * A Link class represent a link between groovydoc/javadoc output and url. + */ + public static class Link implements Serializable { + private List packages = new ArrayList(); + private String url; + + /** + * Constructs a {@code Link}. + * + * @param url Base URL of external site + * @param packages list of package prefixes + */ + public Link(String url, String... packages) { + throwExceptionIfNull(url, "Url must not be null"); + if (packages.length == 0) { + throw new InvalidUserDataException("You must specify at least one package!"); + } + for (String aPackage : packages) { + throwExceptionIfNull(aPackage, "A package must not be null"); + } + this.packages = Arrays.asList(packages); + this.url = url; + } + + private void throwExceptionIfNull(String value, String message) { + if (value == null) { + throw new InvalidUserDataException(message); + } + } + + /** + * Returns a list of package prefixes to be linked with an external site. + */ + public List getPackages() { + return Collections.unmodifiableList(packages); + } + + /** + * Returns the base url for the external site. + */ + public String getUrl() { + return url; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + Link link = (Link) o; + + if (packages != null ? !packages.equals(link.packages) : link.packages != null) { + return false; + } + if (url != null ? !url.equals(link.url) : link.url != null) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = packages != null ? packages.hashCode() : 0; + result = 31 * result + (url != null ? url.hashCode() : 0); + return result; + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-java/org/gradle/api/internal/tasks/compile/CleaningJavaCompilerSupport.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-java/org/gradle/api/internal/tasks/compile/CleaningJavaCompilerSupport.java new file mode 100644 index 0000000..77a65b4 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-java/org/gradle/api/internal/tasks/compile/CleaningJavaCompilerSupport.java @@ -0,0 +1,51 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.tasks.compile; + +import org.gradle.api.tasks.WorkResult; +import org.gradle.language.base.internal.compile.Compiler; +import org.gradle.language.base.internal.tasks.StaleClassCleaner; + +import java.io.File; + +/** + * Deletes stale classes before invoking the actual compiler + */ +public abstract class CleaningJavaCompilerSupport implements org.gradle.language.base.internal.compile.Compiler { + @Override + public WorkResult execute(T spec) { + StaleClassCleaner cleaner = createCleaner(spec); + + addDirectory(cleaner, spec.getDestinationDir()); + MinimalJavaCompileOptions compileOptions = spec.getCompileOptions(); + addDirectory(cleaner, compileOptions.getAnnotationProcessorGeneratedSourcesDirectory()); + addDirectory(cleaner, compileOptions.getHeaderOutputDirectory()); + cleaner.execute(); + + Compiler compiler = getCompiler(); + return compiler.execute(spec); + } + + private void addDirectory(StaleClassCleaner cleaner, File dir) { + if (dir != null) { + cleaner.addDirToClean(dir); + } + } + + protected abstract Compiler getCompiler(); + + protected abstract StaleClassCleaner createCleaner(T spec); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-java/org/gradle/api/internal/tasks/compile/JdkJavaCompilerResult.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-java/org/gradle/api/internal/tasks/compile/JdkJavaCompilerResult.java new file mode 100644 index 0000000..37d4f96 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-java/org/gradle/api/internal/tasks/compile/JdkJavaCompilerResult.java @@ -0,0 +1,33 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.compile; + +import org.gradle.api.internal.tasks.compile.incremental.processing.AnnotationProcessingResult; +import org.gradle.workers.internal.DefaultWorkResult; + +public class JdkJavaCompilerResult extends DefaultWorkResult { + + private final AnnotationProcessingResult annotationProcessingResult = new AnnotationProcessingResult(); + + JdkJavaCompilerResult() { + super(true, null); + } + + public AnnotationProcessingResult getAnnotationProcessingResult() { + return annotationProcessingResult; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-java/org/gradle/language/java/internal/DefaultJavaLanguageSourceSet.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-java/org/gradle/language/java/internal/DefaultJavaLanguageSourceSet.java new file mode 100644 index 0000000..446a08d --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-java/org/gradle/language/java/internal/DefaultJavaLanguageSourceSet.java @@ -0,0 +1,38 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.language.java.internal; + +import org.gradle.jvm.Classpath; +import org.gradle.language.base.sources.BaseLanguageSourceSet; +import org.gradle.language.java.JavaSourceSet; +import org.gradle.language.jvm.internal.EmptyClasspath; +import org.gradle.platform.base.DependencySpecContainer; +import org.gradle.platform.base.internal.DefaultDependencySpecContainer; + +public class DefaultJavaLanguageSourceSet extends BaseLanguageSourceSet implements JavaSourceSet { + private final Classpath emptyClasspath = new EmptyClasspath(); + private final DefaultDependencySpecContainer dependencies = new DefaultDependencySpecContainer(); + + @Override + public Classpath getCompileClasspath() { + return emptyClasspath; + } + + @Override + public DependencySpecContainer getDependencies() { + return dependencies; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-jvm/org/gradle/language/jvm/tasks/ProcessResources.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-jvm/org/gradle/language/jvm/tasks/ProcessResources.java new file mode 100644 index 0000000..a7b8eb7 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-jvm/org/gradle/language/jvm/tasks/ProcessResources.java @@ -0,0 +1,35 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.language.jvm.tasks; + +import org.gradle.api.tasks.Copy; +import org.gradle.language.base.internal.tasks.SimpleStaleClassCleaner; +import org.gradle.language.base.internal.tasks.StaleClassCleaner; + +/** + * Copies resources from their source to their target directory, potentially processing them. + * Makes sure no stale resources remain in the target directory. + */ +public class ProcessResources extends Copy { + + @Override + protected void copy() { + StaleClassCleaner cleaner = new SimpleStaleClassCleaner(getOutputs()); + cleaner.addDirToClean(getDestinationDir()); + cleaner.execute(); + super.copy(); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/cpp/internal/DefaultCppComponent.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/cpp/internal/DefaultCppComponent.java new file mode 100644 index 0000000..152f10b --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/cpp/internal/DefaultCppComponent.java @@ -0,0 +1,131 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.cpp.internal; + +import org.gradle.api.Action; +import org.gradle.api.file.ConfigurableFileCollection; +import org.gradle.api.file.FileCollection; +import org.gradle.api.file.FileTree; +import org.gradle.api.internal.file.FileOperations; +import org.gradle.api.model.ObjectFactory; +import org.gradle.api.provider.Property; +import org.gradle.api.provider.SetProperty; +import org.gradle.api.tasks.util.PatternSet; +import org.gradle.internal.Cast; +import org.gradle.language.cpp.CppBinary; +import org.gradle.language.cpp.CppComponent; +import org.gradle.language.internal.DefaultBinaryCollection; +import org.gradle.language.nativeplatform.internal.ComponentWithNames; +import org.gradle.language.nativeplatform.internal.DefaultNativeComponent; +import org.gradle.language.nativeplatform.internal.Names; +import org.gradle.nativeplatform.TargetMachine; + +import javax.inject.Inject; +import java.util.Arrays; +import java.util.concurrent.Callable; + +public abstract class DefaultCppComponent extends DefaultNativeComponent implements CppComponent, ComponentWithNames { + private final FileCollection cppSource; + private final String name; + private final FileOperations fileOperations; + private final ConfigurableFileCollection privateHeaders; + private final FileCollection privateHeadersWithConvention; + private final Property baseName; + private final Names names; + private final DefaultBinaryCollection binaries; + private final SetProperty targetMachines; + + @Inject + public DefaultCppComponent(String name, FileOperations fileOperations, ObjectFactory objectFactory) { + super(fileOperations); + this.name = name; + this.fileOperations = fileOperations; + cppSource = createSourceView("src/" + name + "/cpp", Arrays.asList("cpp", "c++", "cc")); + privateHeaders = fileOperations.configurableFiles(); + privateHeadersWithConvention = createDirView(privateHeaders, "src/" + name + "/headers"); + baseName = objectFactory.property(String.class); + names = Names.of(name); + binaries = Cast.uncheckedCast(objectFactory.newInstance(DefaultBinaryCollection.class, CppBinary.class)); + targetMachines = objectFactory.setProperty(TargetMachine.class); + } + + @Override + public Names getNames() { + return names; + } + + @Override + public String getName() { + return name; + } + + protected FileCollection createDirView(final ConfigurableFileCollection dirs, final String conventionLocation) { + return fileOperations.immutableFiles(new Callable() { + @Override + public Object call() { + if (dirs.getFrom().isEmpty()) { + return fileOperations.immutableFiles(conventionLocation); + } + return dirs; + } + }); + } + + @Override + public Property getBaseName() { + return baseName; + } + + @Override + public FileCollection getCppSource() { + return cppSource; + } + + @Override + public ConfigurableFileCollection getPrivateHeaders() { + return privateHeaders; + } + + @Override + public void privateHeaders(Action action) { + action.execute(privateHeaders); + } + + @Override + public FileCollection getPrivateHeaderDirs() { + return privateHeadersWithConvention; + } + + @Override + public FileTree getHeaderFiles() { + return getAllHeaderDirs().getAsFileTree().matching(new PatternSet().include("**/*.h")); + } + + public FileCollection getAllHeaderDirs() { + return privateHeadersWithConvention; + } + + @Override + public DefaultBinaryCollection getBinaries() { + return binaries; + } + + @Override + public SetProperty getTargetMachines() { + return targetMachines; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/cpp/internal/NativeDependencyCache.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/cpp/internal/NativeDependencyCache.java new file mode 100644 index 0000000..dadd5a3 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/cpp/internal/NativeDependencyCache.java @@ -0,0 +1,118 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.cpp.internal; + +import com.google.common.io.Files; +import org.apache.commons.io.IOUtils; +import org.gradle.api.UncheckedIOException; +import org.gradle.cache.CacheRepository; +import org.gradle.cache.FileLockManager; +import org.gradle.cache.PersistentCache; +import org.gradle.cache.internal.filelock.LockOptionsBuilder; +import org.gradle.internal.Factory; +import org.gradle.internal.concurrent.Stoppable; +import org.gradle.internal.hash.FileHasher; +import org.gradle.internal.hash.HashUtil; +import org.gradle.nativeplatform.internal.modulemap.ModuleMap; + +import java.io.BufferedInputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +import static org.gradle.nativeplatform.internal.modulemap.GenerateModuleMapFile.generateFile; + +/** + * This is intended to be temporary, until more metadata can be published and the dependency resolution engine can deal with it. As such, it's not particularly performant or robust. + */ +public class NativeDependencyCache implements Stoppable { + private final PersistentCache cache; + private final FileHasher fileHasher; + + public NativeDependencyCache(CacheRepository cacheRepository, FileHasher fileHasher) { + cache = cacheRepository.cache("native-dep").withLockOptions(LockOptionsBuilder.mode(FileLockManager.LockMode.None)).open(); + this.fileHasher = fileHasher; + } + + /** + * Returns the directory containing the unzipped headers from the given zip. + */ + public File getUnpackedHeaders(final File headersZip, final String baseName) { + final String hash = HashUtil.compactStringFor(fileHasher.hash(headersZip)); + return cache.useCache(new Factory() { + @Override + public File create() { + File dir = new File(cache.getBaseDir(), hash + "/" + baseName); + if (dir.isDirectory()) { + return dir; + } + try { + unzipTo(headersZip, dir); + } catch (IOException e) { + // Intentionally doesn't clean up on failure + throw new UncheckedIOException("Could not unzip headers from " + headersZip, e); + } + return dir; + } + }); + } + + public File getModuleMapFile(final ModuleMap moduleMap) { + final String hash = HashUtil.compactStringFor(moduleMap.getHashCode()); + return cache.useCache(new Factory() { + @Override + public File create() { + File dir = new File(cache.getBaseDir(), "maps/" + hash + "/" + moduleMap.getModuleName()); + File moduleMapFile = new File(dir, "module.modulemap"); + if (!moduleMapFile.isFile()) { + generateFile(moduleMapFile, moduleMap.getModuleName(), moduleMap.getPublicHeaderPaths()); + } + return moduleMapFile; + } + }); + } + + private void unzipTo(File headersZip, File unzipDir) throws IOException { + ZipInputStream inputStream = new ZipInputStream(new BufferedInputStream(new FileInputStream(headersZip))); + try { + ZipEntry entry = null; + while ((entry = inputStream.getNextEntry()) != null) { + if (entry.isDirectory()) { + continue; + } + File outFile = new File(unzipDir, entry.getName()); + Files.createParentDirs(outFile); + FileOutputStream outputStream = new FileOutputStream(outFile); + try { + IOUtils.copyLarge(inputStream, outputStream); + } finally { + outputStream.close(); + } + } + } finally { + inputStream.close(); + } + } + + @Override + public void stop() { + cache.close(); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/nativeplatform/internal/ConfigurableComponentWithSharedLibrary.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/nativeplatform/internal/ConfigurableComponentWithSharedLibrary.java new file mode 100644 index 0000000..96a9864 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/nativeplatform/internal/ConfigurableComponentWithSharedLibrary.java @@ -0,0 +1,49 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.nativeplatform.internal; + +import org.gradle.api.Task; +import org.gradle.api.file.ConfigurableFileCollection; +import org.gradle.api.file.RegularFile; +import org.gradle.api.provider.Property; +import org.gradle.language.ComponentWithOutputs; +import org.gradle.language.nativeplatform.ComponentWithObjectFiles; +import org.gradle.language.nativeplatform.ComponentWithSharedLibrary; +import org.gradle.nativeplatform.tasks.LinkSharedLibrary; +import org.gradle.nativeplatform.toolchain.internal.PlatformToolProvider; + +/** + * A configurable view of a component that produces a shared library. This should become public in some form. + */ +public interface ConfigurableComponentWithSharedLibrary extends ComponentWithSharedLibrary, ComponentWithObjectFiles, ComponentWithOutputs, ComponentWithNames { + PlatformToolProvider getPlatformToolProvider(); + + @Override + Property getLinkFile(); + + @Override + Property getRuntimeFile(); + + @Override + Property getLinkTask(); + + @Override + Property getLinkFileProducer(); + + @Override + ConfigurableFileCollection getOutputs(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/nativeplatform/internal/SourceCompileTaskConfig.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/nativeplatform/internal/SourceCompileTaskConfig.java new file mode 100644 index 0000000..46da12f --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/nativeplatform/internal/SourceCompileTaskConfig.java @@ -0,0 +1,57 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.nativeplatform.internal; + +import org.gradle.api.DefaultTask; +import org.gradle.api.Project; +import org.gradle.api.tasks.util.PatternSet; +import org.gradle.language.base.internal.LanguageSourceSetInternal; +import org.gradle.language.nativeplatform.tasks.AbstractNativeCompileTask; +import org.gradle.language.nativeplatform.tasks.AbstractNativeSourceCompileTask; +import org.gradle.nativeplatform.internal.NativeBinarySpecInternal; +import org.gradle.nativeplatform.toolchain.internal.PreCompiledHeader; + +import java.io.File; + +public class SourceCompileTaskConfig extends CompileTaskConfig { + public SourceCompileTaskConfig(NativeLanguageTransform languageTransform, Class taskType) { + super(languageTransform, taskType); + } + + @Override + protected void configureCompileTask(AbstractNativeCompileTask abstractTask, final NativeBinarySpecInternal binary, final LanguageSourceSetInternal sourceSet) { + AbstractNativeSourceCompileTask task = (AbstractNativeSourceCompileTask) abstractTask; + + task.setDescription("Compiles the " + sourceSet + " of " + binary); + + task.source(sourceSet.getSource()); + + final Project project = task.getProject(); + task.getObjectFileDir().set(new File(binary.getNamingScheme().getOutputDirectory(project.getBuildDir(), "objs"), sourceSet.getProjectScopedName())); + + // If this task uses a pre-compiled header + if (sourceSet instanceof DependentSourceSetInternal && ((DependentSourceSetInternal) sourceSet).getPreCompiledHeader() != null) { + final DependentSourceSetInternal dependentSourceSet = (DependentSourceSetInternal)sourceSet; + PreCompiledHeader pch = binary.getPrefixFileToPCH().get(dependentSourceSet.getPrefixHeaderFile()); + pch.setPrefixHeaderFile(dependentSourceSet.getPrefixHeaderFile()); + pch.setIncludeString(dependentSourceSet.getPreCompiledHeader()); + task.setPreCompiledHeader(pch); + } + + binary.binaryInputs(task.getOutputs().getFiles().getAsFileTree().matching(new PatternSet().include("**/*.obj", "**/*.o"))); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/DefaultHeaderDependenciesCollector.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/DefaultHeaderDependenciesCollector.java new file mode 100644 index 0000000..a39582c --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/DefaultHeaderDependenciesCollector.java @@ -0,0 +1,65 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.nativeplatform.internal.incremental; + +import com.google.common.collect.ImmutableSortedSet; +import org.gradle.api.NonNullApi; +import org.gradle.api.file.EmptyFileVisitor; +import org.gradle.api.file.FileVisitDetails; +import org.gradle.api.internal.file.collections.DirectoryFileTreeFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +@NonNullApi +public class DefaultHeaderDependenciesCollector implements HeaderDependenciesCollector { + private final Logger logger = LoggerFactory.getLogger(DefaultHeaderDependenciesCollector.class); + private final DirectoryFileTreeFactory directoryFileTreeFactory; + + public DefaultHeaderDependenciesCollector(DirectoryFileTreeFactory directoryFileTreeFactory) { + this.directoryFileTreeFactory = directoryFileTreeFactory; + } + + @Override + public ImmutableSortedSet collectExistingHeaderDependencies(String taskPath, List includeRoots, IncrementalCompilation incrementalCompilation) { + final Set headerDependencies = new HashSet(); + if (incrementalCompilation.isUnresolvedHeaders()) { + logger.info("After parsing the source files, Gradle cannot calculate the exact set of include files for '{}'. Every file in the include search path will be considered a header dependency.", taskPath); + addIncludeRoots(taskPath, includeRoots, headerDependencies); + } else { + logger.info("Found all include files for '{}'", taskPath); + headerDependencies.addAll(incrementalCompilation.getExistingHeaders()); + } + return ImmutableSortedSet.copyOf(headerDependencies); + } + + private void addIncludeRoots(String taskPath, List includeRoots, final Set headerDependencies) { + for (final File includeRoot : includeRoots) { + logger.info("adding files in {} to header dependencies for {}", includeRoot, taskPath); + directoryFileTreeFactory.create(includeRoot).visit(new EmptyFileVisitor() { + @Override + public void visitFile(FileVisitDetails fileDetails) { + headerDependencies.add(fileDetails.getFile()); + } + }); + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/sourceparser/AbstractMacro.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/sourceparser/AbstractMacro.java new file mode 100644 index 0000000..d8f1cd2 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/sourceparser/AbstractMacro.java @@ -0,0 +1,55 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.nativeplatform.internal.incremental.sourceparser; + +import org.gradle.language.nativeplatform.internal.Macro; + +public abstract class AbstractMacro extends AbstractExpression implements Macro { + private final String name; + + AbstractMacro(String name) { + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public String getAsSourceText() { + return "#define " + name + " " + super.getAsSourceText(); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj == null || obj.getClass() != getClass()) { + return false; + } + + AbstractMacro other = (AbstractMacro) obj; + return name.equals(other.name); + } + + @Override + public int hashCode() { + return name.hashCode(); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/sourceparser/ComplexExpression.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/sourceparser/ComplexExpression.java new file mode 100644 index 0000000..051156d --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/sourceparser/ComplexExpression.java @@ -0,0 +1,71 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.nativeplatform.internal.incremental.sourceparser; + +import com.google.common.base.Objects; +import org.gradle.language.nativeplatform.internal.Expression; +import org.gradle.language.nativeplatform.internal.IncludeType; + +import javax.annotation.Nullable; +import java.util.List; + +/** + * An expression with arguments. + */ +public class ComplexExpression extends AbstractExpression { + private final IncludeType type; + private final String value; + private final List arguments; + + public ComplexExpression(IncludeType type, @Nullable String value, List arguments) { + this.type = type; + this.value = value; + this.arguments = arguments; + } + + @Override + public String getValue() { + return value; + } + + @Override + public IncludeType getType() { + return type; + } + + @Override + public List getArguments() { + return arguments; + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj == null || obj.getClass() != getClass()) { + return false; + } + ComplexExpression other = (ComplexExpression) obj; + return Objects.equal(value, other.value) && arguments.equals(other.arguments); + } + + @Override + public int hashCode() { + return type.hashCode() ^ (value == null ? 0 : value.hashCode()) ^ arguments.hashCode(); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/swift/tasks/UnexportMainSymbol.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/swift/tasks/UnexportMainSymbol.java new file mode 100644 index 0000000..2dc79da --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/language/swift/tasks/UnexportMainSymbol.java @@ -0,0 +1,107 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.swift.tasks; + +import org.gradle.api.Action; +import org.gradle.api.DefaultTask; +import org.gradle.api.Incubating; +import org.gradle.api.file.ConfigurableFileCollection; +import org.gradle.api.file.DirectoryProperty; +import org.gradle.api.file.FileCollection; +import org.gradle.api.tasks.CacheableTask; +import org.gradle.api.tasks.InputFiles; +import org.gradle.api.tasks.Internal; +import org.gradle.api.tasks.OutputDirectory; +import org.gradle.api.tasks.PathSensitive; +import org.gradle.api.tasks.PathSensitivity; +import org.gradle.api.tasks.SkipWhenEmpty; +import org.gradle.api.tasks.TaskAction; +import org.gradle.internal.os.OperatingSystem; +import org.gradle.process.ExecSpec; + +import java.io.File; + +/** + * Unexports the main entry point symbol in an object file, so the object file can be linked with an executable. + * + * @since 4.4 + */ +@Incubating +@CacheableTask +public class UnexportMainSymbol extends DefaultTask { + private final ConfigurableFileCollection source = getProject().files(); + private final DirectoryProperty outputDirectory = getProject().getObjects().directoryProperty(); + + /** + * The object files to relocate. + * + * @since 4.5 + */ + @InputFiles + @PathSensitive(PathSensitivity.NAME_ONLY) + @SkipWhenEmpty + public ConfigurableFileCollection getObjects() { + return source; + } + + /** + * Collection of modified object files. + * + * @since 4.8 + */ + @Internal + public FileCollection getRelocatedObjects() { + return outputDirectory.getAsFileTree(); + } + + /** + * Location of modified object files. + * + * @since 4.5 + */ + @OutputDirectory + public DirectoryProperty getOutputDirectory() { + return outputDirectory; + } + + @TaskAction + public void unexport() { + for (final File file: source) { + final File relocatedObject = outputDirectory.file(file.getName()).get().getAsFile(); + getProject().exec(new Action() { + @Override + public void execute(ExecSpec execSpec) { + // TODO: should use target platform to make this decision + if (OperatingSystem.current().isMacOsX()) { + execSpec.executable("ld"); // TODO: Locate this tool from a tool provider + execSpec.args(file); + execSpec.args("-o", relocatedObject); + execSpec.args("-r"); // relink, produce another object file + execSpec.args("-unexported_symbol", "_main"); // hide _main symbol + } else if (OperatingSystem.current().isLinux()) { + execSpec.executable("objcopy"); // TODO: Locate this tool from a tool provider + execSpec.args("-L", "main"); // hide main symbol + execSpec.args(file); + execSpec.args(relocatedObject); + } else { + throw new IllegalStateException("Do not know how to unexport a main symbol on " + OperatingSystem.current()); + } + } + }); + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/swiftpm/internal/DefaultLibraryProduct.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/swiftpm/internal/DefaultLibraryProduct.java new file mode 100644 index 0000000..5814c73 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-native/org/gradle/swiftpm/internal/DefaultLibraryProduct.java @@ -0,0 +1,37 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.swiftpm.internal; + +import org.gradle.nativeplatform.Linkage; + +public class DefaultLibraryProduct extends AbstractProduct { + private final Linkage linkage; + + public DefaultLibraryProduct(String name, DefaultTarget target, Linkage linkage) { + super(name, target); + this.linkage = linkage; + } + + public Linkage getLinkage() { + return linkage; + } + + @Override + public boolean isExecutable() { + return false; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-scala/org/gradle/api/internal/tasks/scala/ZincScalaCompilerArgumentsGenerator.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-scala/org/gradle/api/internal/tasks/scala/ZincScalaCompilerArgumentsGenerator.java new file mode 100644 index 0000000..32ab679 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-scala/org/gradle/api/internal/tasks/scala/ZincScalaCompilerArgumentsGenerator.java @@ -0,0 +1,66 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.scala; + +import com.google.common.collect.Lists; +import org.gradle.language.scala.tasks.BaseScalaCompileOptions; + +import java.util.List; + +public class ZincScalaCompilerArgumentsGenerator { + public List generate(ScalaCompileSpec spec) { + List result = Lists.newArrayList(); + + BaseScalaCompileOptions options = spec.getScalaCompileOptions(); + addFlag("-deprecation", options.isDeprecation(), result); + addFlag("-unchecked", options.isUnchecked(), result); + addConcatenatedOption("-g:", options.getDebugLevel(), result); + addFlag("-optimise", options.isOptimize(), result); + addOption("-encoding", options.getEncoding(), result); + addFlag("-verbose", "verbose".equals(options.getDebugLevel()), result); + addFlag("-Ydebug", "debug".equals(options.getDebugLevel()), result); + if (options.getLoggingPhases() != null) { + for (String phase : options.getLoggingPhases()) { + addConcatenatedOption("-Ylog:", phase, result); + } + } + if (options.getAdditionalParameters() != null) { + result.addAll(options.getAdditionalParameters()); + } + + return result; + } + + private void addFlag(String name, boolean value, List result) { + if (value) { + result.add(name); + } + } + + private void addOption(String name, Object value, List result) { + if (value != null) { + result.add(name); + result.add(value.toString()); + } + } + + private void addConcatenatedOption(String name, Object value, List result) { + if (value != null) { + result.add(name + value.toString()); + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-scala/org/gradle/language/scala/tasks/AbstractScalaCompile.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-scala/org/gradle/language/scala/tasks/AbstractScalaCompile.java new file mode 100644 index 0000000..0a6ce20 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/language-scala/org/gradle/language/scala/tasks/AbstractScalaCompile.java @@ -0,0 +1,243 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.scala.tasks; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Maps; +import com.google.common.io.Files; +import org.gradle.api.Incubating; +import org.gradle.api.JavaVersion; +import org.gradle.api.UncheckedIOException; +import org.gradle.api.file.ConfigurableFileCollection; +import org.gradle.api.file.FileCollection; +import org.gradle.api.file.FileTree; +import org.gradle.api.file.RegularFileProperty; +import org.gradle.api.internal.tasks.compile.CompilerForkUtils; +import org.gradle.api.internal.tasks.scala.CleaningScalaCompiler; +import org.gradle.api.internal.tasks.scala.DefaultScalaJavaJointCompileSpec; +import org.gradle.api.internal.tasks.scala.DefaultScalaJavaJointCompileSpecFactory; +import org.gradle.api.internal.tasks.scala.ScalaCompileSpec; +import org.gradle.api.internal.tasks.scala.ScalaJavaJointCompileSpec; +import org.gradle.api.logging.Logger; +import org.gradle.api.logging.Logging; +import org.gradle.api.model.ObjectFactory; +import org.gradle.api.tasks.Input; +import org.gradle.api.tasks.Internal; +import org.gradle.api.tasks.LocalState; +import org.gradle.api.tasks.Nested; +import org.gradle.api.tasks.PathSensitive; +import org.gradle.api.tasks.PathSensitivity; +import org.gradle.api.tasks.TaskAction; +import org.gradle.api.tasks.compile.AbstractCompile; +import org.gradle.api.tasks.compile.CompileOptions; +import org.gradle.api.tasks.scala.IncrementalCompileOptions; +import org.gradle.language.base.internal.compile.Compiler; +import org.gradle.util.GFileUtils; +import org.gradle.util.SingleMessageLogger; + +import javax.annotation.Nullable; +import java.io.File; +import java.io.IOException; +import java.nio.charset.Charset; +import java.util.List; +import java.util.Map; + +/** + * An abstract Scala compile task sharing common functionality for compiling scala. + */ +public abstract class AbstractScalaCompile extends AbstractCompile { + protected static final Logger LOGGER = Logging.getLogger(AbstractScalaCompile.class); + private final BaseScalaCompileOptions scalaCompileOptions; + private final CompileOptions compileOptions; + private final RegularFileProperty analysisMappingFile; + private final ConfigurableFileCollection analysisFiles; + + protected AbstractScalaCompile(BaseScalaCompileOptions scalaCompileOptions) { + ObjectFactory objectFactory = getServices().get(ObjectFactory.class); + this.analysisMappingFile = objectFactory.fileProperty(); + this.analysisFiles = getProject().files(); + this.compileOptions = objectFactory.newInstance(CompileOptions.class); + this.scalaCompileOptions = scalaCompileOptions; + this.scalaCompileOptions.setIncrementalOptions(objectFactory.newInstance(IncrementalCompileOptions.class)); + + CompilerForkUtils.doNotCacheIfForkingViaExecutable(compileOptions, getOutputs()); + } + + /** + * Returns the Scala compilation options. + */ + @Nested + public BaseScalaCompileOptions getScalaCompileOptions() { + return scalaCompileOptions; + } + + /** + * Returns the Java compilation options. + */ + @Nested + public CompileOptions getOptions() { + return compileOptions; + } + + abstract protected org.gradle.language.base.internal.compile.Compiler getCompiler(ScalaJavaJointCompileSpec spec); + + @Override + @TaskAction + protected void compile() { + ScalaJavaJointCompileSpec spec = createSpec(); + configureIncrementalCompilation(spec); + Compiler compiler = getCompiler(spec); + if (isNonIncrementalCompilation()) { + compiler = new CleaningScalaCompiler(compiler, getOutputs()); + } + compiler.execute(spec); + } + + private boolean isNonIncrementalCompilation() { + File analysisFile = getScalaCompileOptions().getIncrementalOptions().getAnalysisFile().getAsFile().get(); + if (!analysisFile.exists()) { + LOGGER.info("Zinc is doing a full recompile since the analysis file doesn't exist"); + return true; + } + return false; + } + + protected ScalaJavaJointCompileSpec createSpec() { + DefaultScalaJavaJointCompileSpec spec = new DefaultScalaJavaJointCompileSpecFactory(compileOptions).create(); + spec.setSourceFiles(getSource().getFiles()); + spec.setDestinationDir(getDestinationDir()); + spec.setWorkingDir(getProject().getProjectDir()); + spec.setTempDir(getTemporaryDir()); + spec.setCompileClasspath(ImmutableList.copyOf(getClasspath())); + spec.setSourceCompatibility(getSourceCompatibility()); + spec.setTargetCompatibility(getTargetCompatibility()); + spec.setCompileOptions(getOptions()); + spec.setScalaCompileOptions(scalaCompileOptions); + spec.setAnnotationProcessorPath(compileOptions.getAnnotationProcessorPath() == null ? ImmutableList.of() : ImmutableList.copyOf(compileOptions.getAnnotationProcessorPath())); + return spec; + } + + private void configureIncrementalCompilation(ScalaCompileSpec spec) { + IncrementalCompileOptions incrementalOptions = scalaCompileOptions.getIncrementalOptions(); + + File analysisFile = incrementalOptions.getAnalysisFile().getAsFile().get(); + Map globalAnalysisMap = resolveAnalysisMappingsForOtherProjects(); + spec.setAnalysisMap(globalAnalysisMap); + spec.setAnalysisFile(analysisFile); + + // If this Scala compile is published into a jar, generate a analysis mapping file + if (incrementalOptions.getPublishedCode().isPresent()) { + File publishedCode = incrementalOptions.getPublishedCode().getAsFile().get(); + + if (LOGGER.isDebugEnabled()) { + LOGGER.debug("scala-incremental Analysis file: {}", analysisFile); + LOGGER.debug("scala-incremental Published code: {}", publishedCode); + } + File analysisMapping = getAnalysisMappingFile().getAsFile().get(); + GFileUtils.writeFile(publishedCode.getAbsolutePath() + "\n" + analysisFile.getAbsolutePath(), analysisMapping); + } + if (LOGGER.isDebugEnabled()) { + LOGGER.debug("scala-incremental Analysis map: {}", globalAnalysisMap); + } + } + + @SuppressWarnings("unchecked") + private Map resolveAnalysisMappingsForOtherProjects() { + Map analysisMap = Maps.newHashMap(); + for (File mapping : analysisFiles.getFiles()) { + if (mapping.exists()) { + try { + List lines = Files.readLines(mapping, Charset.defaultCharset()); + assert lines.size() == 2; + analysisMap.put(new File(lines.get(0)), new File(lines.get(1))); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + } + return analysisMap; + } + + /** + * Returns the path to use for annotation processor discovery. Returns an empty collection when no processing should be performed, for example when no annotation processors are present in the compile classpath or annotation processing has been disabled. + * + *

You can specify this path using {@link CompileOptions#setAnnotationProcessorPath(FileCollection)}. + * + *

This path is always empty when annotation processing is disabled.

+ * + * @since 4.1 + * @deprecated Use {@link CompileOptions#getAnnotationProcessorPath()} instead. + */ + @Deprecated + @Internal + @Nullable + public FileCollection getEffectiveAnnotationProcessorPath() { + SingleMessageLogger.nagUserOfReplacedProperty("AbstractScalaCompile.effectiveAnnotationProcessorPath", "AbstractScalaCompile.options.annotationProcessorPath"); + return compileOptions.getAnnotationProcessorPath(); + } + + /** + * {@inheritDoc} + */ + @Override + @PathSensitive(PathSensitivity.NAME_ONLY) + public FileTree getSource() { + return super.getSource(); + } + + /** + * The Java major version of the JVM the Scala compiler is running on. + * + * @since 4.6 + */ + @Incubating + @Input + // We track this as an input since the Scala compiler output may depend on it. + // TODO: This should be replaced by a property in the Scala toolchain as soon as we model these. + protected String getJvmVersion() { + return JavaVersion.current().getMajorVersion(); + } + + /** + * Source of analysis mapping files for incremental Scala compilation. + *

+ * An analysis mapping file is produced by each {@code AbstractScalaCompile} task. This file contains paths to the jar containing + * compiled Scala classes and the Scala compiler analysis file for that jar. The Scala compiler uses this information to perform + * incremental compilation of Scala sources. + *

+ * + * @return collection of analysis mapping files. + * + * @since 4.10.1 + */ + @Internal + public ConfigurableFileCollection getAnalysisFiles() { + return analysisFiles; + } + + /** + * Analysis mapping file. + * + * @see #getAnalysisFiles() + * + * @since 4.10.1 + */ + @LocalState + public RegularFileProperty getAnalysisMappingFile() { + return analysisMappingFile; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/launcher/org/gradle/launcher/bootstrap/ProcessCompleter.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/launcher/org/gradle/launcher/bootstrap/ProcessCompleter.java new file mode 100644 index 0000000..6b7196b --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/launcher/org/gradle/launcher/bootstrap/ProcessCompleter.java @@ -0,0 +1,26 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.launcher.bootstrap; + +public class ProcessCompleter implements ExecutionCompleter { + public void complete() { + System.exit(0); + } + + public void completeWithFailure(Throwable t) { + System.exit(1); + } +} \ No newline at end of file diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/launcher/org/gradle/launcher/daemon/server/api/DaemonStoppedException.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/launcher/org/gradle/launcher/daemon/server/api/DaemonStoppedException.java new file mode 100644 index 0000000..bf95d17 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/launcher/org/gradle/launcher/daemon/server/api/DaemonStoppedException.java @@ -0,0 +1,32 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.launcher.daemon.server.api; + +/** + * Thrown when the daemon is stopped while running a command. + */ +public class DaemonStoppedException extends RuntimeException { + public static final String MESSAGE = "Gradle build daemon has been stopped"; + + public DaemonStoppedException() { + super(MESSAGE); + } + + public DaemonStoppedException(String reason) { + super(MESSAGE + ": " + reason); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/launcher/org/gradle/launcher/daemon/server/api/DaemonUnavailableException.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/launcher/org/gradle/launcher/daemon/server/api/DaemonUnavailableException.java new file mode 100644 index 0000000..693aae7 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/launcher/org/gradle/launcher/daemon/server/api/DaemonUnavailableException.java @@ -0,0 +1,27 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.launcher.daemon.server.api; + +/** + * Thrown when the daemon is unavailable to run any commands. + */ +public class DaemonUnavailableException extends RuntimeException { + public DaemonUnavailableException(String message) { + super(message); + } +} + diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/launcher/org/gradle/launcher/daemon/server/health/HealthLogger.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/launcher/org/gradle/launcher/daemon/server/health/HealthLogger.java new file mode 100644 index 0000000..f862f4e --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/launcher/org/gradle/launcher/daemon/server/health/HealthLogger.java @@ -0,0 +1,33 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.launcher.daemon.server.health; + +import org.gradle.api.logging.Logger; + +public class HealthLogger { + + static final String HEALTH_MESSAGE_PROPERTY = "org.gradle.daemon.performance.logging"; + + public void logHealth(DaemonHealthStats stats, Logger logger) { + if (Boolean.getBoolean(HEALTH_MESSAGE_PROPERTY)) { + logger.lifecycle(stats.getHealthInfo()); + } else { + //the default + logger.info(stats.getHealthInfo()); + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/launcher/org/gradle/launcher/daemon/server/health/gc/DefaultSlidingWindow.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/launcher/org/gradle/launcher/daemon/server/health/gc/DefaultSlidingWindow.java new file mode 100644 index 0000000..68cc5a8 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/launcher/org/gradle/launcher/daemon/server/health/gc/DefaultSlidingWindow.java @@ -0,0 +1,54 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.launcher.daemon.server.health.gc; + +import com.google.common.collect.Sets; + +import java.util.Set; +import java.util.concurrent.LinkedBlockingDeque; +import java.util.concurrent.locks.ReentrantLock; + +public class DefaultSlidingWindow implements SlidingWindow { + final LinkedBlockingDeque deque; + final ReentrantLock lock = new ReentrantLock(); + + public DefaultSlidingWindow(int capacity) { + this.deque = new LinkedBlockingDeque(capacity); + } + + @Override + public void slideAndInsert(T element) { + lock.lock(); + try { + while (!deque.offerLast(element)) { + deque.remove(); + } + } finally { + lock.unlock(); + } + } + + @Override + public Set snapshot() { + lock.lock(); + try { + return Sets.newLinkedHashSet(deque); + } finally { + lock.unlock(); + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/launcher/org/gradle/tooling/internal/provider/events/DefaultTestSuccessResult.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/launcher/org/gradle/tooling/internal/provider/events/DefaultTestSuccessResult.java new file mode 100644 index 0000000..db657cb --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/launcher/org/gradle/tooling/internal/provider/events/DefaultTestSuccessResult.java @@ -0,0 +1,25 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.provider.events; + +import org.gradle.tooling.internal.protocol.events.InternalTestSuccessResult; + +public class DefaultTestSuccessResult extends AbstractTestResult implements InternalTestSuccessResult { + public DefaultTestSuccessResult(long startTime, long endTime) { + super(startTime, endTime, "succeeded"); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/logging/org/gradle/api/logging/LoggingManager.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/logging/org/gradle/api/logging/LoggingManager.java new file mode 100644 index 0000000..618b139 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/logging/org/gradle/api/logging/LoggingManager.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.logging; + +import org.gradle.internal.HasInternalProtocol; + +/** + *

A {@code LoggingManager} provides access to and control over the Gradle logging system. Using this interface, you + * can control standard output and error capture and receive logging events.

+ */ +@HasInternalProtocol +public interface LoggingManager extends LoggingOutput { + /** + * Requests that output written to System.out be routed to Gradle's logging system. The default is that System.out + * is routed to {@link LogLevel#QUIET} + * + * @param level The log level to route System.out to. + * @return this + */ + LoggingManager captureStandardOutput(LogLevel level); + + /** + * Requests that output written to System.err be routed to Gradle's logging system. The default is that System.err + * is routed to {@link LogLevel#ERROR}. + * + * @param level The log level to route System.err to. + * @return this + */ + LoggingManager captureStandardError(LogLevel level); + + /** + * Returns the log level that output written to System.out will be mapped to. + * + * @return The log level. Returns null when standard output capture is disabled. + */ + LogLevel getStandardOutputCaptureLevel(); + + /** + * Returns the log level that output written to System.err will be mapped to. + * + * @return The log level. Returns null when standard error capture is disabled. + */ + LogLevel getStandardErrorCaptureLevel(); + + /** + * Returns the current logging level. + * + * @return The current logging level. + */ + LogLevel getLevel(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/logging/org/gradle/internal/logging/events/RenderableOutputEvent.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/logging/org/gradle/internal/logging/events/RenderableOutputEvent.java new file mode 100644 index 0000000..0d7687c --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/logging/org/gradle/internal/logging/events/RenderableOutputEvent.java @@ -0,0 +1,51 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.logging.events; + +import org.gradle.api.logging.LogLevel; +import org.gradle.internal.logging.text.StyledTextOutput; +import org.gradle.internal.operations.OperationIdentifier; + +import javax.annotation.Nullable; + +public abstract class RenderableOutputEvent extends CategorisedOutputEvent { + private OperationIdentifier buildOperationId; + + protected RenderableOutputEvent(long timestamp, String category, LogLevel logLevel, @Nullable OperationIdentifier buildOperationId) { + super(timestamp, category, logLevel); + this.buildOperationId = buildOperationId; + } + + /** + * Renders this event to the given output. The output's style will be set to {@link + * StyledTextOutput.Style#Normal}. The style will be reset after the rendering is complete, so + * there is no need for this method to clean up the style. + * + * @param output The output to render to. + */ + public abstract void render(StyledTextOutput output); + + @Nullable + public OperationIdentifier getBuildOperationId() { + return buildOperationId; + } + + /** + * Creates a copy of this event with the given build operation id. + */ + public abstract RenderableOutputEvent withBuildOperationId(OperationIdentifier buildOperationId); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/logging/org/gradle/internal/logging/progress/ProgressListener.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/logging/org/gradle/internal/logging/progress/ProgressListener.java new file mode 100644 index 0000000..0cb32bf --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/logging/org/gradle/internal/logging/progress/ProgressListener.java @@ -0,0 +1,29 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.logging.progress; + +import org.gradle.internal.logging.events.ProgressCompleteEvent; +import org.gradle.internal.logging.events.ProgressEvent; +import org.gradle.internal.logging.events.ProgressStartEvent; + +public interface ProgressListener { + void started(ProgressStartEvent event); + + void progress(ProgressEvent event); + + void completed(ProgressCompleteEvent event); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/logging/org/gradle/internal/logging/sink/OutputEventRenderer.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/logging/org/gradle/internal/logging/sink/OutputEventRenderer.java new file mode 100644 index 0000000..7dea984 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/logging/org/gradle/internal/logging/sink/OutputEventRenderer.java @@ -0,0 +1,489 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.logging.sink; + +import net.jcip.annotations.ThreadSafe; +import org.gradle.api.logging.LogLevel; +import org.gradle.api.logging.StandardOutputListener; +import org.gradle.api.logging.configuration.ConsoleOutput; +import org.gradle.internal.Factory; +import org.gradle.internal.event.ListenerBroadcast; +import org.gradle.internal.logging.config.LoggingRouter; +import org.gradle.internal.logging.console.AnsiConsole; +import org.gradle.internal.logging.console.BuildLogLevelFilterRenderer; +import org.gradle.internal.logging.console.BuildStatusRenderer; +import org.gradle.internal.logging.console.ColorMap; +import org.gradle.internal.logging.console.Console; +import org.gradle.internal.logging.console.ConsoleLayoutCalculator; +import org.gradle.internal.logging.console.DefaultColorMap; +import org.gradle.internal.logging.console.DefaultWorkInProgressFormatter; +import org.gradle.internal.logging.console.StyledTextOutputBackedRenderer; +import org.gradle.internal.logging.console.ThrottlingOutputEventListener; +import org.gradle.internal.logging.console.UserInputConsoleRenderer; +import org.gradle.internal.logging.console.UserInputStandardOutputRenderer; +import org.gradle.internal.logging.console.WorkInProgressRenderer; +import org.gradle.internal.logging.events.EndOutputEvent; +import org.gradle.internal.logging.events.FlushOutputEvent; +import org.gradle.internal.logging.events.LogLevelChangeEvent; +import org.gradle.internal.logging.events.OutputEvent; +import org.gradle.internal.logging.events.OutputEventListener; +import org.gradle.internal.logging.events.ProgressCompleteEvent; +import org.gradle.internal.logging.events.ProgressEvent; +import org.gradle.internal.logging.events.ProgressStartEvent; +import org.gradle.internal.logging.events.RenderableOutputEvent; +import org.gradle.internal.logging.format.PrettyPrefixedLogHeaderFormatter; +import org.gradle.internal.logging.text.StreamBackedStandardOutputListener; +import org.gradle.internal.logging.text.StreamingStyledTextOutput; +import org.gradle.internal.nativeintegration.console.ConsoleMetaData; +import org.gradle.internal.nativeintegration.console.FallbackConsoleMetaData; +import org.gradle.internal.time.Clock; + +import javax.annotation.Nullable; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.util.concurrent.atomic.AtomicReference; + +/** + * A {@link OutputEventListener} implementation which renders output events to various + * destinations. This implementation is thread-safe. + */ +@ThreadSafe +public class OutputEventRenderer implements OutputEventListener, LoggingRouter { + private final Object lock = new Object(); + private final AtomicReference logLevel = new AtomicReference(LogLevel.LIFECYCLE); + private final Clock clock; + private final ListenerBroadcast formatters = new ListenerBroadcast(OutputEventListener.class); + private final OutputEventTransformer transformer = new OutputEventTransformer(formatters.getSource()); + + private ColorMap colourMap; + private OutputStream originalStdOut; + private OutputStream originalStdErr; + private OutputEventListener stdOutListener; + private OutputEventListener stdErrListener; + private OutputEventListener console; + private OutputEventListener userListenerChain; + private ListenerBroadcast userStdoutListeners; + private ListenerBroadcast userStderrListeners; + + public OutputEventRenderer(final Clock clock) { + this.clock = clock; + } + + @Override + public Snapshot snapshot() { + synchronized (lock) { + // Currently only snapshot the console output listener. Should snapshot all output listeners, and cleanup in restore() + return new SnapshotImpl(logLevel.get(), console); + } + } + + @Override + public void restore(Snapshot state) { + synchronized (lock) { + SnapshotImpl snapshot = (SnapshotImpl) state; + if (snapshot.logLevel != logLevel.get()) { + configure(snapshot.logLevel); + } + + // TODO - also close console when it is replaced + if (snapshot.console != console) { + if (snapshot.console == null) { + removeChain(console); + console = null; + } else { + throw new UnsupportedOperationException("Cannot restore previous console. This is not implemented yet."); + } + } + } + } + + private void addChain(OutputEventListener listener) { + listener.onOutput(new LogLevelChangeEvent(logLevel.get())); + formatters.add(listener); + } + + private void removeChain(OutputEventListener listener) { + formatters.remove(listener); + listener.onOutput(new EndOutputEvent()); + } + + public ColorMap getColourMap() { + synchronized (lock) { + if (colourMap == null) { + colourMap = new DefaultColorMap(); + } + } + return colourMap; + } + + @Override + public void flush() { + onOutput(new FlushOutputEvent()); + } + + public OutputStream getOriginalStdOut() { + return originalStdOut; + } + + public OutputStream getOriginalStdErr() { + return originalStdErr; + } + + public void attachProcessConsole(ConsoleOutput consoleOutput) { + synchronized (lock) { + ConsoleConfigureAction.execute(this, consoleOutput); + } + } + + @Override + public void attachConsole(OutputStream outputStream, OutputStream errorStream, ConsoleOutput consoleOutput) { + attachConsole(outputStream, errorStream, consoleOutput, null); + } + + @Override + public void attachConsole(OutputStream outputStream, OutputStream errorStream, ConsoleOutput consoleOutput, @Nullable ConsoleMetaData consoleMetadata) { + synchronized (lock) { + if (consoleMetadata == null) { + consoleMetadata = consoleOutput == ConsoleOutput.Plain ? FallbackConsoleMetaData.NOT_ATTACHED : FallbackConsoleMetaData.ATTACHED; + } + StandardOutputListener outputListener = new StreamBackedStandardOutputListener(outputStream); + StandardOutputListener errorListener = new StreamBackedStandardOutputListener(errorStream); + if (consoleOutput == ConsoleOutput.Plain) { + addPlainConsole(outputListener, errorListener, consoleMetadata.isStdOut() && consoleMetadata.isStdErr()); + } else { + Console console; + if (consoleMetadata.isStdOut()) { + OutputStreamWriter writer = new OutputStreamWriter(outputStream); + console = new AnsiConsole(writer, writer, getColourMap(), consoleMetadata, true); + } else if (consoleMetadata.isStdErr()) { + OutputStreamWriter writer = new OutputStreamWriter(errorStream); + console = new AnsiConsole(writer, writer, getColourMap(), consoleMetadata, true); + } else { + console = null; + } + addRichConsole(console, outputListener, errorListener, consoleMetadata, consoleOutput == ConsoleOutput.Verbose); + } + } + } + + public void attachSystemOutAndErr() { + addSystemOutAsLoggingDestination(); + addSystemErrAsLoggingDestination(); + } + + private void addSystemOutAsLoggingDestination() { + synchronized (lock) { + originalStdOut = System.out; + if (stdOutListener != null) { + removeChain(stdOutListener); + } + stdOutListener = new LazyListener(new Factory() { + @Override + public OutputEventListener create() { + return onNonError(new StyledTextOutputBackedRenderer(new StreamingStyledTextOutput(new StreamBackedStandardOutputListener((Appendable) originalStdOut)))); + } + }); + addChain(stdOutListener); + } + } + + private void addSystemErrAsLoggingDestination() { + synchronized (lock) { + originalStdErr = System.err; + if (stdErrListener != null) { + removeChain(stdErrListener); + } + stdErrListener = new LazyListener(new Factory() { + @Override + public OutputEventListener create() { + return onError(new StyledTextOutputBackedRenderer(new StreamingStyledTextOutput(new StreamBackedStandardOutputListener((Appendable) originalStdErr)))); + } + }); + addChain(stdErrListener); + } + } + + private void removeSystemOutAsLoggingDestination() { + synchronized (lock) { + if (stdOutListener != null) { + removeChain(stdOutListener); + stdOutListener = null; + } + } + } + + private void removeSystemErrAsLoggingDestination() { + synchronized (lock) { + if (stdErrListener != null) { + removeChain(stdErrListener); + stdErrListener = null; + } + } + } + + public void addOutputEventListener(OutputEventListener listener) { + synchronized (lock) { + addChain(listener); + } + } + + public void removeOutputEventListener(OutputEventListener listener) { + synchronized (lock) { + removeChain(listener); + } + } + + public OutputEventRenderer addRichConsole(Console console, ConsoleMetaData consoleMetaData) { + return addRichConsole(console, consoleMetaData, false); + } + + public OutputEventRenderer addRichConsole(Console console, ConsoleMetaData consoleMetaData, boolean verbose) { + return addRichConsole(console, new StreamBackedStandardOutputListener((Appendable) originalStdOut), new StreamBackedStandardOutputListener((Appendable) originalStdErr), consoleMetaData, verbose); + } + + private OutputEventRenderer addRichConsole(Console console, StandardOutputListener outputListener, StandardOutputListener errorListener, ConsoleMetaData consoleMetaData, boolean verbose) { + OutputEventListener consoleChain; + boolean stdoutAttachedToConsole = consoleMetaData.isStdOut(); + boolean stderrAttachedToConsole = consoleMetaData.isStdErr(); + if (stdoutAttachedToConsole && stderrAttachedToConsole) { + OutputEventListener consoleListener = new StyledTextOutputBackedRenderer(console.getBuildOutputArea()); + consoleChain = getRichConsoleChain(console, consoleMetaData, verbose, consoleListener); + } else if (stdoutAttachedToConsole) { + OutputEventListener stderrChain = new StyledTextOutputBackedRenderer(new StreamingStyledTextOutput(errorListener)); + OutputEventListener consoleListener = new ErrorOutputDispatchingListener(stderrChain, new StyledTextOutputBackedRenderer(console.getBuildOutputArea()), false); + consoleChain = getRichConsoleChain(console, consoleMetaData, verbose, consoleListener); + } else if (stderrAttachedToConsole) { + OutputEventListener stdoutChain = new StyledTextOutputBackedRenderer(new StreamingStyledTextOutput(outputListener)); + OutputEventListener consoleListener = new ErrorOutputDispatchingListener(new StyledTextOutputBackedRenderer(console.getBuildOutputArea()), stdoutChain, false); + consoleChain = getRichConsoleChain(console, consoleMetaData, verbose, consoleListener); + } else { + consoleChain = getPlainConsoleChain(outputListener, errorListener, false, verbose); + } + + return addConsoleChain(consoleChain); + } + + private OutputEventListener getRichConsoleChain(Console console, ConsoleMetaData consoleMetaData, boolean verbose, OutputEventListener consoleListener) { + return throttled( + new UserInputConsoleRenderer( + new BuildStatusRenderer( + new WorkInProgressRenderer( + new BuildLogLevelFilterRenderer( + new GroupingProgressLogEventGenerator(consoleListener, new PrettyPrefixedLogHeaderFormatter(), verbose) + ), + console.getBuildProgressArea(), + new DefaultWorkInProgressFormatter(consoleMetaData), + new ConsoleLayoutCalculator(consoleMetaData) + ), + console.getStatusBar(), console, consoleMetaData), + console) + ); + } + + public OutputEventRenderer addPlainConsole(boolean redirectStderr) { + return addConsoleChain(getPlainConsoleChain(redirectStderr)); + } + + private OutputEventRenderer addPlainConsole(StandardOutputListener outputListener, StandardOutputListener errorListener, boolean redirectStderr) { + return addConsoleChain(getPlainConsoleChain(outputListener, errorListener, redirectStderr, true)); + } + + private OutputEventListener getPlainConsoleChain(boolean redirectStderr) { + return getPlainConsoleChain(new StreamBackedStandardOutputListener((Appendable) originalStdOut), new StreamBackedStandardOutputListener((Appendable) originalStdErr), redirectStderr, true); + } + + private OutputEventListener getPlainConsoleChain(StandardOutputListener outputListener, StandardOutputListener errorListener, boolean redirectStderr, boolean verbose) { + final OutputEventListener stdoutChain = new UserInputStandardOutputRenderer(new StyledTextOutputBackedRenderer(new StreamingStyledTextOutput(outputListener))); + final OutputEventListener stderrChain = new StyledTextOutputBackedRenderer(new StreamingStyledTextOutput(errorListener)); + + return throttled( + new BuildLogLevelFilterRenderer( + new GroupingProgressLogEventGenerator( + new ErrorOutputDispatchingListener(stderrChain, stdoutChain, redirectStderr), + new PrettyPrefixedLogHeaderFormatter(), + verbose + ) + ) + ); + } + + private OutputEventListener throttled(OutputEventListener consoleChain) { + return new ThrottlingOutputEventListener(consoleChain, clock); + } + + private OutputEventRenderer addConsoleChain(OutputEventListener consoleChain) { + synchronized (lock) { + this.console = consoleChain; + removeSystemOutAsLoggingDestination(); + removeSystemErrAsLoggingDestination(); + addChain(this.console); + } + return this; + } + + private OutputEventListener onError(final OutputEventListener listener) { + return new LogEventDispatcher(null, listener); + } + + private OutputEventListener onNonError(final OutputEventListener listener) { + return new LogEventDispatcher(listener, null); + } + + @Override + public void enableUserStandardOutputListeners() { + // Create all of the pipeline eagerly as soon as this is enabled, to track the state of build operations. + // All of the pipelines do this, so should instead have a single stage that tracks this for all pipelines and that can replay the current state to new pipelines + // Then, a pipeline can be added for each listener as required + synchronized (lock) { + if (userStdoutListeners == null) { + userStdoutListeners = new ListenerBroadcast(StandardOutputListener.class); + userStderrListeners = new ListenerBroadcast(StandardOutputListener.class); + final OutputEventListener stdOutChain = new StyledTextOutputBackedRenderer(new StreamingStyledTextOutput(userStdoutListeners.getSource())); + final OutputEventListener stdErrChain = new StyledTextOutputBackedRenderer(new StreamingStyledTextOutput(userStderrListeners.getSource())); + userListenerChain = new BuildLogLevelFilterRenderer( + new ProgressLogEventGenerator(new OutputEventListener() { + @Override + public void onOutput(OutputEvent event) { + // Do not forward events for rendering when there are no listeners to receive + if (event instanceof LogLevelChangeEvent) { + stdOutChain.onOutput(event); + stdErrChain.onOutput(event); + } else if (event.getLogLevel() == LogLevel.ERROR && !userStderrListeners.isEmpty() && event instanceof RenderableOutputEvent) { + stdErrChain.onOutput(event); + } else if (event.getLogLevel() != LogLevel.ERROR && !userStdoutListeners.isEmpty() && event instanceof RenderableOutputEvent) { + stdOutChain.onOutput(event); + } + } + }) + ); + addChain(userListenerChain); + } + } + } + + private void assertUserListenersEnabled() { + if (userListenerChain == null) { + throw new IllegalStateException("Custom standard output listeners not enabled."); + } + userListenerChain.onOutput(new FlushOutputEvent()); + } + + public void addStandardErrorListener(StandardOutputListener listener) { + synchronized (lock) { + assertUserListenersEnabled(); + userStderrListeners.add(listener); + } + } + + public void addStandardOutputListener(StandardOutputListener listener) { + synchronized (lock) { + assertUserListenersEnabled(); + userStdoutListeners.add(listener); + } + } + + public void addStandardOutputListener(OutputStream outputStream) { + addStandardOutputListener(new StreamBackedStandardOutputListener(outputStream)); + } + + public void addStandardErrorListener(OutputStream outputStream) { + addStandardErrorListener(new StreamBackedStandardOutputListener(outputStream)); + } + + public void removeStandardOutputListener(StandardOutputListener listener) { + synchronized (lock) { + assertUserListenersEnabled(); + userStdoutListeners.remove(listener); + } + } + + public void removeStandardErrorListener(StandardOutputListener listener) { + synchronized (lock) { + assertUserListenersEnabled(); + userStderrListeners.remove(listener); + } + } + + public void configure(LogLevel logLevel) { + onOutput(new LogLevelChangeEvent(logLevel)); + } + + @Override + public void onOutput(OutputEvent event) { + if (event.getLogLevel() != null && event.getLogLevel().compareTo(logLevel.get()) < 0 && !isProgressEvent(event)) { + return; + } + if (event instanceof LogLevelChangeEvent) { + LogLevelChangeEvent changeEvent = (LogLevelChangeEvent) event; + LogLevel newLogLevel = changeEvent.getNewLogLevel(); + if (newLogLevel == this.logLevel.get()) { + return; + } + this.logLevel.set(newLogLevel); + } + synchronized (lock) { + transformer.onOutput(event); + } + } + + private boolean isProgressEvent(OutputEvent event) { + return event instanceof ProgressStartEvent || event instanceof ProgressEvent || event instanceof ProgressCompleteEvent; + } + + private static class SnapshotImpl implements Snapshot { + private final LogLevel logLevel; + private final OutputEventListener console; + + SnapshotImpl(LogLevel logLevel, OutputEventListener console) { + this.logLevel = logLevel; + this.console = console; + } + } + + private static class LazyListener implements OutputEventListener { + private Factory factory; + private OutputEventListener delegate; + private LogLevelChangeEvent pendingLogLevel; + + private LazyListener(Factory factory) { + this.factory = factory; + } + + @Override + public void onOutput(OutputEvent event) { + if (delegate == null) { + if (event instanceof EndOutputEvent || event instanceof FlushOutputEvent) { + // Ignore + return; + } + if (event instanceof LogLevelChangeEvent) { + // Keep until the listener is created + pendingLogLevel = (LogLevelChangeEvent) event; + return; + } + delegate = factory.create(); + factory = null; + if (pendingLogLevel != null) { + delegate.onOutput(pendingLogLevel); + pendingLogLevel = null; + } + } + delegate.onOutput(event); + } + } + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/logging/org/slf4j/impl/StaticLoggerBinder.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/logging/org/slf4j/impl/StaticLoggerBinder.java new file mode 100644 index 0000000..106ef6e --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/logging/org/slf4j/impl/StaticLoggerBinder.java @@ -0,0 +1,51 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.slf4j.impl; + +import org.gradle.internal.logging.slf4j.OutputEventListenerBackedLoggerContext; +import org.gradle.internal.time.Time; +import org.slf4j.ILoggerFactory; +import org.slf4j.spi.LoggerFactoryBinder; + +@SuppressWarnings("UnusedDeclaration") +public class StaticLoggerBinder implements LoggerFactoryBinder { + + private static final StaticLoggerBinder SINGLETON = new StaticLoggerBinder(); + private static final String LOGGER_FACTORY_CLASS_STR = OutputEventListenerBackedLoggerContext.class.getName(); + + private final OutputEventListenerBackedLoggerContext factory = new OutputEventListenerBackedLoggerContext(Time.clock()); + + public static StaticLoggerBinder getSingleton() { + return SINGLETON; + } + + /** + * Declare the version of the SLF4J API this implementation is compiled against. + * The value of this field is usually modified with each release. + */ + public static final String REQUESTED_API_VERSION = "1.7.7"; + + @Override + public ILoggerFactory getLoggerFactory() { + return factory; + } + + @Override + public String getLoggerFactoryClassStr() { + return LOGGER_FACTORY_CLASS_STR; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/maven/org/gradle/api/artifacts/maven/MavenDeployer.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/maven/org/gradle/api/artifacts/maven/MavenDeployer.java new file mode 100644 index 0000000..cbfcd22 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/maven/org/gradle/api/artifacts/maven/MavenDeployer.java @@ -0,0 +1,72 @@ +/* + * Copyright 2007-2008 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.artifacts.maven; + +import java.io.File; +import java.util.Collection; + +/** + *

A resolver that can only be used for uploading artifacts to a Maven repository. If you use this resolver for + * getting dependencies from a Maven repository, an exception is thrown. This resolver support all aspects of Maven + * deployment, including snapshot deployment and metadata.xml manipulation.

+ * + *

You have to specify at least one repository. Otherwise, if there is only one artifact, usually there is not more + * to do. If there is more than one artifact you have to decide what to do about this, as a Maven POM can only deal with + * one artifact. There are two strategies. If you want to deploy only one artifact you have to specify a filter to + * select this artifact. If you want to deploy more than one artifact, you have to specify filters which select each + * artifact. Associated with each filter is a separate configurable POM.

+ * + *

You can create an instance of this type via the {@link org.gradle.api.tasks.Upload#getRepositories()} + * container

+ */ +public interface MavenDeployer extends MavenResolver { + + /** + * Returns the repository to be used for uploading artifacts. + * + * @see #setRepository(Object) + */ + Object getRepository(); + + /** + * Sets the repository to be used for uploading artifacts. If {@link #getSnapshotRepository()} is not set, this repository + * is also used for uploading snapshot artifacts. + * + * @param repository The repository to be used + */ + void setRepository(Object repository); + + /** + * Returns the repository to be used for uploading snapshot artifacts. + * + * @see #setSnapshotRepository(Object) + */ + Object getSnapshotRepository(); + + /** + * Sets the repository to be used for uploading snapshot artifacts. If this is not set, the {@link #getRepository()} + * is used for uploading snapshot artifacts. + * + * @param snapshotRepository The repository to be used + */ + void setSnapshotRepository(Object snapshotRepository); + + /** + * Out of the box only uploading to the filesysten and via http is supported. If other protocolls should be used, + * the appropriate Maven wagon jars have to be passed via this method. + */ + void addProtocolProviderJars(Collection jars); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/maven/org/gradle/api/artifacts/maven/PomFilterContainer.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/maven/org/gradle/api/artifacts/maven/PomFilterContainer.java new file mode 100644 index 0000000..c775e6f --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/maven/org/gradle/api/artifacts/maven/PomFilterContainer.java @@ -0,0 +1,149 @@ +/* + * Copyright 2007-2008 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.artifacts.maven; + +import groovy.lang.Closure; +import org.gradle.api.Action; +import org.gradle.api.publication.maven.internal.PomFilter; + +/** + * Manages a set of {@link MavenPom} instances and their associated {@link PublishFilter} instances. + */ +public interface PomFilterContainer { + String DEFAULT_ARTIFACT_POM_NAME = "default"; + + /** + * Returns the default filter being used. . + * + * @see #setFilter(org.gradle.api.artifacts.maven.PublishFilter) + */ + PublishFilter getFilter(); + + /** + *

Sets the default filter to be used. This filter is active if no custom filters have been added (see {@link #addFilter(String, org.gradle.api.artifacts.maven.PublishFilter)}). + * If at least one custom filter has been added the default filter is not used any longer.

+ *

The default for this property is {@link PublishFilter#ALWAYS_ACCEPT}. + * If there is only one artifact you are fine with this filter. If there is more than one artifact, deployment will lead to + * an exception, if you don't specify a filter that selects the artifact to deploy. If you want to deploy more than one artifact you have + * to use the (see {@link #addFilter(String, org.gradle.api.artifacts.maven.PublishFilter)} method.

+ * + * @see #getFilter() + */ + void setFilter(PublishFilter defaultFilter); + + /** + * Returns the POM property of the custom filter. + * The POM property can be used to customize the POM generation. By default the properties of such a POM object are all null. + * Null means that Gradle will use default values for generating the Maven POM. Those default values are derived from the deployable artifact + * and from the project type (e.g. java, war, ...). If you explicitly set a POM property, Gradle will use those instead. + * + * @return The Maven Pom + */ + MavenPom getPom(); + + /** + *

Sets the default POM to be used. This POM is active if no custom filters have been added (see {@link #addFilter(String, org.gradle.api.artifacts.maven.PublishFilter)}). + * If at least one custom filter has been added the default POM is not used any longer.

+ *

Usually you don't need to set this property as the default value provides you a POM object you might use for configuration. + * By default the properties of such a POM object are all null. + * If they are null, Gradle will use default values for generating the Maven POM. Those default values are derived from the deployable artifact + * and from the project type (e.g. java, war, ...). If you explicitly set a POM property, Gradle will use this instead.

+ */ + void setPom(MavenPom defaultPom); + + /** + * If you want to deploy more than one artifact you need to define filters to select each of those artifacts. The method + * returns a POM object associated with this filter, that allows you to customize the POM generation for the artifact selected + * by the filter. + * + * @param name The name of the filter + * @param publishFilter The filter to use + * @return The POM associated with the filter + */ + MavenPom addFilter(String name, PublishFilter publishFilter); + + /** + * Adds a publish filter. + * + * @param name The name of the filter + * @param filter The filter + * @return The Maven POM associated with the closure + * @see PublishFilter + * @see PomFilterContainer#addFilter(String, org.gradle.api.artifacts.maven.PublishFilter) + */ + MavenPom addFilter(String name, Closure filter); + + /** + * Returns a filter added with {@link #addFilter(String, org.gradle.api.artifacts.maven.PublishFilter)}. + * + * @param name The name of the filter + */ + PublishFilter filter(String name); + + /** + * Sets the default publish filter. + * + * @param filter The filter to be set + * @see PublishFilter + * @see PomFilterContainer#setFilter(org.gradle.api.artifacts.maven.PublishFilter) + */ + void filter(Closure filter); + + /** + * Returns the POM associated with a filter added with {@link #addFilter(String, org.gradle.api.artifacts.maven.PublishFilter)}. + * + * @param name The name of the filter. + */ + MavenPom pom(String name); + + /** + * Configures a POM by a closure. The closure statements are delegated to the POM object associated with the given name. + * + * @return The POM object associated with the given name. + * @see PomFilterContainer#pom(String) + */ + MavenPom pom(String name, Closure configureClosure); + + /** + * Configures the default POM by a closure. The closure statements are delegated to the default POM. + * + * @return The default POM. + * @see PomFilterContainer#getPom() + */ + MavenPom pom(Closure configureClosure); + + /** + * Configures a POM by an action. The action is executed against the POM object associated with the given name. + * + * @return The POM object associated with the given name. + * @see PomFilterContainer#pom(String) + * + * @since 4.2 + */ + MavenPom pom(String name, Action configureAction); + + /** + * Configures the default POM by an action. + * + * @return The default POM. + * @see PomFilterContainer#getPom() + * + * @since 4.2 + */ + MavenPom pom(Action configureAction); + + Iterable getActivePomFilters(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/maven/org/gradle/api/publish/maven/MavenPomDeveloperSpec.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/maven/org/gradle/api/publish/maven/MavenPomDeveloperSpec.java new file mode 100644 index 0000000..86ce7e3 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/maven/org/gradle/api/publish/maven/MavenPomDeveloperSpec.java @@ -0,0 +1,37 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.publish.maven; + +import org.gradle.api.Action; +import org.gradle.api.Incubating; + +/** + * Allows to add developers to a Maven publication. + * + * @since 4.8 + * @see MavenPom + * @see MavenPomDeveloper + */ +@Incubating +public interface MavenPomDeveloperSpec { + + /** + * Creates, configures and adds a developer to the publication. + */ + void developer(Action action); + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/maven/org/gradle/api/publish/maven/plugins/MavenPublishPlugin.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/maven/org/gradle/api/publish/maven/plugins/MavenPublishPlugin.java new file mode 100644 index 0000000..abde0c7 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/maven/org/gradle/api/publish/maven/plugins/MavenPublishPlugin.java @@ -0,0 +1,267 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.publish.maven.plugins; + +import org.gradle.api.Action; +import org.gradle.api.NamedDomainObjectFactory; +import org.gradle.api.NamedDomainObjectList; +import org.gradle.api.NamedDomainObjectSet; +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.Task; +import org.gradle.api.artifacts.repositories.MavenArtifactRepository; +import org.gradle.api.file.DirectoryProperty; +import org.gradle.api.internal.CollectionCallbackActionDecorator; +import org.gradle.api.internal.FeaturePreviews; +import org.gradle.api.internal.artifacts.Module; +import org.gradle.api.internal.artifacts.configurations.DependencyMetaDataProvider; +import org.gradle.api.internal.artifacts.ivyservice.projectmodule.ProjectDependencyPublicationResolver; +import org.gradle.api.internal.attributes.ImmutableAttributesFactory; +import org.gradle.api.internal.file.FileCollectionFactory; +import org.gradle.api.internal.file.FileResolver; +import org.gradle.api.model.ObjectFactory; +import org.gradle.api.provider.ProviderFactory; +import org.gradle.api.publish.PublishingExtension; +import org.gradle.api.publish.maven.MavenArtifact; +import org.gradle.api.publish.maven.MavenPublication; +import org.gradle.api.publish.maven.internal.artifact.MavenArtifactNotationParserFactory; +import org.gradle.api.publish.maven.internal.publication.DefaultMavenPublication; +import org.gradle.api.publish.maven.internal.publication.MavenPublicationInternal; +import org.gradle.api.publish.maven.internal.publication.WritableMavenProjectIdentity; +import org.gradle.api.publish.maven.internal.publisher.MutableMavenProjectIdentity; +import org.gradle.api.publish.maven.tasks.GenerateMavenPom; +import org.gradle.api.publish.maven.tasks.PublishToMavenLocal; +import org.gradle.api.publish.maven.tasks.PublishToMavenRepository; +import org.gradle.api.publish.plugins.PublishingPlugin; +import org.gradle.api.publish.tasks.GenerateModuleMetadata; +import org.gradle.api.tasks.TaskContainer; +import org.gradle.api.tasks.TaskProvider; +import org.gradle.internal.reflect.Instantiator; +import org.gradle.internal.typeconversion.NotationParser; + +import javax.inject.Inject; +import java.util.Set; +import java.util.concurrent.Callable; + +import static org.apache.commons.lang.StringUtils.capitalize; + +/** + * Adds the ability to publish in the Maven format to Maven repositories. + * + * @since 1.4 + */ +public class MavenPublishPlugin implements Plugin { + + public static final String PUBLISH_LOCAL_LIFECYCLE_TASK_NAME = "publishToMavenLocal"; + + private final Instantiator instantiator; + private final ObjectFactory objectFactory; + private final DependencyMetaDataProvider dependencyMetaDataProvider; + private final FileResolver fileResolver; + private final ProjectDependencyPublicationResolver projectDependencyResolver; + private final FileCollectionFactory fileCollectionFactory; + private final FeaturePreviews featurePreviews; + private final ImmutableAttributesFactory immutableAttributesFactory; + private final ProviderFactory providerFactory; + private CollectionCallbackActionDecorator collectionCallbackActionDecorator; + + @Inject + public MavenPublishPlugin(Instantiator instantiator, ObjectFactory objectFactory, DependencyMetaDataProvider dependencyMetaDataProvider, + FileResolver fileResolver, ProjectDependencyPublicationResolver projectDependencyResolver, FileCollectionFactory fileCollectionFactory, + FeaturePreviews featurePreviews, ImmutableAttributesFactory immutableAttributesFactory, ProviderFactory providerFactory, + CollectionCallbackActionDecorator collectionCallbackActionDecorator) { + this.instantiator = instantiator; + this.objectFactory = objectFactory; + this.dependencyMetaDataProvider = dependencyMetaDataProvider; + this.fileResolver = fileResolver; + this.projectDependencyResolver = projectDependencyResolver; + this.fileCollectionFactory = fileCollectionFactory; + this.featurePreviews = featurePreviews; + this.immutableAttributesFactory = immutableAttributesFactory; + this.providerFactory = providerFactory; + this.collectionCallbackActionDecorator = collectionCallbackActionDecorator; + } + + public void apply(final Project project) { + project.getPluginManager().apply(PublishingPlugin.class); + + final TaskContainer tasks = project.getTasks(); + tasks.register(PUBLISH_LOCAL_LIFECYCLE_TASK_NAME, new Action() { + @Override + public void execute(Task publish) { + publish.setDescription("Publishes all Maven publications produced by this project to the local Maven cache."); + publish.setGroup(PublishingPlugin.PUBLISH_TASK_GROUP); + } + }); + + project.getExtensions().configure(PublishingExtension.class, new Action() { + @Override + public void execute(PublishingExtension extension) { + extension.getPublications().registerFactory(MavenPublication.class, new MavenPublicationFactory(dependencyMetaDataProvider, instantiator, fileResolver, collectionCallbackActionDecorator)); + realizePublishingTasksLater(project, extension); + } + }); + } + + private void realizePublishingTasksLater(final Project project, final PublishingExtension extension) { + final NamedDomainObjectSet mavenPublications = extension.getPublications().withType(MavenPublicationInternal.class); + final TaskContainer tasks = project.getTasks(); + final DirectoryProperty buildDirectory = project.getLayout().getBuildDirectory(); + + final TaskProvider publishLifecycleTask = tasks.named(PublishingPlugin.PUBLISH_LIFECYCLE_TASK_NAME); + final TaskProvider publishLocalLifecycleTask = tasks.named(PUBLISH_LOCAL_LIFECYCLE_TASK_NAME); + + mavenPublications.all(new Action() { + @Override + public void execute(MavenPublicationInternal publication) { + createGenerateMetadataTask(tasks, publication, mavenPublications, buildDirectory); + createGeneratePomTask(tasks, publication, buildDirectory); + createLocalInstallTask(tasks, publishLocalLifecycleTask, publication); + createPublishTasksForEachMavenRepo(tasks, extension, publishLifecycleTask, publication); + } + }); + } + + private void createPublishTasksForEachMavenRepo(final TaskContainer tasks, PublishingExtension extension, final TaskProvider publishLifecycleTask, final MavenPublicationInternal publication) { + final String publicationName = publication.getName(); + NamedDomainObjectList repositories = extension.getRepositories().withType(MavenArtifactRepository.class); + repositories.all(new Action() { + @Override + public void execute(final MavenArtifactRepository repository) { + final String repositoryName = repository.getName(); + + final String publishTaskName = "publish" + capitalize(publicationName) + "PublicationTo" + capitalize(repositoryName) + "Repository"; + + tasks.register(publishTaskName, PublishToMavenRepository.class, new Action() { + public void execute(PublishToMavenRepository publishTask) { + publishTask.setPublication(publication); + publishTask.setRepository(repository); + publishTask.setGroup(PublishingPlugin.PUBLISH_TASK_GROUP); + publishTask.setDescription("Publishes Maven publication '" + publicationName + "' to Maven repository '" + repositoryName + "'."); + + } + }); + publishLifecycleTask.configure(new Action() { + @Override + public void execute(Task task) { + task.dependsOn(publishTaskName); + } + }); + } + }); + } + + private void createLocalInstallTask(TaskContainer tasks, final TaskProvider publishLocalLifecycleTask, final MavenPublicationInternal publication) { + final String publicationName = publication.getName(); + final String installTaskName = "publish" + capitalize(publicationName) + "PublicationToMavenLocal"; + + tasks.register(installTaskName, PublishToMavenLocal.class, new Action() { + public void execute(PublishToMavenLocal publishLocalTask) { + publishLocalTask.setPublication(publication); + publishLocalTask.setGroup(PublishingPlugin.PUBLISH_TASK_GROUP); + publishLocalTask.setDescription("Publishes Maven publication '" + publicationName + "' to the local Maven repository."); + } + }); + publishLocalLifecycleTask.configure(new Action() { + @Override + public void execute(Task task) { + task.dependsOn(installTaskName); + } + }); + } + + private void createGeneratePomTask(TaskContainer tasks, final MavenPublicationInternal publication, final DirectoryProperty buildDir) { + final String publicationName = publication.getName(); + String descriptorTaskName = "generatePomFileFor" + capitalize(publicationName) + "Publication"; + TaskProvider generatorTask = tasks.register(descriptorTaskName, GenerateMavenPom.class, new Action() { + public void execute(final GenerateMavenPom generatePomTask) { + generatePomTask.setDescription("Generates the Maven POM file for publication '" + publicationName + "'."); + generatePomTask.setGroup(PublishingPlugin.PUBLISH_TASK_GROUP); + generatePomTask.setPom(publication.getPom()); + if (generatePomTask.getDestination() == null) { + generatePomTask.setDestination(buildDir.file("publications/" + publication.getName() + "/pom-default.xml")); + } + } + }); + // TODO: Make lazy + publication.setPomGenerator(generatorTask.get()); + } + + private void createGenerateMetadataTask(final TaskContainer tasks, final MavenPublicationInternal publication, final Set publications, final DirectoryProperty buildDir) { + final String publicationName = publication.getName(); + String descriptorTaskName = "generateMetadataFileFor" + capitalize(publicationName) + "Publication"; + TaskProvider generatorTask = tasks.register(descriptorTaskName, GenerateModuleMetadata.class, new Action() { + public void execute(final GenerateModuleMetadata generateTask) { + generateTask.setDescription("Generates the Gradle metadata file for publication '" + publicationName + "'."); + generateTask.setGroup(PublishingPlugin.PUBLISH_TASK_GROUP); + generateTask.getPublication().set(publication); + generateTask.getPublications().set(publications); + generateTask.getOutputFile().convention(buildDir.file("publications/" + publication.getName() + "/module.json")); + } + }); + // TODO: Make lazy + publication.setModuleDescriptorGenerator(generatorTask.get()); + } + + private class MavenPublicationFactory implements NamedDomainObjectFactory { + private final Instantiator instantiator; + private final DependencyMetaDataProvider dependencyMetaDataProvider; + private final FileResolver fileResolver; + private CollectionCallbackActionDecorator collectionCallbackActionDecorator; + + private MavenPublicationFactory(DependencyMetaDataProvider dependencyMetaDataProvider, Instantiator instantiator, FileResolver fileResolver, CollectionCallbackActionDecorator collectionCallbackActionDecorator) { + this.dependencyMetaDataProvider = dependencyMetaDataProvider; + this.instantiator = instantiator; + this.fileResolver = fileResolver; + this.collectionCallbackActionDecorator = collectionCallbackActionDecorator; + } + + public MavenPublication create(final String name) { + MutableMavenProjectIdentity projectIdentity = createProjectIdentity(); + NotationParser artifactNotationParser = new MavenArtifactNotationParserFactory(instantiator, fileResolver).create(); + return instantiator.newInstance( + DefaultMavenPublication.class, + name, projectIdentity, artifactNotationParser, instantiator, objectFactory, projectDependencyResolver, fileCollectionFactory, featurePreviews, immutableAttributesFactory, + collectionCallbackActionDecorator + ); + } + + private MutableMavenProjectIdentity createProjectIdentity() { + final Module module = dependencyMetaDataProvider.getModule(); + MutableMavenProjectIdentity projectIdentity = new WritableMavenProjectIdentity(objectFactory); + projectIdentity.getGroupId().set(providerFactory.provider(new Callable() { + @Override + public String call() { + return module.getGroup(); + } + })); + projectIdentity.getArtifactId().set(providerFactory.provider(new Callable() { + @Override + public String call() { + return module.getName(); + } + })); + projectIdentity.getVersion().set(providerFactory.provider(new Callable() { + @Override + public String call() { + return module.getVersion(); + } + })); + return projectIdentity; + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/messaging/org/gradle/internal/event/ListenerBroadcast.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/messaging/org/gradle/internal/event/ListenerBroadcast.java new file mode 100644 index 0000000..8984daf --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/messaging/org/gradle/internal/event/ListenerBroadcast.java @@ -0,0 +1,151 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.event; + +import org.gradle.api.Action; +import org.gradle.internal.dispatch.Dispatch; +import org.gradle.internal.dispatch.MethodInvocation; +import org.gradle.internal.dispatch.ProxyDispatchAdapter; + +import java.util.Collection; + +/** + *

Manages a set of listeners of type T. Provides an implementation of T which can be used to broadcast to all + * registered listeners.

+ * + *

Ordering is maintained for events, so that events are delivered to listeners in the order they are generated. + * Events are delivered to listeners in the order that listeners are added to this broadcaster.

+ * + *

Implementations are not thread-safe.

+ * + * @param The listener type. + */ +public class ListenerBroadcast implements Dispatch { + private ProxyDispatchAdapter source; + private BroadcastDispatch broadcast; + private final Class type; + + public ListenerBroadcast(Class type) { + this.type = type; + broadcast = BroadcastDispatch.empty(type); + } + + /** + * Returns the broadcaster. Any method call on this object is broadcast to all listeners. + * + * @return The broadcaster. + */ + public T getSource() { + if (source == null) { + source = new ProxyDispatchAdapter(this, type); + } + return source.getSource(); + } + + /** + * Returns the type of listener to which this class broadcasts. + * + * @return The type of the broadcaster. + */ + public Class getType() { + return type; + } + + /** + * Returns {@code true} if no listeners are registered with this object. + * + * @return {@code true} if no listeners are registered with this object, {@code false} otherwise + */ + public boolean isEmpty() { + return broadcast.isEmpty(); + } + + /** + * Adds a listener. + * + * @param listener The listener. + */ + public void add(T listener) { + broadcast = broadcast.add(listener); + } + + /** + * Adds the given listeners. + * + * @param listeners The listeners + */ + public void addAll(Collection listeners) { + broadcast = broadcast.addAll(listeners); + } + + /** + * Adds a {@link Dispatch} to receive events from this broadcast. + */ + public void add(Dispatch dispatch) { + broadcast = broadcast.add(dispatch); + } + + /** + * Adds an action to be executed when the given method is called. + */ + public void add(String methodName, Action action) { + broadcast = broadcast.add(methodName, action); + } + + /** + * Removes the given listener. + * + * @param listener The listener. + */ + public void remove(Object listener) { + broadcast = broadcast.remove(listener); + } + + /** + * Removes the given listeners. + * + * @param listeners The listeners + */ + public void removeAll(Collection listeners) { + broadcast = broadcast.removeAll(listeners); + } + + /** + * Removes all listeners. + */ + public void removeAll() { + broadcast = BroadcastDispatch.empty(type); + } + + /** + * Broadcasts the given event to all listeners. + * + * @param event The event + */ + public void dispatch(MethodInvocation event) { + broadcast.dispatch(event); + } + + /** + * Returns a new {@link ListenerBroadcast} with the same {@link BroadcastDispatch} as this class. + */ + public ListenerBroadcast copy() { + ListenerBroadcast result = new ListenerBroadcast(type); + result.broadcast = this.broadcast; + return result; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/messaging/org/gradle/internal/remote/internal/inet/TcpIncomingConnector.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/messaging/org/gradle/internal/remote/internal/inet/TcpIncomingConnector.java new file mode 100644 index 0000000..5b3eac7 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/messaging/org/gradle/internal/remote/internal/inet/TcpIncomingConnector.java @@ -0,0 +1,130 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.remote.internal.inet; + +import org.gradle.api.Action; +import org.gradle.internal.UncheckedException; +import org.gradle.internal.concurrent.CompositeStoppable; +import org.gradle.internal.concurrent.ExecutorFactory; +import org.gradle.internal.concurrent.ManagedExecutor; +import org.gradle.internal.id.IdGenerator; +import org.gradle.internal.remote.Address; +import org.gradle.internal.remote.ConnectionAcceptor; +import org.gradle.internal.remote.internal.ConnectCompletion; +import org.gradle.internal.remote.internal.IncomingConnector; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.ServerSocketChannel; +import java.nio.channels.SocketChannel; +import java.util.List; +import java.util.UUID; + +public class TcpIncomingConnector implements IncomingConnector { + private static final Logger LOGGER = LoggerFactory.getLogger(TcpIncomingConnector.class); + private final ExecutorFactory executorFactory; + private final InetAddressFactory addressFactory; + private final IdGenerator idGenerator; + + public TcpIncomingConnector(ExecutorFactory executorFactory, InetAddressFactory addressFactory, IdGenerator idGenerator) { + this.executorFactory = executorFactory; + this.addressFactory = addressFactory; + this.idGenerator = idGenerator; + } + + public ConnectionAcceptor accept(Action action, boolean allowRemote) { + final ServerSocketChannel serverSocket; + int localPort; + try { + serverSocket = ServerSocketChannel.open(); + serverSocket.socket().bind(new InetSocketAddress(addressFactory.getLocalBindingAddress(), 0)); + localPort = serverSocket.socket().getLocalPort(); + } catch (Exception e) { + throw UncheckedException.throwAsUncheckedException(e); + } + + UUID id = idGenerator.generateId(); + List addresses = addressFactory.getCommunicationAddresses(); + final Address address = new MultiChoiceAddress(id, localPort, addresses); + LOGGER.debug("Listening on {}.", address); + + final ManagedExecutor executor = executorFactory.create("Incoming " + (allowRemote ? "remote" : "local")+ " TCP Connector on port " + localPort); + executor.execute(new Receiver(serverSocket, action, allowRemote)); + + return new ConnectionAcceptor() { + public Address getAddress() { + return address; + } + + public void requestStop() { + CompositeStoppable.stoppable(serverSocket).stop(); + } + + public void stop() { + requestStop(); + executor.stop(); + } + }; + } + + private class Receiver implements Runnable { + private final ServerSocketChannel serverSocket; + private final Action action; + private final boolean allowRemote; + + public Receiver(ServerSocketChannel serverSocket, Action action, boolean allowRemote) { + this.serverSocket = serverSocket; + this.action = action; + this.allowRemote = allowRemote; + } + + public void run() { + try { + try { + while (true) { + final SocketChannel socket = serverSocket.accept(); + InetSocketAddress remoteSocketAddress = (InetSocketAddress) socket.socket().getRemoteSocketAddress(); + InetAddress remoteInetAddress = remoteSocketAddress.getAddress(); + if (!allowRemote && !addressFactory.isCommunicationAddress(remoteInetAddress)) { + LOGGER.error("Cannot accept connection from remote address {}.", remoteInetAddress); + socket.close(); + continue; + } + LOGGER.debug("Accepted connection from {} to {}.", socket.socket().getRemoteSocketAddress(), socket.socket().getLocalSocketAddress()); + try { + action.execute(new SocketConnectCompletion(socket)); + } catch (Throwable t) { + socket.close(); + throw t; + } + } + } catch (ClosedChannelException e) { + // Ignore + } catch (Throwable e) { + LOGGER.error("Could not accept remote connection.", e); + } + } finally { + CompositeStoppable.stoppable(serverSocket).stop(); + } + } + + } + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-core/org/gradle/api/internal/provider/DefaultProviderFactory.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-core/org/gradle/api/internal/provider/DefaultProviderFactory.java new file mode 100644 index 0000000..466e893 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-core/org/gradle/api/internal/provider/DefaultProviderFactory.java @@ -0,0 +1,32 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.provider; + +import org.gradle.api.provider.Provider; +import org.gradle.api.provider.ProviderFactory; + +import java.util.concurrent.Callable; + +public class DefaultProviderFactory implements ProviderFactory { + + public Provider provider(final Callable value) { + if (value == null) { + throw new IllegalArgumentException("Value cannot be null"); + } + return new DefaultProvider(value); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-core/org/gradle/model/Validate.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-core/org/gradle/model/Validate.java new file mode 100644 index 0000000..2a31bfe --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-core/org/gradle/model/Validate.java @@ -0,0 +1,38 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.model; + +import org.gradle.api.Incubating; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Denotes that the {@link RuleSource} method rule carrying this annotation validates the rule subject. + *

+ * Validate rules execute after {@link Finalize} rules, but before rule subject is used as an input. + * The first parameter of the rule is the rule subject, which is immutable. + *

+ * Please see {@link RuleSource} for more information on method rules. + */ +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.METHOD) +@Incubating +public @interface Validate { +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-core/org/gradle/model/internal/core/ModelAction.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-core/org/gradle/model/internal/core/ModelAction.java new file mode 100644 index 0000000..c4be05a --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-core/org/gradle/model/internal/core/ModelAction.java @@ -0,0 +1,33 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.model.internal.core; + +import org.gradle.model.internal.core.rule.describe.ModelRuleDescriptor; + +import java.util.List; + +public interface ModelAction { + + ModelReference getSubject(); + + void execute(MutableModelNode modelNode, List> inputs); + + List> getInputs(); + + ModelRuleDescriptor getDescriptor(); + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-core/org/gradle/model/internal/core/rule/describe/SimpleModelRuleDescriptor.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-core/org/gradle/model/internal/core/rule/describe/SimpleModelRuleDescriptor.java new file mode 100644 index 0000000..bba5d03 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-core/org/gradle/model/internal/core/rule/describe/SimpleModelRuleDescriptor.java @@ -0,0 +1,87 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.model.internal.core.rule.describe; + +import com.google.common.base.Objects; +import net.jcip.annotations.ThreadSafe; +import org.gradle.api.UncheckedIOException; +import org.gradle.internal.Factories; +import org.gradle.internal.Factory; + +import java.io.IOException; + +@ThreadSafe +public class SimpleModelRuleDescriptor extends AbstractModelRuleDescriptor { + + private final Factory factory; + + public SimpleModelRuleDescriptor(final Factory descriptor) { + this.factory = new Factory() { + String cachedValue; + @Override + public String create() { + if (cachedValue == null) { + cachedValue = STRING_INTERNER.intern(descriptor.create()); + } + return cachedValue; + } + }; + } + + public SimpleModelRuleDescriptor(String descriptor) { + this(Factories.constant(STRING_INTERNER.intern(descriptor))); + } + + public SimpleModelRuleDescriptor(final String descriptor, final Object... args) { + this(new Factory() { + @Override + public String create() { + return String.format(descriptor, args); + } + }); + } + + private String getDescriptor() { + return factory.create(); + } + + @Override + public void describeTo(Appendable appendable) { + try { + appendable.append(getDescriptor()); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + SimpleModelRuleDescriptor that = (SimpleModelRuleDescriptor) o; + return Objects.equal(getDescriptor(), that.getDescriptor()); + } + + @Override + public int hashCode() { + return Objects.hashCode(getDescriptor()); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-core/org/gradle/model/internal/inspect/MethodModelRuleApplicationContext.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-core/org/gradle/model/internal/inspect/MethodModelRuleApplicationContext.java new file mode 100644 index 0000000..c1956cc --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-core/org/gradle/model/internal/inspect/MethodModelRuleApplicationContext.java @@ -0,0 +1,38 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.model.internal.inspect; + +import org.gradle.model.internal.core.ModelAction; +import org.gradle.model.internal.core.ModelPath; +import org.gradle.model.internal.registry.ModelRegistry; + +public interface MethodModelRuleApplicationContext { + ModelRegistry getRegistry(); + + /** + * Contextualizes the given action. + * + * - Resolved subject and input paths relative to the target element. + * - Resolves subject type references relative to the target element. + * - Adds implicit inputs. + * + * The returned action invokes the provided action with a {@link ModelRuleInvoker} contextualized with implicit inputs. + */ + ModelAction contextualize(MethodRuleAction action); + + ModelPath getScope(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-core/org/gradle/model/internal/manage/schema/SpecializedMapSchema.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-core/org/gradle/model/internal/manage/schema/SpecializedMapSchema.java new file mode 100644 index 0000000..4ec8397 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-core/org/gradle/model/internal/manage/schema/SpecializedMapSchema.java @@ -0,0 +1,39 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.model.internal.manage.schema; + +import org.gradle.model.internal.type.ModelType; + +import java.lang.ref.WeakReference; + +public class SpecializedMapSchema extends ModelMapSchema { + private final WeakReference> implementationType; + + public SpecializedMapSchema(ModelType type, ModelType elementType, Class implementationType) { + super(type, elementType); + this.implementationType = new WeakReference>(implementationType); + } + + public Class getImplementationType() { + return implementationType.get(); + } + + @Override + public String toString() { + return "model map " + getType(); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-core/org/gradle/model/internal/manage/schema/extract/ModelMapNodeInitializerExtractionStrategy.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-core/org/gradle/model/internal/manage/schema/extract/ModelMapNodeInitializerExtractionStrategy.java new file mode 100644 index 0000000..02fff6a --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-core/org/gradle/model/internal/manage/schema/extract/ModelMapNodeInitializerExtractionStrategy.java @@ -0,0 +1,72 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.model.internal.manage.schema.extract; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSetMultimap; +import com.google.common.collect.Multimap; +import org.gradle.internal.BiAction; +import org.gradle.model.ModelMap; +import org.gradle.model.internal.core.*; +import org.gradle.model.internal.core.rule.describe.ModelRuleDescriptor; +import org.gradle.model.internal.manage.schema.CollectionSchema; +import org.gradle.model.internal.type.ModelType; + +public class ModelMapNodeInitializerExtractionStrategy extends CollectionNodeInitializerExtractionSupport { + private static final ModelType> MODEL_MAP_MODEL_TYPE = new ModelType>() { + }; + + @Override + protected NodeInitializer extractNodeInitializer(CollectionSchema schema, NodeInitializerContext context) { + if (MODEL_MAP_MODEL_TYPE.isAssignableFrom(schema.getType())) { + return new ModelMapNodeInitializer(schema); + } + return null; + } + + @Override + public Iterable> supportedTypes() { + return ImmutableList.>of(MODEL_MAP_MODEL_TYPE); + } + + private static class ModelMapNodeInitializer implements NodeInitializer { + private final CollectionSchema schema; + + public ModelMapNodeInitializer(CollectionSchema schema) { + this.schema = schema; + } + + @Override + public Multimap getActions(ModelReference subject, ModelRuleDescriptor descriptor) { + return ImmutableSetMultimap.builder() + .put(ModelActionRole.Discover, AddProjectionsAction.of(subject, descriptor, + ModelMapModelProjection.managed(schema.getType(), schema.getElementType(), ChildNodeInitializerStrategyAccessors.fromPrivateData()) + )) + .put(ModelActionRole.Create, DirectNodeInputUsingModelAction.of(subject, descriptor, + ModelReference.of(NodeInitializerRegistry.class), + new BiAction() { + @Override + public void execute(MutableModelNode modelNode, NodeInitializerRegistry nodeInitializerRegistry) { + ChildNodeInitializerStrategy childStrategy = NodeBackedModelMap.createUsingRegistry(nodeInitializerRegistry); + modelNode.setPrivateData(ChildNodeInitializerStrategy.class, childStrategy); + } + } + )) + .build(); + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-groovy/org/gradle/model/dsl/internal/transform/RuleVisitor.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-groovy/org/gradle/model/dsl/internal/transform/RuleVisitor.java new file mode 100644 index 0000000..d160a84 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/model-groovy/org/gradle/model/dsl/internal/transform/RuleVisitor.java @@ -0,0 +1,350 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.model.dsl.internal.transform; + +import com.google.common.base.Joiner; +import org.codehaus.groovy.ast.*; +import org.codehaus.groovy.ast.expr.*; +import org.codehaus.groovy.ast.stmt.BlockStatement; +import org.codehaus.groovy.ast.stmt.ExpressionStatement; +import org.codehaus.groovy.ast.stmt.ReturnStatement; +import org.codehaus.groovy.ast.stmt.Statement; +import org.codehaus.groovy.control.SourceUnit; +import org.codehaus.groovy.syntax.SyntaxException; +import org.codehaus.groovy.syntax.Token; +import org.codehaus.groovy.syntax.Types; +import org.gradle.api.Transformer; +import org.gradle.groovy.scripts.internal.AstUtils; +import org.gradle.groovy.scripts.internal.ExpressionReplacingVisitorSupport; +import org.gradle.internal.SystemProperties; +import org.gradle.model.dsl.internal.inputs.PotentialInputs; +import org.gradle.model.internal.core.ModelPath; +import org.gradle.util.CollectionUtils; + +import java.lang.reflect.Modifier; +import java.net.URI; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class RuleVisitor extends ExpressionReplacingVisitorSupport { + + public static final String INVALID_ARGUMENT_LIST = "argument list must be exactly 1 literal non empty string"; + public static final String SOURCE_URI_TOKEN = "@@sourceuri@@"; + public static final String SOURCE_DESC_TOKEN = "@@sourcedesc@@"; + + private static final String AST_NODE_METADATA_INPUTS_KEY = RuleVisitor.class.getName() + ".inputs"; + private static final String AST_NODE_METADATA_LOCATION_KEY = RuleVisitor.class.getName() + ".location"; + + private static final String DOLLAR = "$"; + private static final String GET = "get"; + private static final ClassNode POTENTIAL_INPUTS = new ClassNode(PotentialInputs.class); + private static final ClassNode TRANSFORMED_CLOSURE = new ClassNode(TransformedClosure.class); + private static final ClassNode INPUT_REFERENCES = new ClassNode(InputReferences.class); + private static final ClassNode SOURCE_LOCATION = new ClassNode(SourceLocation.class); + private static final ClassNode RULE_FACTORY = new ClassNode(ClosureBackedRuleFactory.class); + + private static final String INPUTS_FIELD_NAME = "__inputs__"; + private static final String RULE_FACTORY_FIELD_NAME = "__rule_factory__"; + private static final Token ASSIGN = new Token(Types.ASSIGN, "=", -1, -1); + + private final String scriptSourceDescription; + private final URI location; + private final SourceUnit sourceUnit; + private InputReferences inputs; + private VariableExpression inputsVariable; + private int nestingDepth; + private int counter; + + public RuleVisitor(SourceUnit sourceUnit, String scriptSourceDescription, URI location) { + this.scriptSourceDescription = scriptSourceDescription; + this.location = location; + this.sourceUnit = sourceUnit; + } + + // Not part of a normal visitor, see ClosureCreationInterceptingVerifier + public static void visitGeneratedClosure(ClassNode node) { + MethodNode closureCallMethod = AstUtils.getGeneratedClosureImplMethod(node); + Statement closureCode = closureCallMethod.getCode(); + InputReferences inputs = closureCode.getNodeMetaData(AST_NODE_METADATA_INPUTS_KEY); + if (inputs != null) { + SourceLocation sourceLocation = closureCode.getNodeMetaData(AST_NODE_METADATA_LOCATION_KEY); + node.addInterface(TRANSFORMED_CLOSURE); + FieldNode inputsField = new FieldNode(INPUTS_FIELD_NAME, Modifier.PRIVATE, POTENTIAL_INPUTS, node, null); + FieldNode ruleFactoryField = new FieldNode(RULE_FACTORY_FIELD_NAME, Modifier.PRIVATE, RULE_FACTORY, node, null); + node.addField(inputsField); + node.addField(ruleFactoryField); + + // Generate makeRule() method + List statements = new ArrayList(); + statements.add(new ExpressionStatement(new BinaryExpression(new FieldExpression(inputsField), ASSIGN, new VariableExpression("inputs")))); + statements.add(new ExpressionStatement(new BinaryExpression(new FieldExpression(ruleFactoryField), ASSIGN, new VariableExpression("ruleFactory")))); + node.addMethod(new MethodNode("makeRule", + Modifier.PUBLIC, + ClassHelper.VOID_TYPE, + new Parameter[]{new Parameter(POTENTIAL_INPUTS, "inputs"), new Parameter(RULE_FACTORY, "ruleFactory")}, + new ClassNode[0], + new BlockStatement(statements, new VariableScope()))); + + // Generate inputReferences() method + VariableExpression inputsVar = new VariableExpression("inputs", INPUT_REFERENCES); + VariableScope methodVarScope = new VariableScope(); + methodVarScope.putDeclaredVariable(inputsVar); + statements = new ArrayList(); + statements.add(new ExpressionStatement(new DeclarationExpression(inputsVar, ASSIGN, new ConstructorCallExpression(INPUT_REFERENCES, new ArgumentListExpression())))); + for (InputReference inputReference : inputs.getOwnReferences()) { + statements.add(new ExpressionStatement(new MethodCallExpression(inputsVar, + "ownReference", + new ArgumentListExpression( + new ConstantExpression(inputReference.getPath()), + new ConstantExpression(inputReference.getLineNumber()))))); + } + for (InputReference inputReference : inputs.getNestedReferences()) { + statements.add(new ExpressionStatement(new MethodCallExpression(inputsVar, + "nestedReference", + new ArgumentListExpression( + new ConstantExpression(inputReference.getPath()), + new ConstantExpression(inputReference.getLineNumber()))))); + } + statements.add(new ReturnStatement(inputsVar)); + node.addMethod(new MethodNode("inputReferences", + Modifier.PUBLIC, + INPUT_REFERENCES, + new Parameter[0], + new ClassNode[0], + new BlockStatement(statements, methodVarScope))); + + // Generate sourceLocation() method + statements = new ArrayList(); + statements.add(new ReturnStatement(new ConstructorCallExpression(SOURCE_LOCATION, + new ArgumentListExpression(Arrays.asList( + new ConstantExpression(SOURCE_URI_TOKEN), + new ConstantExpression(SOURCE_DESC_TOKEN), + new ConstantExpression(sourceLocation.getExpression()), + new ConstantExpression(sourceLocation.getLineNumber()), + new ConstantExpression(sourceLocation.getColumnNumber()) + ))))); + node.addMethod(new MethodNode("sourceLocation", + Modifier.PUBLIC, + SOURCE_LOCATION, + new Parameter[0], + new ClassNode[0], + new BlockStatement(statements, new VariableScope()))); + } + } + + public void visitRuleClosure(ClosureExpression expression, Expression invocation, String invocationDisplayName) { + InputReferences parentInputs = inputs; + VariableExpression parentInputsVariable = inputsVariable; + try { + inputs = new InputReferences(); + inputsVariable = new VariableExpression("__rule_inputs_var_" + (counter++), POTENTIAL_INPUTS); + inputsVariable.setClosureSharedVariable(true); + super.visitClosureExpression(expression); + BlockStatement code = (BlockStatement) expression.getCode(); + code.setNodeMetaData(AST_NODE_METADATA_LOCATION_KEY, new SourceLocation(location, scriptSourceDescription, invocationDisplayName, invocation.getLineNumber(), invocation.getColumnNumber())); + code.setNodeMetaData(AST_NODE_METADATA_INPUTS_KEY, inputs); + if (parentInputsVariable != null) { + expression.getVariableScope().putReferencedLocalVariable(parentInputsVariable); + } + code.getVariableScope().putDeclaredVariable(inputsVariable); + + if (parentInputsVariable == null) { + // = + DeclarationExpression variableDeclaration = new DeclarationExpression(inputsVariable, ASSIGN, new VariableExpression(INPUTS_FIELD_NAME)); + code.getStatements().add(0, new ExpressionStatement(variableDeclaration)); + + } else { + // = ?: + DeclarationExpression variableDeclaration = new DeclarationExpression(inputsVariable, ASSIGN, + new ElvisOperatorExpression( + new VariableExpression(INPUTS_FIELD_NAME), + parentInputsVariable)); + code.getStatements().add(0, new ExpressionStatement(variableDeclaration)); + } + + // Move default values into body of closure, so they can use + for (Parameter parameter : expression.getParameters()) { + if (parameter.hasInitialExpression()) { + code.getStatements().add(1, new ExpressionStatement(new BinaryExpression(new VariableExpression(parameter.getName()), ASSIGN, parameter.getInitialExpression()))); + parameter.setInitialExpression(ConstantExpression.NULL); + } + } + } finally { + if (parentInputs != null) { + parentInputs.addNestedReferences(inputs); + } + inputs = parentInputs; + inputsVariable = parentInputsVariable; + } + } + + @Override + public void visitClosureExpression(ClosureExpression expression) { + // Nested closure + nestingDepth++; + try { + expression.getVariableScope().putReferencedLocalVariable(inputsVariable); + super.visitClosureExpression(expression); + } finally { + nestingDepth--; + } + } + + @Override + public void visitPropertyExpression(PropertyExpression expr) { + String modelPath = isDollarPathExpression(expr); + if (modelPath != null) { + inputs.ownReference(modelPath, expr.getLineNumber()); + replaceVisitedExpressionWith(inputReferenceExpression(modelPath)); + } else { + super.visitPropertyExpression(expr); + } + } + + private String isDollarPathExpression(PropertyExpression expr) { + if (expr.isSafe() || expr.isSpreadSafe()) { + return null; + } + if (expr.getObjectExpression() instanceof VariableExpression) { + VariableExpression objectExpression = (VariableExpression) expr.getObjectExpression(); + if (objectExpression.getName().equals(DOLLAR)) { + return expr.getPropertyAsString(); + } else { + return null; + } + } + if (expr.getObjectExpression() instanceof PropertyExpression) { + PropertyExpression objectExpression = (PropertyExpression) expr.getObjectExpression(); + String path = isDollarPathExpression(objectExpression); + if (path != null) { + return path + '.' + expr.getPropertyAsString(); + } else { + return null; + } + } + return null; + } + + @Override + public void visitExpressionStatement(ExpressionStatement stat) { + if (nestingDepth == 0 && stat.getExpression() instanceof MethodCallExpression) { + MethodCallExpression call = (MethodCallExpression) stat.getExpression(); + if (call.isImplicitThis() && call.getArguments() instanceof ArgumentListExpression) { + ArgumentListExpression arguments = (ArgumentListExpression) call.getArguments(); + if (!arguments.getExpressions().isEmpty()) { + Expression lastArg = arguments.getExpression(arguments.getExpressions().size() - 1); + if (lastArg instanceof ClosureExpression) { + // This is a potential nested rule. + // Visit method parameters + for (int i = 0; i < arguments.getExpressions().size() - 1; i++) { + arguments.getExpressions().set(i, replaceExpr(arguments.getExpression(i))); + } + // Transform closure + ClosureExpression closureExpression = (ClosureExpression) lastArg; + visitRuleClosure(closureExpression, call, displayName(call)); + Expression replaced = new StaticMethodCallExpression(RULE_FACTORY, "decorate", new ArgumentListExpression(new VariableExpression(RULE_FACTORY_FIELD_NAME), closureExpression)); + arguments.getExpressions().set(arguments.getExpressions().size() - 1, replaced); + return; + } + } + } + } + super.visitExpressionStatement(stat); + } + + @Override + public void visitMethodCallExpression(MethodCallExpression call) { + String methodName = call.getMethodAsString(); + if (call.isImplicitThis() && methodName != null && methodName.equals(DOLLAR)) { + visitInputMethod(call); + return; + } + // visit the method call, because one of the args may be an input method call + super.visitMethodCallExpression(call); + } + + private void visitInputMethod(MethodCallExpression call) { + ConstantExpression argExpression = AstUtils.hasSingleConstantStringArg(call); + if (argExpression == null) { // not a valid signature + error(call, INVALID_ARGUMENT_LIST); + } else { + String modelPath = argExpression.getText(); + if (modelPath.isEmpty()) { + error(argExpression, INVALID_ARGUMENT_LIST); + return; + } + + try { + ModelPath.validatePath(modelPath); + } catch (ModelPath.InvalidPathException e) { + // TODO find a better way to present this information in the error message + // Attempt to mimic Gradle nested exception output + String message = "Invalid model path given as rule input." + SystemProperties.getInstance().getLineSeparator() + + " > " + e.getMessage(); + if (e.getCause() != null) { + // if there is a cause, it's an invalid name exception + message += SystemProperties.getInstance().getLineSeparator() + " > " + e.getCause().getMessage(); + } + error(argExpression, message); + return; + } + + inputs.ownReference(modelPath, call.getLineNumber()); + replaceVisitedExpressionWith(inputReferenceExpression(modelPath)); + } + } + + private MethodCallExpression inputReferenceExpression(String modelPath) { + return new MethodCallExpression(new VariableExpression(inputsVariable), new ConstantExpression(GET), new ArgumentListExpression(new ConstantExpression(modelPath))); + } + + private void error(ASTNode call, String message) { + SyntaxException syntaxException = new SyntaxException(message, call.getLineNumber(), call.getColumnNumber()); + sourceUnit.getErrorCollector().addError(syntaxException, sourceUnit); + } + + public static String displayName(MethodCallExpression expression) { + StringBuilder builder = new StringBuilder(); + if (!expression.isImplicitThis()) { + builder.append(expression.getObjectExpression().getText()); + builder.append('.'); + } + builder.append(expression.getMethodAsString()); + if (expression.getArguments() instanceof ArgumentListExpression) { + ArgumentListExpression arguments = (ArgumentListExpression) expression.getArguments(); + boolean hasTrailingClosure = !arguments.getExpressions().isEmpty() && arguments.getExpression(arguments.getExpressions().size() - 1) instanceof ClosureExpression; + List otherArgs = hasTrailingClosure ? arguments.getExpressions().subList(0, arguments.getExpressions().size() - 1) : arguments.getExpressions(); + if (!otherArgs.isEmpty() || !hasTrailingClosure) { + builder.append("("); + builder.append(Joiner.on(", ").join(CollectionUtils.collect(otherArgs, new Transformer() { + @Override + public Object transform(Expression expression) { + return expression.getText(); + } + }))); + builder.append(")"); + } + if (hasTrailingClosure) { + builder.append(" { ... }"); + } + } else { + builder.append("()"); + } + return builder.toString(); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/native/org/gradle/internal/nativeintegration/filesystem/Stat.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/native/org/gradle/internal/nativeintegration/filesystem/Stat.java new file mode 100644 index 0000000..5a7109f --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/native/org/gradle/internal/nativeintegration/filesystem/Stat.java @@ -0,0 +1,27 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.nativeintegration.filesystem; + +import org.gradle.internal.file.FileMetadataSnapshot; + +import java.io.File; + +public interface Stat { + int getUnixMode(File f) throws FileException; + + FileMetadataSnapshot stat(File f) throws FileException; +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/persistent-cache/org/gradle/cache/FileLockReleasedSignal.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/persistent-cache/org/gradle/cache/FileLockReleasedSignal.java new file mode 100644 index 0000000..9b88a44 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/persistent-cache/org/gradle/cache/FileLockReleasedSignal.java @@ -0,0 +1,35 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.cache; + +/** + * Signal that a file lock has been released. + * + * @see org.gradle.cache.internal.locklistener.FileLockContentionHandler + */ +public interface FileLockReleasedSignal { + + /** + * Triggers this signal to notify the lock requesters that the file + * lock has been released. + * + *

Returns once the signal has been emitted but not necessarily + * received by the lock requesters. + */ + void trigger(); + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/persistent-cache/org/gradle/cache/internal/HeapProportionalCacheSizer.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/persistent-cache/org/gradle/cache/internal/HeapProportionalCacheSizer.java new file mode 100644 index 0000000..2a50f59 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/persistent-cache/org/gradle/cache/internal/HeapProportionalCacheSizer.java @@ -0,0 +1,62 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.cache.internal; + +public class HeapProportionalCacheSizer { + public static final String CACHE_RESERVED_SYSTEM_PROPERTY = "org.gradle.cache.reserved.mb"; + private static final int DEFAULT_SIZES_MAX_HEAP_MB = 910; // when -Xmx1024m, Runtime.maxMemory() returns about 910 + private static final int ASSUMED_USED_HEAP = 150; // assume that Gradle itself uses about 150MB heap + + private static final double MIN_RATIO = 0.2d; + + private final int maxHeapMB; + private final double sizingRatio; + private final int reservedHeap; + + public HeapProportionalCacheSizer(int maxHeapMB) { + this.maxHeapMB = maxHeapMB; + this.reservedHeap = ASSUMED_USED_HEAP + Integer.getInteger(CACHE_RESERVED_SYSTEM_PROPERTY, 0); + this.sizingRatio = calculateRatioToDefaultAvailableHeap(); + } + + public HeapProportionalCacheSizer() { + this(calculateMaxHeapMB()); + } + + private static int calculateMaxHeapMB() { + return (int) (Runtime.getRuntime().maxMemory() / (1024 * 1024)); + } + + private double calculateRatioToDefaultAvailableHeap() { + double defaultAvailableHeapSpace = DEFAULT_SIZES_MAX_HEAP_MB - ASSUMED_USED_HEAP; + double availableHeapSpace = maxHeapMB - reservedHeap; + double ratioToDefaultAvailableHeap = availableHeapSpace / defaultAvailableHeapSpace; + return Math.max(ratioToDefaultAvailableHeap, MIN_RATIO); + } + + public int scaleCacheSize(int referenceValue) { + return scaleCacheSize(referenceValue, 100); + } + + private int scaleCacheSize(int referenceValue, int granularity) { + if (referenceValue < granularity) { + throw new IllegalArgumentException("reference value must be larger than granularity"); + } + int scaledValue = (int) ((double) referenceValue * sizingRatio) / granularity * granularity; + return Math.max(scaledValue, granularity); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/persistent-cache/org/gradle/cache/internal/LeastRecentlyUsedCacheCleanup.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/persistent-cache/org/gradle/cache/internal/LeastRecentlyUsedCacheCleanup.java new file mode 100644 index 0000000..3137ac7 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/persistent-cache/org/gradle/cache/internal/LeastRecentlyUsedCacheCleanup.java @@ -0,0 +1,62 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.cache.internal; + +import org.gradle.cache.CleanableStore; +import org.gradle.cache.CleanupProgressMonitor; +import org.gradle.internal.resource.local.FileAccessTimeJournal; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.Date; +import java.util.concurrent.TimeUnit; + +/** + * Deletes any cache entries not accessed within the specified number of days. + */ +public class LeastRecentlyUsedCacheCleanup extends AbstractCacheCleanup { + private static final Logger LOGGER = LoggerFactory.getLogger(LeastRecentlyUsedCacheCleanup.class); + + public static final long DEFAULT_MAX_AGE_IN_DAYS_FOR_RECREATABLE_CACHE_ENTRIES = 7; + public static final long DEFAULT_MAX_AGE_IN_DAYS_FOR_EXTERNAL_CACHE_ENTRIES = 30; + + private final FileAccessTimeJournal journal; + private final long minimumTimestamp; + + public LeastRecentlyUsedCacheCleanup(FilesFinder eligibleFilesFinder, FileAccessTimeJournal journal, long numberOfDays) { + super(eligibleFilesFinder); + this.journal = journal; + this.minimumTimestamp = Math.max(0, System.currentTimeMillis() - TimeUnit.DAYS.toMillis(numberOfDays)); + } + + @Override + public void clean(CleanableStore cleanableStore, CleanupProgressMonitor progressMonitor) { + LOGGER.info("{} removing files not accessed on or after {}.", cleanableStore.getDisplayName(), new Date(minimumTimestamp)); + super.clean(cleanableStore, progressMonitor); + } + + @Override + protected boolean shouldDelete(File file) { + return journal.getLastAccessTime(file) < minimumTimestamp; + } + + @Override + protected void handleDeletion(File file) { + journal.deleteLastAccessTime(file); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/persistent-cache/org/gradle/cache/internal/MinimalPersistentCache.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/persistent-cache/org/gradle/cache/internal/MinimalPersistentCache.java new file mode 100644 index 0000000..2684356 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/persistent-cache/org/gradle/cache/internal/MinimalPersistentCache.java @@ -0,0 +1,46 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.cache.internal; + +import org.gradle.cache.PersistentIndexedCache; +import org.gradle.internal.Factory; + +public class MinimalPersistentCache implements Cache { + private final PersistentIndexedCache cache; + + public MinimalPersistentCache(PersistentIndexedCache cache) { + this.cache = cache; + } + + @Override + public V get(K key, Factory factory) { + V cached = cache.get(key); + if (cached != null) { + return cached; + } + + V value = factory.create(); //don't synchronize value creation + //we could potentially avoid creating value that is already being created by a different thread. + + cache.put(key, value); + return value; + } + + public V get(K value) { + return cache.get(value); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/persistent-cache/org/gradle/cache/internal/btree/BlockPointer.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/persistent-cache/org/gradle/cache/internal/btree/BlockPointer.java new file mode 100644 index 0000000..2d994b7 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/persistent-cache/org/gradle/cache/internal/btree/BlockPointer.java @@ -0,0 +1,74 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.cache.internal.btree; + +import com.google.common.primitives.Longs; + +public class BlockPointer implements Comparable { + + private static final BlockPointer NULL = new BlockPointer(-1); + + public static BlockPointer start() { + return NULL; + } + + public static BlockPointer pos(long pos) { + if (pos < -1) { + throw new CorruptedCacheException("block pointer must be >= -1, but was" + pos); + } + if (pos == -1) { + return NULL; + } + return new BlockPointer(pos); + } + + private final long pos; + + private BlockPointer(long pos) { + this.pos = pos; + } + + public boolean isNull() { + return pos < 0; + } + + public long getPos() { + return pos; + } + + @Override + public String toString() { + return String.valueOf(pos); + } + + @Override + public boolean equals(Object obj) { + if (obj == null || obj.getClass() != getClass()) { + return false; + } + BlockPointer other = (BlockPointer) obj; + return pos == other.pos; + } + + @Override + public int hashCode() { + return Longs.hashCode(pos); + } + + public int compareTo(BlockPointer o) { + return Longs.compare(pos, o.pos); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/persistent-cache/org/gradle/cache/internal/filelock/LockFileAccess.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/persistent-cache/org/gradle/cache/internal/filelock/LockFileAccess.java new file mode 100644 index 0000000..ae6d8c8 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/persistent-cache/org/gradle/cache/internal/filelock/LockFileAccess.java @@ -0,0 +1,94 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.cache.internal.filelock; + +import javax.annotation.Nullable; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.nio.channels.FileLock; + +public class LockFileAccess { + + private final RandomAccessFile lockFileAccess; + + private final LockStateAccess lockStateAccess; + private final LockInfoAccess lockInfoAccess; + + public LockFileAccess(File lockFile, LockStateAccess lockStateAccess) throws FileNotFoundException { + this.lockFileAccess = new RandomAccessFile(lockFile, "rw"); + this.lockStateAccess = lockStateAccess; + lockInfoAccess = new LockInfoAccess(this.lockStateAccess.getRegionEnd()); + } + + public void close() throws IOException { + lockFileAccess.close(); + } + + public void writeLockInfo(int port, long lockId, String pid, String operation) throws IOException { + LockInfo lockInfo = new LockInfo(); + lockInfo.port = port; + lockInfo.lockId = lockId; + lockInfo.pid = pid; + lockInfo.operation = operation; + lockInfoAccess.writeLockInfo(lockFileAccess, lockInfo); + } + + public LockInfo readLockInfo() throws IOException { + return lockInfoAccess.readLockInfo(lockFileAccess); + } + + /** + * Reads the lock state from the lock file, possibly writing out a new lock file if not present or empty. + */ + public LockState ensureLockState() throws IOException { + return lockStateAccess.ensureLockState(lockFileAccess); + } + + public LockState markClean(LockState lockState) throws IOException { + LockState newState = lockState.completeUpdate(); + lockStateAccess.writeState(lockFileAccess, newState); + return newState; + } + + public LockState markDirty(LockState lockState) throws IOException { + LockState newState = lockState.beforeUpdate(); + lockStateAccess.writeState(lockFileAccess, newState); + return newState; + } + + public void clearLockInfo() throws IOException { + lockInfoAccess.clearLockInfo(lockFileAccess); + } + + @Nullable + public FileLock tryLockInfo(boolean shared) throws IOException { + return lockInfoAccess.tryLock(lockFileAccess, shared); + } + + @Nullable + public FileLock tryLockState(boolean shared) throws IOException { + return lockStateAccess.tryLock(lockFileAccess, shared); + } + + /** + * Reads the lock state from the lock file. + */ + public LockState readLockState() throws IOException { + return lockStateAccess.readState(lockFileAccess); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/language/base/compile/package-info.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/language/base/compile/package-info.java new file mode 100644 index 0000000..d8e2a40 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/language/base/compile/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * General purpose types for related to compiling. + */ +package org.gradle.language.base.compile; diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/language/base/internal/compile/CompilerFactory.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/language/base/internal/compile/CompilerFactory.java new file mode 100644 index 0000000..8003058 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/language/base/internal/compile/CompilerFactory.java @@ -0,0 +1,21 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.base.internal.compile; + +public interface CompilerFactory { + Compiler newCompiler(T spec); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/language/base/internal/registry/LanguageTransform.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/language/base/internal/registry/LanguageTransform.java new file mode 100644 index 0000000..5664c37 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/language/base/internal/registry/LanguageTransform.java @@ -0,0 +1,56 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.base.internal.registry; + +import org.gradle.language.base.LanguageSourceSet; +import org.gradle.language.base.internal.SourceTransformTaskConfig; +import org.gradle.platform.base.BinarySpec; +import org.gradle.platform.base.TransformationFileType; + +import java.util.Map; + +/** + * A registered language transformation. + */ +public interface LanguageTransform { + /** + * The language name. + */ + String getLanguageName(); + + /** + * The interface type of the language source set. + */ + Class getSourceSetType(); + + /** + * The output type generated from these language sources. + */ + Class getOutputType(); + + /** + * The tool extensions that should be added to any binary with these language sources. + */ + Map> getBinaryTools(); + + /** + * The task used to transform sources into code for the target runtime. + */ + SourceTransformTaskConfig getTransformTask(); + + boolean applyToBinary(BinarySpec binary); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/language/base/internal/registry/LanguageTransformContainer.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/language/base/internal/registry/LanguageTransformContainer.java new file mode 100644 index 0000000..12d1cbd --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/language/base/internal/registry/LanguageTransformContainer.java @@ -0,0 +1,25 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.base.internal.registry; + +import org.gradle.api.DomainObjectSet; + +/** + * A registry of language transforms. + */ +public interface LanguageTransformContainer extends DomainObjectSet> { +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/language/base/plugins/ComponentModelBasePlugin.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/language/base/plugins/ComponentModelBasePlugin.java new file mode 100644 index 0000000..990188e --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/language/base/plugins/ComponentModelBasePlugin.java @@ -0,0 +1,288 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.language.base.plugins; + +import com.google.common.base.Joiner; +import com.google.common.collect.Lists; +import org.gradle.api.Action; +import org.gradle.api.GradleException; +import org.gradle.api.Incubating; +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.Task; +import org.gradle.api.internal.CollectionCallbackActionDecorator; +import org.gradle.api.internal.project.ProjectIdentifier; +import org.gradle.api.internal.project.ProjectInternal; +import org.gradle.api.internal.project.ProjectRegistry; +import org.gradle.api.internal.resolve.ProjectModelResolver; +import org.gradle.api.plugins.ExtensionContainer; +import org.gradle.api.tasks.TaskContainer; +import org.gradle.internal.Cast; +import org.gradle.internal.reflect.Instantiator; +import org.gradle.internal.service.ServiceRegistry; +import org.gradle.internal.text.TreeFormatter; +import org.gradle.language.base.LanguageSourceSet; +import org.gradle.language.base.ProjectSourceSet; +import org.gradle.language.base.internal.ProjectLayout; +import org.gradle.language.base.internal.model.BinarySourceTransformations; +import org.gradle.language.base.internal.registry.DefaultLanguageTransformContainer; +import org.gradle.language.base.internal.registry.LanguageTransform; +import org.gradle.language.base.internal.registry.LanguageTransformContainer; +import org.gradle.model.Defaults; +import org.gradle.model.Each; +import org.gradle.model.Finalize; +import org.gradle.model.Model; +import org.gradle.model.ModelMap; +import org.gradle.model.Mutate; +import org.gradle.model.Path; +import org.gradle.model.RuleInput; +import org.gradle.model.RuleSource; +import org.gradle.model.RuleTarget; +import org.gradle.model.Rules; +import org.gradle.model.internal.core.Hidden; +import org.gradle.platform.base.ApplicationSpec; +import org.gradle.platform.base.BinaryContainer; +import org.gradle.platform.base.BinarySpec; +import org.gradle.platform.base.ComponentSpecContainer; +import org.gradle.platform.base.ComponentType; +import org.gradle.platform.base.GeneralComponentSpec; +import org.gradle.platform.base.LibrarySpec; +import org.gradle.platform.base.PlatformAwareComponentSpec; +import org.gradle.platform.base.PlatformContainer; +import org.gradle.platform.base.SourceComponentSpec; +import org.gradle.platform.base.TypeBuilder; +import org.gradle.platform.base.VariantComponentSpec; +import org.gradle.platform.base.component.BaseComponentSpec; +import org.gradle.platform.base.internal.BinarySpecInternal; +import org.gradle.platform.base.internal.DefaultPlatformContainer; +import org.gradle.platform.base.internal.DefaultPlatformResolvers; +import org.gradle.platform.base.internal.HasIntermediateOutputsComponentSpec; +import org.gradle.platform.base.internal.PlatformAwareComponentSpecInternal; +import org.gradle.platform.base.internal.PlatformResolvers; +import org.gradle.platform.base.internal.dependents.BaseDependentBinariesResolutionStrategy; +import org.gradle.platform.base.internal.dependents.DefaultDependentBinariesResolver; +import org.gradle.platform.base.internal.dependents.DependentBinariesResolver; +import org.gradle.platform.base.plugins.BinaryBasePlugin; + +import java.io.File; +import java.util.List; +import java.util.Set; + +import static com.google.common.base.Strings.emptyToNull; + +/** + * Base plugin for component support. + * + * Adds a {@link org.gradle.platform.base.ComponentSpecContainer} named {@code components} to the model. + * + * For each binary instance added to the binaries container, registers a lifecycle task to create that binary. + */ +@Incubating +public class ComponentModelBasePlugin implements Plugin { + + @Override + public void apply(Project project) { + project.getPluginManager().apply(LanguageBasePlugin.class); + project.getPluginManager().apply(BinaryBasePlugin.class); + } + + @SuppressWarnings("UnusedDeclaration") + static class PluginRules extends RuleSource { + @ComponentType + void registerGeneralComponentSpec(TypeBuilder builder) { + builder.defaultImplementation(BaseComponentSpec.class); + } + + @ComponentType + void registerLibrarySpec(TypeBuilder builder) { + builder.defaultImplementation(BaseComponentSpec.class); + } + + @ComponentType + void registerApplicationSpec(TypeBuilder builder) { + builder.defaultImplementation(BaseComponentSpec.class); + } + + @ComponentType + void registerPlatformAwareComponent(TypeBuilder builder) { + builder.internalView(PlatformAwareComponentSpecInternal.class); + } + + @Hidden @Model + LanguageTransformContainer languageTransforms(CollectionCallbackActionDecorator collectionCallbackActionDecorator) { + return new DefaultLanguageTransformContainer(collectionCallbackActionDecorator); + } + + // Finalizing here, as we need this to run after any 'assembling' task (jar, link, etc) is created. + // TODO: Convert this to `@BinaryTasks` when we model a `NativeAssembly` instead of wiring compile tasks directly to LinkTask + @Finalize + void createSourceTransformTasks(final TaskContainer tasks, @Path("binaries") final ModelMap binaries, LanguageTransformContainer languageTransforms, ServiceRegistry serviceRegistry) { + BinarySourceTransformations transformations = new BinarySourceTransformations(tasks, languageTransforms, serviceRegistry); + for (BinarySpecInternal binary : binaries) { + if (binary.isLegacyBinary()) { + continue; + } + + transformations.createTasksFor(binary); + } + } + + @Model + public ProjectLayout projectLayout(ProjectIdentifier projectIdentifier, @Path("buildDir") File buildDir) { + return new ProjectLayout(projectIdentifier, buildDir); + } + + @Model + PlatformContainer platforms(Instantiator instantiator, CollectionCallbackActionDecorator collectionCallbackActionDecorator) { + return instantiator.newInstance(DefaultPlatformContainer.class, instantiator, collectionCallbackActionDecorator); + } + + @Hidden @Model + PlatformResolvers platformResolver(PlatformContainer platforms) { + return new DefaultPlatformResolvers(platforms); + } + + @Mutate + void registerPlatformExtension(ExtensionContainer extensions, PlatformContainer platforms) { + extensions.add(PlatformContainer.class, "platforms", platforms); + } + + @Mutate + void collectBinaries(BinaryContainer binaries, ComponentSpecContainer componentSpecs) { + for (VariantComponentSpec componentSpec : componentSpecs.withType(VariantComponentSpec.class)) { + for (BinarySpecInternal binary : componentSpec.getBinaries().withType(BinarySpecInternal.class).values()) { + binaries.put(binary.getProjectScopedName(), binary); + } + } + } + + @Mutate + void attachBinariesToAssembleLifecycle(@Path("tasks.assemble") Task assemble, ComponentSpecContainer components) { + List notBuildable = Lists.newArrayList(); + boolean hasBuildableBinaries = false; + for (VariantComponentSpec component : components.withType(VariantComponentSpec.class)) { + for (BinarySpecInternal binary : component.getBinaries().withType(BinarySpecInternal.class)) { + if (binary.isBuildable()) { + assemble.dependsOn(binary); + hasBuildableBinaries = true; + } else { + notBuildable.add(binary); + } + } + } + if (!hasBuildableBinaries && !notBuildable.isEmpty()) { + assemble.doFirst(new CheckForNotBuildableBinariesAction(notBuildable)); + } + } + + private static class CheckForNotBuildableBinariesAction implements Action { + private final List notBuildable; + + public CheckForNotBuildableBinariesAction(List notBuildable) { + this.notBuildable = notBuildable; + } + + @Override + public void execute(Task task) { + Set taskDependencies = task.getTaskDependencies().getDependencies(task); + + if (taskDependencies.isEmpty()) { + TreeFormatter formatter = new TreeFormatter(); + formatter.node("No buildable binaries found"); + formatter.startChildren(); + for (BinarySpecInternal binary : notBuildable) { + formatter.node(binary.getDisplayName()); + formatter.startChildren(); + binary.getBuildAbility().explain(formatter); + formatter.endChildren(); + } + formatter.endChildren(); + throw new GradleException(formatter.toString()); + } + } + } + + @Defaults + void initializeComponentSourceSets(@Each HasIntermediateOutputsComponentSpec component, LanguageTransformContainer languageTransforms) { + // If there is a transform for the language into one of the component inputs, add a default source set + for (LanguageTransform languageTransform : languageTransforms) { + if (component.getIntermediateTypes().contains(languageTransform.getOutputType())) { + component.getSources().create(languageTransform.getLanguageName(), languageTransform.getSourceSetType()); + } + } + } + + @Finalize + void applyFallbackSourceConventions(@Each LanguageSourceSet languageSourceSet, ProjectIdentifier projectIdentifier) { + // Only apply default locations when none explicitly configured + if (languageSourceSet.getSource().getSourceDirectories().isEmpty()) { + File baseDir = projectIdentifier.getProjectDir(); + String defaultSourceDir = Joiner.on(File.separator).skipNulls().join(baseDir.getPath(), "src", emptyToNull(languageSourceSet.getParentName()), emptyToNull(languageSourceSet.getName())); + languageSourceSet.getSource().srcDir(defaultSourceDir); + } + } + + @Defaults + // TODO:LPTR We should collect all source sets in the project source set, however this messes up ComponentReportRenderer + void addComponentSourcesSetsToProjectSourceSet(@Each SourceComponentSpec component, final ProjectSourceSet projectSourceSet) { + component.getSources().afterEach(new Action() { + @Override + public void execute(LanguageSourceSet languageSourceSet) { + projectSourceSet.add(languageSourceSet); + } + }); + } + + @Rules + void inputRules(AttachInputs attachInputs, @Each GeneralComponentSpec component) { + attachInputs.setBinaries(component.getBinaries()); + attachInputs.setSources(component.getSources()); + } + + static abstract class AttachInputs extends RuleSource { + @RuleTarget + abstract ModelMap getBinaries(); + abstract void setBinaries(ModelMap binaries); + + @RuleInput + abstract ModelMap getSources(); + abstract void setSources(ModelMap sources); + + @Mutate + void initializeBinarySourceSets(ModelMap binaries) { + // TODO - sources is not actual an input to binaries, it's an input to each binary + binaries.withType(BinarySpecInternal.class, new Action() { + @Override + public void execute(BinarySpecInternal binary) { + binary.getInputs().addAll(getSources().values()); + } + }); + } + } + + @Hidden @Model + DependentBinariesResolver dependentBinariesResolver(Instantiator instantiator) { + return instantiator.newInstance(DefaultDependentBinariesResolver.class); + } + + @Defaults + void registerBaseDependentBinariesResolutionStrategy(DependentBinariesResolver resolver, ServiceRegistry serviceRegistry) { + ProjectRegistry projectRegistry = Cast.uncheckedCast(serviceRegistry.get(ProjectRegistry.class)); + ProjectModelResolver projectModelResolver = serviceRegistry.get(ProjectModelResolver.class); + resolver.register(new BaseDependentBinariesResolutionStrategy(projectRegistry, projectModelResolver)); + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/platform/base/LibrarySpec.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/platform/base/LibrarySpec.java new file mode 100644 index 0000000..7753b31 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/platform/base/LibrarySpec.java @@ -0,0 +1,27 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.platform.base; + +import org.gradle.api.Incubating; + +/** + * A specification of a {@link org.gradle.platform.base.Library}. + */ +@Incubating +public interface LibrarySpec extends GeneralComponentSpec { + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/platform/base/SourceComponentSpec.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/platform/base/SourceComponentSpec.java new file mode 100644 index 0000000..405836c --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/platform/base/SourceComponentSpec.java @@ -0,0 +1,35 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.platform.base; + +import org.gradle.api.Incubating; +import org.gradle.internal.HasInternalProtocol; +import org.gradle.language.base.LanguageSourceSet; +import org.gradle.model.ModelMap; + +/** + * Represents some component whose implementation can be represented as a collection of source files, and whose other + * outputs are built from this source. + */ +@Incubating +@HasInternalProtocol +public interface SourceComponentSpec extends ComponentSpec { + /** + * The source sets for this component. + */ + ModelMap getSources(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/platform/base/VariantComponent.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/platform/base/VariantComponent.java new file mode 100644 index 0000000..27c04ff --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/platform/base/VariantComponent.java @@ -0,0 +1,32 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.platform.base; + +import org.gradle.api.Incubating; +import org.gradle.model.ModelElement; + +/** + * A component that has one or more mutually exclusive variants. + */ +@Incubating +public interface VariantComponent extends ModelElement { + /** + * The variants of this component. + */ + Iterable getVariants(); + String getName(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/platform/base/internal/dependents/DependentBinariesResolver.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/platform/base/internal/dependents/DependentBinariesResolver.java new file mode 100644 index 0000000..654fe07 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/platform/base/internal/dependents/DependentBinariesResolver.java @@ -0,0 +1,35 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.platform.base.internal.dependents; + +import org.gradle.platform.base.internal.BinarySpecInternal; + +import javax.annotation.Nullable; + +/** + * Resolve dependent binaries. + */ +public interface DependentBinariesResolver { + + DependentBinariesResolutionResult resolve(BinarySpecInternal target); + + void register(DependentBinariesResolutionStrategy strategy); + + @Nullable + T getStrategy(String name, Class type); + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/platform/base/internal/toolchain/ToolChainAvailability.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/platform/base/internal/toolchain/ToolChainAvailability.java new file mode 100644 index 0000000..922ed3f --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-base/org/gradle/platform/base/internal/toolchain/ToolChainAvailability.java @@ -0,0 +1,72 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.platform.base.internal.toolchain; + +import org.gradle.internal.text.TreeFormatter; +import org.gradle.util.TreeVisitor; + +public class ToolChainAvailability implements ToolSearchResult { + private ToolSearchResult reason; + + @Override + public boolean isAvailable() { + return reason == null; + } + + public String getUnavailableMessage() { + TreeFormatter formatter = new TreeFormatter(); + this.explain(formatter); + return formatter.toString(); + } + + @Override + public void explain(TreeVisitor visitor) { + reason.explain(visitor); + } + + public ToolChainAvailability unavailable(String unavailableMessage) { + if (reason == null) { + reason = new FixedMessageToolSearchResult(unavailableMessage); + } + return this; + } + + public ToolChainAvailability mustBeAvailable(ToolSearchResult tool) { + if (!tool.isAvailable() && reason == null) { + reason = tool; + } + return this; + } + + private static class FixedMessageToolSearchResult implements ToolSearchResult { + private final String message; + + private FixedMessageToolSearchResult(String message) { + this.message = message; + } + + @Override + public boolean isAvailable() { + return false; + } + + @Override + public void explain(TreeVisitor visitor) { + visitor.node(message); + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-jvm/org/gradle/jvm/internal/WithDependencies.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-jvm/org/gradle/jvm/internal/WithDependencies.java new file mode 100644 index 0000000..5968a1c --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-jvm/org/gradle/jvm/internal/WithDependencies.java @@ -0,0 +1,32 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.jvm.internal; + +import org.gradle.platform.base.DependencySpec; + +import java.util.Collection; + +public interface WithDependencies { + /** + * Sets the component level dependencies of this binary. + */ + void setDependencies(Collection dependencies); + + /** + * The component level dependencies of this binary. + */ + Collection getDependencies(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-jvm/org/gradle/jvm/toolchain/JavaToolChain.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-jvm/org/gradle/jvm/toolchain/JavaToolChain.java new file mode 100644 index 0000000..02983b9 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-jvm/org/gradle/jvm/toolchain/JavaToolChain.java @@ -0,0 +1,60 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.jvm.toolchain; + +import org.gradle.api.tasks.Input; +import org.gradle.api.tasks.Internal; +import org.gradle.internal.HasInternalProtocol; +import org.gradle.platform.base.ToolChain; + +/** + * A set of tools for building from Java source. + * + *

A {@code JavaToolChain} is able to: + * + *

    + * + *
  • Compile Java source to bytecode.
  • + * + *
  • Generate Javadoc from Java source.
  • + * + *
+ */ +@HasInternalProtocol +public interface JavaToolChain extends ToolChain { + /** + * The version of the toolchain. + * + * @since 3.5 + */ + @Input + String getVersion(); + + /** + * {@inheritDoc} + */ + @Override + @Internal + String getDisplayName(); + + /** + * {@inheritDoc} + */ + @Override + @Internal + String getName(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-jvm/org/gradle/jvm/toolchain/package-info.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-jvm/org/gradle/jvm/toolchain/package-info.java new file mode 100644 index 0000000..1f9ba1f --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-jvm/org/gradle/jvm/toolchain/package-info.java @@ -0,0 +1,21 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Defines tools that can build things that run on the JVM. + */ +@org.gradle.api.Incubating +package org.gradle.jvm.toolchain; diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/META-INF/gradle-plugins/org.gradle.native-component-model.properties b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/META-INF/gradle-plugins/org.gradle.native-component-model.properties new file mode 100644 index 0000000..2523b4c --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/META-INF/gradle-plugins/org.gradle.native-component-model.properties @@ -0,0 +1 @@ +implementation-class=org.gradle.nativeplatform.plugins.NativeComponentModelPlugin diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/org/gradle/nativeplatform/internal/SharedLibraryLinkerSpec.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/org/gradle/nativeplatform/internal/SharedLibraryLinkerSpec.java new file mode 100644 index 0000000..c8a4f33 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/org/gradle/nativeplatform/internal/SharedLibraryLinkerSpec.java @@ -0,0 +1,25 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.nativeplatform.internal; + +import java.io.File; + +public interface SharedLibraryLinkerSpec extends LinkerSpec { + String getInstallName(); + + File getImportLibrary(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/org/gradle/nativeplatform/platform/internal/OperatingSystemInternal.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/org/gradle/nativeplatform/platform/internal/OperatingSystemInternal.java new file mode 100644 index 0000000..e06998b --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/org/gradle/nativeplatform/platform/internal/OperatingSystemInternal.java @@ -0,0 +1,27 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.nativeplatform.platform.internal; + +import org.gradle.api.tasks.Internal; +import org.gradle.nativeplatform.platform.OperatingSystem; + +public interface OperatingSystemInternal extends OperatingSystem { + @Internal + org.gradle.internal.os.OperatingSystem getInternalOs(); + + String toFamilyName(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/org/gradle/nativeplatform/tasks/package-info.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/org/gradle/nativeplatform/tasks/package-info.java new file mode 100644 index 0000000..607d98f --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/org/gradle/nativeplatform/tasks/package-info.java @@ -0,0 +1,21 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Tasks for building native component projects. + */ +@org.gradle.api.Incubating +package org.gradle.nativeplatform.tasks; diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/org/gradle/nativeplatform/toolchain/internal/gcc/TargetPlatformConfiguration.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/org/gradle/nativeplatform/toolchain/internal/gcc/TargetPlatformConfiguration.java new file mode 100644 index 0000000..59a0839 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/org/gradle/nativeplatform/toolchain/internal/gcc/TargetPlatformConfiguration.java @@ -0,0 +1,31 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.nativeplatform.toolchain.internal.gcc; + +import org.gradle.nativeplatform.platform.internal.NativePlatformInternal; + +public interface TargetPlatformConfiguration { + /** + * Returns whether a platform is supported or not. + */ + boolean supportsPlatform(NativePlatformInternal targetPlatform); + + /** + * applies a platform specific toolchain configuration + */ + void apply(DefaultGccPlatformToolChain platformToolChain); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/org/gradle/nativeplatform/toolchain/internal/msvcpp/CCompiler.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/org/gradle/nativeplatform/toolchain/internal/msvcpp/CCompiler.java new file mode 100644 index 0000000..4a07332 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/org/gradle/nativeplatform/toolchain/internal/msvcpp/CCompiler.java @@ -0,0 +1,39 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.nativeplatform.toolchain.internal.msvcpp; + +import org.gradle.api.Transformer; +import org.gradle.internal.operations.BuildOperationExecutor; +import org.gradle.internal.work.WorkerLeaseService; +import org.gradle.nativeplatform.internal.CompilerOutputFileNamingSchemeFactory; +import org.gradle.nativeplatform.toolchain.internal.CommandLineToolContext; +import org.gradle.nativeplatform.toolchain.internal.CommandLineToolInvocationWorker; +import org.gradle.nativeplatform.toolchain.internal.compilespec.CCompileSpec; + +class CCompiler extends VisualCppNativeCompiler { + + CCompiler(BuildOperationExecutor buildOperationExecutor, CompilerOutputFileNamingSchemeFactory compilerOutputFileNamingSchemeFactory, CommandLineToolInvocationWorker commandLineToolInvocationWorker, CommandLineToolContext invocationContext, Transformer specTransformer, String objectFileExtension, boolean useCommandFile, WorkerLeaseService workerLeaseService) { + super(buildOperationExecutor, compilerOutputFileNamingSchemeFactory, commandLineToolInvocationWorker, invocationContext, new CCompilerArgsTransformer(), specTransformer, objectFileExtension, useCommandFile, workerLeaseService); + } + + private static class CCompilerArgsTransformer extends VisualCppCompilerArgsTransformer { + @Override + protected String getLanguageOption() { + return "/TC"; + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/org/gradle/nativeplatform/toolchain/internal/msvcpp/UcrtLocator.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/org/gradle/nativeplatform/toolchain/internal/msvcpp/UcrtLocator.java new file mode 100644 index 0000000..1147c11 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/org/gradle/nativeplatform/toolchain/internal/msvcpp/UcrtLocator.java @@ -0,0 +1,20 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.nativeplatform.toolchain.internal.msvcpp; + +public interface UcrtLocator extends WindowsComponentLocator { +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/org/gradle/nativeplatform/toolchain/internal/tools/CommandLineToolConfigurationInternal.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/org/gradle/nativeplatform/toolchain/internal/tools/CommandLineToolConfigurationInternal.java new file mode 100644 index 0000000..9faa367 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-native/org/gradle/nativeplatform/toolchain/internal/tools/CommandLineToolConfigurationInternal.java @@ -0,0 +1,27 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.nativeplatform.toolchain.internal.tools; + +import org.gradle.api.Action; +import org.gradle.nativeplatform.toolchain.CommandLineToolConfiguration; + +import java.util.List; + +public interface CommandLineToolConfigurationInternal extends CommandLineToolConfiguration{ + + public Action> getArgAction(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-play/META-INF/gradle-plugins/org.gradle.play-application.properties b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-play/META-INF/gradle-plugins/org.gradle.play-application.properties new file mode 100644 index 0000000..cb32c4c --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-play/META-INF/gradle-plugins/org.gradle.play-application.properties @@ -0,0 +1,17 @@ +# +# Copyright 2014 the original author or authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +implementation-class=org.gradle.play.plugins.PlayApplicationPlugin diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-play/org/gradle/play/internal/platform/PlayMajorVersion.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-play/org/gradle/play/internal/platform/PlayMajorVersion.java new file mode 100644 index 0000000..45f5c74 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/platform-play/org/gradle/play/internal/platform/PlayMajorVersion.java @@ -0,0 +1,75 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.play.internal.platform; + +import com.google.common.collect.Lists; +import org.gradle.api.InvalidUserDataException; +import org.gradle.language.scala.ScalaPlatform; +import org.gradle.play.platform.PlayPlatform; +import org.gradle.util.CollectionUtils; +import org.gradle.util.VersionNumber; + +import java.util.List; + +public enum PlayMajorVersion { + PLAY_2_3_X("2.3.x", "2.11", "2.10"), + PLAY_2_4_X("2.4.x", "2.11", "2.10"), + PLAY_2_5_X("2.5.x", "2.11"), + PLAY_2_6_X("2.6.x", "2.12", "2.11"); + + private final String name; + private final List compatibleScalaVersions; + + PlayMajorVersion(String name, String... compatibleScalaVersions) { + this.name = name; + this.compatibleScalaVersions = Lists.newArrayList(compatibleScalaVersions); + } + + public void validateCompatible(ScalaPlatform scalaPlatform) { + if (!compatibleScalaVersions.contains(scalaPlatform.getScalaCompatibilityVersion())) { + throw new InvalidUserDataException( + String.format("Play versions %s are not compatible with Scala platform %s. Compatible Scala platforms are %s.", + name, scalaPlatform.getScalaCompatibilityVersion(), compatibleScalaVersions)); + } + } + + public String getDefaultScalaPlatform() { + return compatibleScalaVersions.get(0); + } + + public static PlayMajorVersion forPlatform(PlayPlatform targetPlatform) { + String playVersion = targetPlatform.getPlayVersion(); + return forPlayVersion(playVersion); + } + + public static PlayMajorVersion forPlayVersion(String playVersion) { + VersionNumber versionNumber = VersionNumber.parse(playVersion); + if (versionNumber.getMajor() == 2) { + int index = versionNumber.getMinor() - 3; + if (index < 0 || index >= values().length) { + throw invalidVersion(playVersion); + } + return values()[index]; + } + throw invalidVersion(playVersion); + } + + private static InvalidUserDataException invalidVersion(String playVersion) { + return new InvalidUserDataException(String.format("Not a supported Play version: %s. This plugin is compatible with: [%s].", + playVersion, CollectionUtils.join(", ", values()))); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/process-services/org/gradle/process/internal/ExecHandleState.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/process-services/org/gradle/process/internal/ExecHandleState.java new file mode 100644 index 0000000..a3644ce --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/process-services/org/gradle/process/internal/ExecHandleState.java @@ -0,0 +1,37 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.process.internal; + +public enum ExecHandleState { + INIT(false), + STARTING(false), + STARTED(false), + ABORTED(true), + FAILED(true), + DETACHED(true), + SUCCEEDED(true); + + private final boolean terminal; + + ExecHandleState(boolean terminal) { + this.terminal = terminal; + } + + public boolean isTerminal() { + return terminal; + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/process-services/org/gradle/process/internal/health/memory/JvmMemoryStatus.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/process-services/org/gradle/process/internal/health/memory/JvmMemoryStatus.java new file mode 100644 index 0000000..c08faea --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/process-services/org/gradle/process/internal/health/memory/JvmMemoryStatus.java @@ -0,0 +1,32 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.process.internal.health.memory; + +/** + * Current JVM memory status. + */ +public interface JvmMemoryStatus { + /** + * @return Current JVM maximum heap size in bytes + */ + long getMaxMemory(); + + /** + * @return Current JVM committed heap size in bytes + */ + long getCommittedMemory(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/process-services/org/gradle/process/internal/health/memory/NativeOsMemoryInfo.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/process-services/org/gradle/process/internal/health/memory/NativeOsMemoryInfo.java new file mode 100644 index 0000000..9784af7 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/process-services/org/gradle/process/internal/health/memory/NativeOsMemoryInfo.java @@ -0,0 +1,39 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.process.internal.health.memory; + +import net.rubygrapefruit.platform.Memory; +import net.rubygrapefruit.platform.MemoryInfo; +import net.rubygrapefruit.platform.NativeException; +import org.gradle.internal.nativeintegration.NativeIntegrationException; +import org.gradle.internal.nativeintegration.services.NativeServices; + +public class NativeOsMemoryInfo implements OsMemoryInfo { + + @Override + public OsMemoryStatus getOsSnapshot() { + try { + Memory memory = NativeServices.getInstance().get(Memory.class); + MemoryInfo memoryInfo = memory.getMemoryInfo(); + return new OsMemoryStatusSnapshot(memoryInfo.getTotalPhysicalMemory(), memoryInfo.getAvailablePhysicalMemory()); + } catch (NativeException ex) { + throw new UnsupportedOperationException("Unable to get system memory", ex); + } catch (NativeIntegrationException ex) { + throw new UnsupportedOperationException("Unable to get system memory", ex); + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/reporting/org/gradle/api/reporting/CustomizableHtmlReport.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/reporting/org/gradle/api/reporting/CustomizableHtmlReport.java new file mode 100644 index 0000000..cc09628 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/reporting/org/gradle/api/reporting/CustomizableHtmlReport.java @@ -0,0 +1,47 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.reporting; + +import org.gradle.api.resources.TextResource; +import org.gradle.api.tasks.Nested; +import org.gradle.api.tasks.Optional; + +import javax.annotation.Nullable; + +/** + * A HTML Report whose generation can be customized with a XSLT stylesheet. + */ +public interface CustomizableHtmlReport extends SingleFileReport { + + /** + * The stylesheet to use to generate the HTML report. + * + * @return the stylesheet to use to generate the HTML report + */ + @Nullable + @Optional + @Nested + TextResource getStylesheet(); + + /** + * The stylesheet to use to generate the report. + * + * @param stylesheet the stylesheet to use to generate the HTML report + */ + void setStylesheet(@Nullable TextResource stylesheet); + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/resources/org/gradle/internal/resource/local/PathKeyFileStore.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/resources/org/gradle/internal/resource/local/PathKeyFileStore.java new file mode 100644 index 0000000..105dab0 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/resources/org/gradle/internal/resource/local/PathKeyFileStore.java @@ -0,0 +1,27 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.resource.local; + +import javax.annotation.Nullable; + +/** + * File store that accepts the target path as the key for the entry. + */ +public interface PathKeyFileStore extends FileStore, FileStoreSearcher { + @Nullable + LocallyAvailableResource get(String... path); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/snapshots/org/gradle/internal/fingerprint/FileCollectionFingerprinterRegistry.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/snapshots/org/gradle/internal/fingerprint/FileCollectionFingerprinterRegistry.java new file mode 100644 index 0000000..aed061b --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/snapshots/org/gradle/internal/fingerprint/FileCollectionFingerprinterRegistry.java @@ -0,0 +1,23 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.fingerprint; + +import org.gradle.api.tasks.FileNormalizer; + +public interface FileCollectionFingerprinterRegistry { + FileCollectionFingerprinter getFingerprinter(Class type); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/snapshots/org/gradle/internal/isolation/Isolatable.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/snapshots/org/gradle/internal/isolation/Isolatable.java new file mode 100644 index 0000000..de1f952 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/snapshots/org/gradle/internal/isolation/Isolatable.java @@ -0,0 +1,44 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.isolation; + +import org.gradle.internal.hash.Hashable; + +import javax.annotation.Nullable; + +/** + * Isolatable objects can return an isolated instance of the given type T from which this object was created. + * An isolated instance has the same internal state as the original object on which this isolatable was based, + * but it is guaranteed not to retain any references to mutable state from the original instance. + *

+ * The primary reason to need such an isolated instance of an object is to ensure that work can be done in parallel using the instance without + * fear that it's internal state is changing while the work is being carried out. + */ +public interface Isolatable extends Hashable { + /** + * Returns an instance of T that is isolated from the original object. When T is mutable, a new instance is created on each call. When T is immutable, a new instance may or may not be created on each call. + */ + T isolate(); + + /** + * Returns an {@link Isolatable} that can produce values of the given type from this value, if possible. + * + * @return null if not supported. + */ + @Nullable + Isolatable coerce(Class type); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/snapshots/org/gradle/internal/snapshot/DirectorySnapshot.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/snapshots/org/gradle/internal/snapshot/DirectorySnapshot.java new file mode 100644 index 0000000..944cddd --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/snapshots/org/gradle/internal/snapshot/DirectorySnapshot.java @@ -0,0 +1,62 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.snapshot; + +import org.gradle.internal.file.FileType; +import org.gradle.internal.hash.HashCode; + +import java.util.List; + +/** + * A file snapshot which can have children (i.e. a directory). + */ +public class DirectorySnapshot extends AbstractFileSystemLocationSnapshot implements FileSystemLocationSnapshot { + private final List children; + private final HashCode contentHash; + + public DirectorySnapshot(String absolutePath, String name, List children, HashCode contentHash) { + super(absolutePath, name); + this.children = children; + this.contentHash = contentHash; + } + + @Override + public HashCode getHash() { + return contentHash; + } + + @Override + public FileType getType() { + return FileType.Directory; + } + + @Override + public boolean isContentAndMetadataUpToDate(FileSystemLocationSnapshot other) { + return other instanceof DirectorySnapshot; + } + + @Override + public void accept(FileSystemSnapshotVisitor visitor) { + if (!visitor.preVisitDirectory(this)) { + return; + } + for (FileSystemLocationSnapshot child : children) { + child.accept(visitor); + } + visitor.postVisitDirectory(this); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/snapshots/org/gradle/internal/snapshot/WellKnownFileLocations.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/snapshots/org/gradle/internal/snapshot/WellKnownFileLocations.java new file mode 100644 index 0000000..b481d21 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/snapshots/org/gradle/internal/snapshot/WellKnownFileLocations.java @@ -0,0 +1,25 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.snapshot; + +/** + * This service can tell whether a file is in a location controlled by Gradle, + * which usually allows for more optimization than user-provided files. + */ +public interface WellKnownFileLocations { + boolean isImmutable(String path); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/snapshots/org/gradle/internal/snapshot/impl/DefaultFileSystemMirror.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/snapshots/org/gradle/internal/snapshot/impl/DefaultFileSystemMirror.java new file mode 100644 index 0000000..a98e8d7 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/snapshots/org/gradle/internal/snapshot/impl/DefaultFileSystemMirror.java @@ -0,0 +1,106 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.snapshot.impl; + +import org.gradle.internal.file.FileMetadataSnapshot; +import org.gradle.internal.snapshot.FileSystemLocationSnapshot; +import org.gradle.internal.snapshot.FileSystemMirror; +import org.gradle.internal.snapshot.WellKnownFileLocations; + +import javax.annotation.Nullable; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +/** + * See {@link DefaultFileSystemSnapshotter} for some more details + */ +public class DefaultFileSystemMirror implements FileSystemMirror { + // Maps from interned absolute path for a file to metadata for the file. + private final Map metadata = new ConcurrentHashMap(); + private final Map cacheMetadata = new ConcurrentHashMap(); + // Maps from interned absolute path for a file to snapshot for the file. + private final Map files = new ConcurrentHashMap(); + private final Map cacheFiles = new ConcurrentHashMap(); + + private final WellKnownFileLocations wellKnownFileLocations; + + public DefaultFileSystemMirror(WellKnownFileLocations wellKnownFileLocations) { + this.wellKnownFileLocations = wellKnownFileLocations; + } + + @Nullable + @Override + public FileSystemLocationSnapshot getSnapshot(String absolutePath) { + // Could potentially also look whether we have the details for an ancestor directory tree + // Could possibly infer that the path refers to a directory, if we have details for a descendant path (and it's not a missing file) + if (wellKnownFileLocations.isImmutable(absolutePath)) { + return cacheFiles.get(absolutePath); + } + return files.get(absolutePath); + } + + @Override + public void putSnapshot(FileSystemLocationSnapshot snapshot) { + String absolutePath = snapshot.getAbsolutePath(); + if (wellKnownFileLocations.isImmutable(absolutePath)) { + cacheFiles.put(absolutePath, snapshot); + } else { + files.put(absolutePath, snapshot); + } + } + + @Override + public FileMetadataSnapshot getMetadata(String absolutePath) { + if (wellKnownFileLocations.isImmutable(absolutePath)) { + return cacheMetadata.get(absolutePath); + } + return metadata.get(absolutePath); + } + + @Override + public void putMetadata(String absolutePath, FileMetadataSnapshot metadata) { + if (wellKnownFileLocations.isImmutable(absolutePath)) { + cacheMetadata.put(absolutePath, metadata); + } else { + this.metadata.put(absolutePath, metadata); + } + } + + public void beforeOutputChange() { + // When the outputs are generated, throw away all state for files that do not live in an append-only cache. + // This is intentionally very simple, to be improved later + metadata.clear(); + files.clear(); + } + + public void beforeBuildFinished() { + // We throw away all state between builds + metadata.clear(); + cacheMetadata.clear(); + files.clear(); + cacheFiles.clear(); + } + + public void beforeOutputChange(Iterable affectedOutputPaths) { + for (String affectedOutputPath : affectedOutputPaths) { + metadata.remove(affectedOutputPath); + files.remove(affectedOutputPath); + cacheMetadata.remove(affectedOutputPath); + cacheFiles.remove(affectedOutputPath); + } + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/snapshots/org/gradle/internal/snapshot/package-info.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/snapshots/org/gradle/internal/snapshot/package-info.java new file mode 100644 index 0000000..5607d06 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/snapshots/org/gradle/internal/snapshot/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@NonNullApi +package org.gradle.internal.snapshot; + +import org.gradle.api.NonNullApi; diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/test-kit/org/gradle/testkit/runner/internal/io/NoCloseOutputStream.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/test-kit/org/gradle/testkit/runner/internal/io/NoCloseOutputStream.java new file mode 100644 index 0000000..1f5ebdf --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/test-kit/org/gradle/testkit/runner/internal/io/NoCloseOutputStream.java @@ -0,0 +1,49 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.testkit.runner.internal.io; + +import java.io.IOException; +import java.io.OutputStream; + +public class NoCloseOutputStream extends OutputStream { + + private final OutputStream delegate; + + public NoCloseOutputStream(OutputStream delegate) { + this.delegate = delegate; + } + + public synchronized void write(int b) throws IOException { + delegate.write(b); + } + + public synchronized void flush() throws IOException { + delegate.flush(); + } + + public synchronized void write(byte[] b, int off, int len) throws IOException { + delegate.write(b, off, len); + } + + public synchronized void write(byte[] b) throws IOException { + delegate.write(b); + } + + public synchronized void close() throws IOException { + // don't forward + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/testing-base/org/gradle/api/internal/tasks/testing/junit/result/TestOutputStore.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/testing-base/org/gradle/api/internal/tasks/testing/junit/result/TestOutputStore.java new file mode 100644 index 0000000..5f29af6 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/testing-base/org/gradle/api/internal/tasks/testing/junit/result/TestOutputStore.java @@ -0,0 +1,390 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.testing.junit.result; + +import com.esotericsoftware.kryo.io.Input; +import com.esotericsoftware.kryo.io.Output; +import com.google.common.collect.ImmutableMap; +import org.gradle.api.UncheckedIOException; +import org.gradle.api.tasks.testing.TestOutputEvent; +import org.gradle.internal.io.RandomAccessFileInputStream; +import org.gradle.internal.UncheckedException; +import org.gradle.internal.serialize.kryo.KryoBackedDecoder; +import org.gradle.internal.serialize.kryo.KryoBackedEncoder; + +import java.io.*; +import java.nio.charset.Charset; +import java.util.LinkedHashMap; +import java.util.Map; + +public class TestOutputStore { + + private final File resultsDir; + private final Charset messageStorageCharset; + + public TestOutputStore(File resultsDir) { + this.resultsDir = resultsDir; + this.messageStorageCharset = Charset.forName("UTF-8"); + } + + File getOutputsFile() { + return new File(resultsDir, "output.bin"); + } + + File getIndexFile() { + return new File(resultsDir, getOutputsFile().getName() + ".idx"); + } + + private static class Region { + long start; + long stop; + + private Region() { + start = -1; + stop = -1; + } + + private Region(long start, long stop) { + this.start = start; + this.stop = stop; + } + } + + private static class TestCaseRegion { + Region stdOutRegion = new Region(); + Region stdErrRegion = new Region(); + } + + public class Writer implements Closeable { + private final KryoBackedEncoder output; + + private final Map> index = new LinkedHashMap>(); + + public Writer() { + try { + output = new KryoBackedEncoder(new FileOutputStream(getOutputsFile())); + } catch (FileNotFoundException e) { + throw new UncheckedIOException(e); + } + } + + @Override + public void close() { + output.close(); + writeIndex(); + } + + public void onOutput(long classId, TestOutputEvent outputEvent) { + onOutput(classId, 0, outputEvent); + } + + public void onOutput(long classId, long testId, TestOutputEvent outputEvent) { + boolean stdout = outputEvent.getDestination() == TestOutputEvent.Destination.StdOut; + mark(classId, testId, stdout); + + output.writeBoolean(stdout); + output.writeSmallLong(classId); + output.writeSmallLong(testId); + + byte[] bytes; + try { + bytes = outputEvent.getMessage().getBytes(messageStorageCharset.name()); + } catch (UnsupportedEncodingException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + output.writeSmallInt(bytes.length); + output.writeBytes(bytes, 0, bytes.length); + } + + private void mark(long classId, long testId, boolean isStdout) { + if (!index.containsKey(classId)) { + index.put(classId, new LinkedHashMap()); + } + + Map testCaseRegions = index.get(classId); + if (!testCaseRegions.containsKey(testId)) { + TestCaseRegion region = new TestCaseRegion(); + testCaseRegions.put(testId, region); + } + + TestCaseRegion region = testCaseRegions.get(testId); + + Region streamRegion = isStdout ? region.stdOutRegion : region.stdErrRegion; + + long total = output.getWritePosition(); + if (streamRegion.start < 0) { + streamRegion.start = total; + } + streamRegion.stop = total; + } + + private void writeIndex() { + Output indexOutput; + try { + indexOutput = new Output(new FileOutputStream(getIndexFile())); + } catch (FileNotFoundException e) { + throw new UncheckedIOException(e); + } + + + try { + indexOutput.writeInt(index.size(), true); + + for (Map.Entry> classEntry : index.entrySet()) { + Long classId = classEntry.getKey(); + Map regions = classEntry.getValue(); + + indexOutput.writeLong(classId, true); + indexOutput.writeInt(regions.size(), true); + + for (Map.Entry testCaseEntry : regions.entrySet()) { + long id = testCaseEntry.getKey(); + TestCaseRegion region = testCaseEntry.getValue(); + indexOutput.writeLong(id, true); + indexOutput.writeLong(region.stdOutRegion.start); + indexOutput.writeLong(region.stdOutRegion.stop); + indexOutput.writeLong(region.stdErrRegion.start); + indexOutput.writeLong(region.stdErrRegion.stop); + } + } + } finally { + indexOutput.close(); + } + } + } + + public Writer writer() { + return new Writer(); + } + + private static class Index { + final ImmutableMap children; + final Region stdOut; + final Region stdErr; + + private Index(Region stdOut, Region stdErr) { + this.children = ImmutableMap.of(); + this.stdOut = stdOut; + this.stdErr = stdErr; + } + + private Index(ImmutableMap children, Region stdOut, Region stdErr) { + this.children = children; + this.stdOut = stdOut; + this.stdErr = stdErr; + } + } + + private static class IndexBuilder { + final Region stdOut = new Region(); + final Region stdErr = new Region(); + + private final ImmutableMap.Builder children = ImmutableMap.builder(); + + void add(long key, Index index) { + if (stdOut.start < 0) { + stdOut.start = index.stdOut.start; + } + if (stdErr.start < 0) { + stdErr.start = index.stdErr.start; + } + if (index.stdOut.stop > stdOut.stop) { + stdOut.stop = index.stdOut.stop; + } + if (index.stdErr.stop > stdErr.stop) { + stdErr.stop = index.stdErr.stop; + } + + children.put(key, index); + } + + Index build() { + return new Index(children.build(), stdOut, stdErr); + } + } + + public class Reader implements Closeable { + private final Index index; + private final RandomAccessFile dataFile; + + public Reader() { + File indexFile = getIndexFile(); + File outputsFile = getOutputsFile(); + + if (outputsFile.exists()) { + if (!indexFile.exists()) { + throw new IllegalStateException(String.format("Test outputs data file '%s' exists but the index file '%s' does not", outputsFile, indexFile)); + } + + Input input; + try { + input = new Input(new FileInputStream(indexFile)); + } catch (FileNotFoundException e) { + throw new UncheckedIOException(e); + } + + IndexBuilder rootBuilder = null; + try { + int numClasses = input.readInt(true); + rootBuilder = new IndexBuilder(); + + for (int classCounter = 0; classCounter < numClasses; ++classCounter) { + long classId = input.readLong(true); + IndexBuilder classBuilder = new IndexBuilder(); + + int numEntries = input.readInt(true); + for (int entryCounter = 0; entryCounter < numEntries; ++entryCounter) { + long testId = input.readLong(true); + Region stdOut = new Region(input.readLong(), input.readLong()); + Region stdErr = new Region(input.readLong(), input.readLong()); + classBuilder.add(testId, new Index(stdOut, stdErr)); + } + + rootBuilder.add(classId, classBuilder.build()); + } + } finally { + input.close(); + } + + index = rootBuilder.build(); + + try { + dataFile = new RandomAccessFile(getOutputsFile(), "r"); + } catch (FileNotFoundException e) { + throw new UncheckedIOException(e); + } + } else { // no outputs file + if (indexFile.exists()) { + throw new IllegalStateException(String.format("Test outputs data file '%s' does not exist but the index file '%s' does", outputsFile, indexFile)); + } + + index = null; + dataFile = null; + } + } + + @Override + public void close() throws IOException { + if (dataFile != null) { + dataFile.close(); + } + } + + public boolean hasOutput(long classId, TestOutputEvent.Destination destination) { + if (dataFile == null) { + return false; + } + + Index classIndex = index.children.get(classId); + if (classIndex == null) { + return false; + } else { + Region region = destination == TestOutputEvent.Destination.StdOut ? classIndex.stdOut : classIndex.stdErr; + return region.start >= 0; + } + } + + public void writeAllOutput(long classId, TestOutputEvent.Destination destination, java.io.Writer writer) { + doRead(classId, 0, true, destination, writer); + } + + public void writeNonTestOutput(long classId, TestOutputEvent.Destination destination, java.io.Writer writer) { + doRead(classId, 0, false, destination, writer); + } + + public void writeTestOutput(long classId, long testId, TestOutputEvent.Destination destination, java.io.Writer writer) { + doRead(classId, testId, false, destination, writer); + } + + private void doRead(long classId, long testId, boolean allClassOutput, TestOutputEvent.Destination destination, java.io.Writer writer) { + if (dataFile == null) { + return; + } + + Index targetIndex = index.children.get(classId); + if (targetIndex != null && testId != 0) { + targetIndex = targetIndex.children.get(testId); + } + + if (targetIndex == null) { + return; + } + + boolean stdout = destination == TestOutputEvent.Destination.StdOut; + Region region = stdout ? targetIndex.stdOut : targetIndex.stdErr; + + if (region.start < 0) { + return; + } + + boolean ignoreClassLevel = !allClassOutput && testId != 0; + boolean ignoreTestLevel = !allClassOutput && testId == 0; + + try { + dataFile.seek(region.start); + long maxPos = region.stop - region.start; + KryoBackedDecoder decoder = new KryoBackedDecoder(new RandomAccessFileInputStream(dataFile)); + while (decoder.getReadPosition() <= maxPos) { + boolean readStdout = decoder.readBoolean(); + long readClassId = decoder.readSmallLong(); + long readTestId = decoder.readSmallLong(); + int readLength = decoder.readSmallInt(); + + boolean isClassLevel = readTestId == 0; + + if (stdout != readStdout || classId != readClassId) { + decoder.skipBytes(readLength); + continue; + } + + if (ignoreClassLevel && isClassLevel) { + decoder.skipBytes(readLength); + continue; + } + + if (ignoreTestLevel && !isClassLevel) { + decoder.skipBytes(readLength); + continue; + } + + if (testId == 0 || testId == readTestId) { + byte[] stringBytes = new byte[readLength]; + decoder.readBytes(stringBytes); + String message; + try { + message = new String(stringBytes, messageStorageCharset.name()); + } catch (UnsupportedEncodingException e) { + // shouldn't happen + throw UncheckedException.throwAsUncheckedException(e); + } + + writer.write(message); + } else { + decoder.skipBytes(readLength); + } + } + } catch (IOException e1) { + throw new UncheckedIOException(e1); + } + } + } + + // IMPORTANT: return must be closed when done with. + public Reader reader() { + return new Reader(); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/testing-base/org/gradle/api/internal/tasks/testing/report/TestReporter.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/testing-base/org/gradle/api/internal/tasks/testing/report/TestReporter.java new file mode 100644 index 0000000..ecff6b6 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/testing-base/org/gradle/api/internal/tasks/testing/report/TestReporter.java @@ -0,0 +1,24 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.tasks.testing.report; + +import org.gradle.api.internal.tasks.testing.junit.result.TestResultsProvider; + +import java.io.File; + +public interface TestReporter { + void generateReport(TestResultsProvider testResultsProvider, File reportDir); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/testing-junit-platform/org/gradle/api/internal/tasks/testing/junitplatform/JUnitPlatformTestExecutionListener.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/testing-junit-platform/org/gradle/api/internal/tasks/testing/junitplatform/JUnitPlatformTestExecutionListener.java new file mode 100644 index 0000000..5c8f0fa --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/testing-junit-platform/org/gradle/api/internal/tasks/testing/junitplatform/JUnitPlatformTestExecutionListener.java @@ -0,0 +1,240 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.testing.junitplatform; + +import org.gradle.api.internal.tasks.testing.DefaultTestClassDescriptor; +import org.gradle.api.internal.tasks.testing.DefaultTestDescriptor; +import org.gradle.api.internal.tasks.testing.TestCompleteEvent; +import org.gradle.api.internal.tasks.testing.TestDescriptorInternal; +import org.gradle.api.internal.tasks.testing.TestResultProcessor; +import org.gradle.api.internal.tasks.testing.TestStartEvent; +import org.gradle.api.tasks.testing.TestResult.ResultType; +import org.gradle.internal.MutableBoolean; +import org.gradle.internal.id.IdGenerator; +import org.gradle.internal.time.Clock; +import org.junit.platform.engine.TestExecutionResult; +import org.junit.platform.engine.UniqueId; +import org.junit.platform.engine.support.descriptor.ClassSource; +import org.junit.platform.launcher.TestExecutionListener; +import org.junit.platform.launcher.TestIdentifier; +import org.junit.platform.launcher.TestPlan; + +import java.util.LinkedHashSet; +import java.util.Optional; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +import static org.gradle.api.internal.tasks.testing.junitplatform.VintageTestNameAdapter.isVintageDynamicLeafTest; +import static org.gradle.api.internal.tasks.testing.junitplatform.VintageTestNameAdapter.vintageDynamicClassName; +import static org.gradle.api.internal.tasks.testing.junitplatform.VintageTestNameAdapter.vintageDynamicMethodName; +import static org.gradle.api.tasks.testing.TestResult.ResultType.SKIPPED; +import static org.junit.platform.engine.TestDescriptor.Type.CONTAINER; +import static org.junit.platform.engine.TestExecutionResult.Status.ABORTED; +import static org.junit.platform.engine.TestExecutionResult.Status.FAILED; + +public class JUnitPlatformTestExecutionListener implements TestExecutionListener { + private final ConcurrentMap descriptorsByUniqueId = new ConcurrentHashMap<>(); + private final TestResultProcessor resultProcessor; + private final Clock clock; + private final IdGenerator idGenerator; + private TestPlan currentTestPlan; + + public JUnitPlatformTestExecutionListener(TestResultProcessor resultProcessor, Clock clock, IdGenerator idGenerator) { + this.resultProcessor = resultProcessor; + this.clock = clock; + this.idGenerator = idGenerator; + } + + @Override + public void testPlanExecutionStarted(TestPlan testPlan) { + this.currentTestPlan = testPlan; + } + + @Override + public void testPlanExecutionFinished(TestPlan testPlan) { + this.currentTestPlan = null; + this.descriptorsByUniqueId.clear(); + } + + @Override + public void executionSkipped(TestIdentifier testIdentifier, String reason) { + executionSkipped(testIdentifier); + } + + private void executionSkipped(TestIdentifier testIdentifier) { + executionStarted(testIdentifier); + reportSkipped(testIdentifier); + } + + @Override + public void executionStarted(TestIdentifier testIdentifier) { + if (testIdentifier.isTest() || isClass(testIdentifier)) { + reportStartedUnlessAlreadyStarted(testIdentifier); + } + } + + @Override + public void executionFinished(TestIdentifier testIdentifier, TestExecutionResult testExecutionResult) { + if (testExecutionResult.getStatus() == ABORTED) { + reportSkipped(testIdentifier); + return; + } + if (testExecutionResult.getStatus() == FAILED) { + reportStartedUnlessAlreadyStarted(testIdentifier); + Throwable failure = testExecutionResult.getThrowable().orElseGet(() -> new AssertionError("test failed but did not report an exception")); + if (testIdentifier.isTest()) { + resultProcessor.failure(getId(testIdentifier), failure); + } else { + TestDescriptorInternal syntheticTestDescriptor = createSyntheticTestDescriptorForContainer(testIdentifier); + resultProcessor.started(syntheticTestDescriptor, startEvent(getId(testIdentifier))); + resultProcessor.failure(syntheticTestDescriptor.getId(), failure); + resultProcessor.completed(syntheticTestDescriptor.getId(), completeEvent()); + } + } + if (wasStarted(testIdentifier)) { + resultProcessor.completed(getId(testIdentifier), completeEvent()); + } + } + + private void reportStartedUnlessAlreadyStarted(TestIdentifier testIdentifier) { + boolean wasNotAlreadyStarted = createDescriptorIfAbsent(testIdentifier); + // guard against edge cases (e.g. JUnit 4 classes with custom runners that report the class as ignored after reporting it as started) + if (wasNotAlreadyStarted) { + TestDescriptorInternal descriptor = descriptorsByUniqueId.get(testIdentifier.getUniqueId()); + resultProcessor.started(descriptor, startEvent(testIdentifier)); + } + } + + private void reportSkipped(TestIdentifier testIdentifier) { + currentTestPlan.getChildren(testIdentifier).forEach(child -> executionSkipped(child)); + if (testIdentifier.isTest()) { + resultProcessor.completed(getId(testIdentifier), completeEvent(SKIPPED)); + } else if (isClass(testIdentifier)) { + resultProcessor.completed(getId(testIdentifier), completeEvent()); + } + } + + private TestStartEvent startEvent(TestIdentifier testIdentifier) { + Object idOfClosestStartedAncestor = getAncestors(testIdentifier).stream() + .map(TestIdentifier::getUniqueId) + .filter(descriptorsByUniqueId::containsKey) + .findFirst() + .map(descriptorsByUniqueId::get) + .map(TestDescriptorInternal::getId) + .orElse(null); + return startEvent(idOfClosestStartedAncestor); + } + + private TestStartEvent startEvent(Object parentId) { + return new TestStartEvent(clock.getCurrentTime(), parentId); + } + + private TestCompleteEvent completeEvent() { + return completeEvent(null); + } + + private TestCompleteEvent completeEvent(ResultType resultType) { + return new TestCompleteEvent(clock.getCurrentTime(), resultType); + } + + private boolean wasStarted(TestIdentifier testIdentifier) { + return descriptorsByUniqueId.containsKey(testIdentifier.getUniqueId()); + } + + private boolean createDescriptorIfAbsent(TestIdentifier node) { + MutableBoolean wasCreated = new MutableBoolean(false); + descriptorsByUniqueId.computeIfAbsent(node.getUniqueId(), uniqueId -> { + wasCreated.set(true); + if (isVintageDynamicLeafTest(node)) { + UniqueId parsedUniqueId = UniqueId.parse(uniqueId); + return new DefaultTestDescriptor(idGenerator.generateId(), vintageDynamicClassName(parsedUniqueId), vintageDynamicMethodName(parsedUniqueId)); + } + if (node.getType() == CONTAINER || isClass(node)) { + TestIdentifier classIdentifier = findClassSource(node); + String className = className(classIdentifier); + String classDisplayName = classDisplayName(classIdentifier); + return new DefaultTestClassDescriptor(idGenerator.generateId(), className, classDisplayName); + } + return createTestDescriptor(node, node.getLegacyReportingName(), node.getDisplayName()); + }); + return wasCreated.get(); + } + + private TestDescriptorInternal createSyntheticTestDescriptorForContainer(TestIdentifier node) { + boolean testsStarted = currentTestPlan.getDescendants(node).stream().anyMatch(this::wasStarted); + String name = testsStarted ? "executionError": "initializationError"; + return createTestDescriptor(node, name, name); + } + + private TestDescriptorInternal createTestDescriptor(TestIdentifier test, String name, String displayName) { + TestIdentifier classIdentifier = findClassSource(test); + String className = className(classIdentifier); + String classDisplayName = classDisplayName(classIdentifier); + return new DefaultTestDescriptor(idGenerator.generateId(), className, name, classDisplayName, displayName); + } + + private Object getId(TestIdentifier testIdentifier) { + return descriptorsByUniqueId.get(testIdentifier.getUniqueId()).getId(); + } + + private Set getAncestors(TestIdentifier testIdentifier) { + Set result = new LinkedHashSet<>(); + Optional parentId = testIdentifier.getParentId(); + while (parentId.isPresent()) { + TestIdentifier parent = currentTestPlan.getTestIdentifier(parentId.get()); + result.add(parent); + parentId = parent.getParentId(); + } + return result; + } + + private boolean isClass(TestIdentifier test) { + return test.getSource().isPresent() && test.getSource().get() instanceof ClassSource; + } + + private TestIdentifier findClassSource(TestIdentifier testIdentifier) { + // For tests in default method of interface, + // we might not be able to get the implementation class directly. + // In this case, we need to retrieve test plan to get the real implementation class. + TestIdentifier current = testIdentifier; + while (current != null) { + if (isClass(current)) { + return current; + } + current = current.getParentId().map(currentTestPlan::getTestIdentifier).orElse(null); + } + return null; + } + + private String className(TestIdentifier testClassIdentifier) { + if (testClassIdentifier != null && isClass(testClassIdentifier)) { + return ((ClassSource) testClassIdentifier.getSource().get()).getClassName(); + } else { + return "UnknownClass"; + } + } + + private String classDisplayName(TestIdentifier testClassIdentifier) { + if (testClassIdentifier != null) { + return testClassIdentifier.getDisplayName(); + } else { + return "UnknownClass"; + } + } + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/ProgressEvent.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/ProgressEvent.java new file mode 100644 index 0000000..2acb4ed --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/ProgressEvent.java @@ -0,0 +1,30 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.tooling; + +/** + * Some information about a piece of work of a long running operation. + * @since 1.0-milestone-3 + */ +public interface ProgressEvent { + /** + * A description of the current piece of work. + * + * @return The description. + * @since 1.0-milestone-3 + */ + String getDescription(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/events/FinishEvent.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/events/FinishEvent.java new file mode 100644 index 0000000..a1bfe09 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/events/FinishEvent.java @@ -0,0 +1,33 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.events; + +/** + * An event that informs about an operation having finished its execution. + * + * @since 2.4 + */ +public interface FinishEvent extends ProgressEvent { + + /** + * Returns the result of the finished operation. + * + * @return the result of the finished operation + */ + OperationResult getResult(); + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/events/configuration/ProjectConfigurationProgressEvent.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/events/configuration/ProjectConfigurationProgressEvent.java new file mode 100644 index 0000000..e121015 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/events/configuration/ProjectConfigurationProgressEvent.java @@ -0,0 +1,36 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.events.configuration; + +import org.gradle.api.Incubating; +import org.gradle.tooling.events.ProgressEvent; + +/** + * Root interface for all events that signal progress while configuring a project. + * + * @since 5.1 + */ +@Incubating +public interface ProjectConfigurationProgressEvent extends ProgressEvent { + /** + * Returns the description of the project configuration operation for which progress is reported. + * + * @return The description of the underlying project configuration operation. + */ + @Override + ProjectConfigurationOperationDescriptor getDescriptor(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/events/transform/TransformFinishEvent.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/events/transform/TransformFinishEvent.java new file mode 100644 index 0000000..ead87b3 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/events/transform/TransformFinishEvent.java @@ -0,0 +1,29 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.events.transform; + +import org.gradle.api.Incubating; +import org.gradle.tooling.events.FinishEvent; + +/** + * An event that informs about a transform operation having finished its execution. + * + * @since 5.1 + */ +@Incubating +public interface TransformFinishEvent extends TransformProgressEvent, FinishEvent { +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/internal/consumer/async/DefaultAsyncConsumerActionExecutor.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/internal/consumer/async/DefaultAsyncConsumerActionExecutor.java new file mode 100644 index 0000000..0d48df2 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/internal/consumer/async/DefaultAsyncConsumerActionExecutor.java @@ -0,0 +1,66 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.tooling.internal.consumer.async; + +import org.gradle.internal.concurrent.CompositeStoppable; +import org.gradle.internal.concurrent.ExecutorFactory; +import org.gradle.internal.concurrent.ServiceLifecycle; +import org.gradle.internal.concurrent.ManagedExecutor; +import org.gradle.tooling.internal.consumer.connection.ConsumerAction; +import org.gradle.tooling.internal.consumer.connection.ConsumerActionExecutor; +import org.gradle.tooling.internal.protocol.ResultHandlerVersion1; + +/** + * Adapts a {@link ConsumerActionExecutor} to an {@link AsyncConsumerActionExecutor}. + */ +public class DefaultAsyncConsumerActionExecutor implements AsyncConsumerActionExecutor { + private final ConsumerActionExecutor actionExecutor; + private final ManagedExecutor executor; + private final ServiceLifecycle lifecycle; + + public DefaultAsyncConsumerActionExecutor(ConsumerActionExecutor actionExecutor, ExecutorFactory executorFactory) { + this.actionExecutor = actionExecutor; + executor = executorFactory.create("Connection worker"); + lifecycle = new ServiceLifecycle(actionExecutor.getDisplayName()); + } + + public String getDisplayName() { + return actionExecutor.getDisplayName(); + } + + public void stop() { + CompositeStoppable.stoppable(lifecycle, executor, actionExecutor).stop(); + } + + public void run(final ConsumerAction action, final ResultHandlerVersion1 handler) { + lifecycle.use(new Runnable() { + public void run() { + executor.execute(new Runnable() { + public void run() { + T result; + try { + result = actionExecutor.run(action); + } catch (Throwable t) { + handler.onFailure(t); + return; + } + handler.onComplete(result); + } + }); + } + }); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/internal/consumer/connection/AbstractConsumerConnection.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/internal/consumer/connection/AbstractConsumerConnection.java new file mode 100644 index 0000000..cfa75b4 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/internal/consumer/connection/AbstractConsumerConnection.java @@ -0,0 +1,74 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.consumer.connection; + +import org.gradle.tooling.BuildAction; +import org.gradle.tooling.internal.consumer.PhasedBuildAction; +import org.gradle.tooling.internal.consumer.ConnectionParameters; +import org.gradle.tooling.internal.consumer.TestExecutionRequest; +import org.gradle.tooling.internal.consumer.parameters.ConsumerOperationParameters; +import org.gradle.tooling.internal.consumer.versioning.VersionDetails; +import org.gradle.tooling.internal.protocol.ConnectionVersion4; +import org.gradle.tooling.model.internal.Exceptions; + +public abstract class AbstractConsumerConnection extends HasCompatibilityMapping implements ConsumerConnection { + private final ConnectionVersion4 delegate; + private final VersionDetails providerMetaData; + + public AbstractConsumerConnection(ConnectionVersion4 delegate, VersionDetails providerMetaData) { + this.delegate = delegate; + this.providerMetaData = providerMetaData; + } + + public void stop() { + } + + public String getDisplayName() { + return delegate.getMetaData().getDisplayName(); + } + + public VersionDetails getVersionDetails() { + return providerMetaData; + } + + public ConnectionVersion4 getDelegate() { + return delegate; + } + + public abstract void configure(ConnectionParameters connectionParameters); + + protected abstract ModelProducer getModelProducer(); + + protected abstract ActionRunner getActionRunner(); + + public T run(Class type, ConsumerOperationParameters operationParameters) { + return getModelProducer().produceModel(type, operationParameters); + } + + public T run(BuildAction action, ConsumerOperationParameters operationParameters) { + return getActionRunner().run(action, operationParameters); + } + + public void run(PhasedBuildAction phasedBuildAction, ConsumerOperationParameters operationParameters) { + throw Exceptions.unsupportedFeature(operationParameters.getEntryPointName(), getVersionDetails().getVersion(), "4.8"); + } + + public void runTests(final TestExecutionRequest testExecutionRequest, ConsumerOperationParameters operationParameters) { + throw Exceptions.unsupportedFeature(operationParameters.getEntryPointName(), getVersionDetails().getVersion(), "2.6"); + } + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/internal/consumer/connection/CancellableModelBuilderBackedModelProducer.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/internal/consumer/connection/CancellableModelBuilderBackedModelProducer.java new file mode 100644 index 0000000..0bea4c4 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/internal/consumer/connection/CancellableModelBuilderBackedModelProducer.java @@ -0,0 +1,61 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.consumer.connection; + +import org.gradle.api.Transformer; +import org.gradle.tooling.internal.adapter.ProtocolToModelAdapter; +import org.gradle.tooling.internal.consumer.parameters.BuildCancellationTokenAdapter; +import org.gradle.tooling.internal.consumer.parameters.ConsumerOperationParameters; +import org.gradle.tooling.internal.consumer.versioning.ModelMapping; +import org.gradle.tooling.internal.consumer.versioning.VersionDetails; +import org.gradle.tooling.internal.protocol.BuildResult; +import org.gradle.tooling.internal.protocol.InternalCancellableConnection; +import org.gradle.tooling.internal.protocol.InternalUnsupportedModelException; +import org.gradle.tooling.internal.protocol.ModelIdentifier; +import org.gradle.tooling.model.internal.Exceptions; + +public class CancellableModelBuilderBackedModelProducer extends HasCompatibilityMapping implements ModelProducer { + protected final ProtocolToModelAdapter adapter; + protected final VersionDetails versionDetails; + protected final ModelMapping modelMapping; + private final InternalCancellableConnection builder; + protected final Transformer exceptionTransformer; + + public CancellableModelBuilderBackedModelProducer(ProtocolToModelAdapter adapter, VersionDetails versionDetails, ModelMapping modelMapping, InternalCancellableConnection builder, Transformer exceptionTransformer) { + this.adapter = adapter; + this.versionDetails = versionDetails; + this.modelMapping = modelMapping; + this.builder = builder; + this.exceptionTransformer = exceptionTransformer; + } + + public T produceModel(Class type, ConsumerOperationParameters operationParameters) { + if (!versionDetails.maySupportModel(type)) { + throw Exceptions.unsupportedModel(type, versionDetails.getVersion()); + } + final ModelIdentifier modelIdentifier = modelMapping.getModelIdentifierFromModelType(type); + BuildResult result; + try { + result = builder.getModel(modelIdentifier, new BuildCancellationTokenAdapter(operationParameters.getCancellationToken()), operationParameters); + } catch (InternalUnsupportedModelException e) { + throw Exceptions.unknownModel(type, e); + } catch (RuntimeException e) { + throw exceptionTransformer.transform(e); + } + return applyCompatibilityMapping(adapter.builder(type), operationParameters).build(result.getModel()); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/internal/consumer/connection/NoToolingApiConnection.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/internal/consumer/connection/NoToolingApiConnection.java new file mode 100644 index 0000000..29d7f30 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/internal/consumer/connection/NoToolingApiConnection.java @@ -0,0 +1,62 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.consumer.connection; + +import org.gradle.tooling.BuildAction; +import org.gradle.tooling.internal.consumer.PhasedBuildAction; +import org.gradle.tooling.internal.consumer.Distribution; +import org.gradle.tooling.internal.consumer.TestExecutionRequest; +import org.gradle.tooling.internal.consumer.parameters.ConsumerOperationParameters; +import org.gradle.tooling.model.internal.Exceptions; + +/** + * A {@code ConsumerConnection} implementation for a Gradle version that does not support the tooling API. + * + *

Used for versions < 1.0-milestone-3.

+ */ +public class NoToolingApiConnection implements ConsumerConnection { + private final Distribution distribution; + + public NoToolingApiConnection(Distribution distribution) { + this.distribution = distribution; + } + + public void stop() { + } + + public String getDisplayName() { + return distribution.getDisplayName(); + } + + public T run(Class type, ConsumerOperationParameters operationParameters) throws UnsupportedOperationException, IllegalStateException { + throw Exceptions.unsupportedFeature(operationParameters.getEntryPointName(), distribution, "1.2"); + } + + public T run(BuildAction action, ConsumerOperationParameters operationParameters) throws UnsupportedOperationException, IllegalStateException { + throw Exceptions.unsupportedFeature(operationParameters.getEntryPointName(), distribution, "1.8"); + } + + @Override + public void run(PhasedBuildAction phasedBuildAction, ConsumerOperationParameters operationParameters) { + throw Exceptions.unsupportedFeature(operationParameters.getEntryPointName(), distribution, "4.8"); + } + + public void runTests(TestExecutionRequest testExecutionRequest, ConsumerOperationParameters operationParameters) { + throw Exceptions.unsupportedFeature(operationParameters.getEntryPointName(), distribution, "2.6"); + } + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/internal/consumer/connection/TestExecutionConsumerConnection.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/internal/consumer/connection/TestExecutionConsumerConnection.java new file mode 100644 index 0000000..499f60e --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/internal/consumer/connection/TestExecutionConsumerConnection.java @@ -0,0 +1,41 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.consumer.connection; + +import org.gradle.tooling.internal.adapter.ProtocolToModelAdapter; +import org.gradle.tooling.internal.consumer.parameters.BuildCancellationTokenAdapter; +import org.gradle.tooling.internal.consumer.parameters.ConsumerOperationParameters; +import org.gradle.tooling.internal.consumer.versioning.ModelMapping; +import org.gradle.tooling.internal.protocol.ConnectionVersion4; +import org.gradle.tooling.internal.protocol.test.InternalTestExecutionConnection; +import org.gradle.tooling.internal.consumer.TestExecutionRequest; + +/** + *

Used for providers >= 2.6.

+ */ +public class TestExecutionConsumerConnection extends ShutdownAwareConsumerConnection { + + public TestExecutionConsumerConnection(ConnectionVersion4 delegate, ModelMapping modelMapping, ProtocolToModelAdapter adapter) { + super(delegate, modelMapping, adapter); + } + + @Override + public void runTests(final TestExecutionRequest testExecutionRequest, ConsumerOperationParameters operationParameters) { + final BuildCancellationTokenAdapter cancellationTokenAdapter = new BuildCancellationTokenAdapter(operationParameters.getCancellationToken()); + ((InternalTestExecutionConnection) getDelegate()).runTests(testExecutionRequest, cancellationTokenAdapter, operationParameters); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/model/UnsupportedMethodException.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/model/UnsupportedMethodException.java new file mode 100644 index 0000000..7a8707d --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/model/UnsupportedMethodException.java @@ -0,0 +1,37 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.model; + +/** + * Thrown when the tooling API client attempts to use a method that does not exist + * in the version of Gradle that the tooling API is connected to. + *

+ * Typically, to resolve such a problem you change/upgrade the target version of Gradle that + * the tooling API is connected to. Alternatively, you can handle and ignore this exception. + * + * @since 1.0-milestone-8 + */ +public class UnsupportedMethodException extends UnsupportedOperationException { + + public UnsupportedMethodException(String s) { + super(s); + } + + public UnsupportedMethodException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/model/idea/IdeaModuleIdentifier.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/model/idea/IdeaModuleIdentifier.java new file mode 100644 index 0000000..9295033 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/model/idea/IdeaModuleIdentifier.java @@ -0,0 +1,24 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.tooling.model.idea; + +/** + * Identifies an Idea module. + * + * @since 2.14 + */ +public interface IdeaModuleIdentifier { +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/model/idea/IdeaSingleEntryLibraryDependency.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/model/idea/IdeaSingleEntryLibraryDependency.java new file mode 100644 index 0000000..79823a6 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/model/idea/IdeaSingleEntryLibraryDependency.java @@ -0,0 +1,52 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.model.idea; + +import org.gradle.tooling.model.ExternalDependency; + +import javax.annotation.Nullable; +import java.io.File; + +/** + * "Single-Entry Module Library" as IDEA calls it. For example a single Jar file with sources Jar. + * + * @since 1.0-milestone-5 + */ +public interface IdeaSingleEntryLibraryDependency extends IdeaDependency, ExternalDependency { + /** + * Returns the file for this dependency. + * + * @return The file. Never null. + */ + File getFile(); + + /** + * Returns the source directory/archive for this dependency. + * + * @return The source file. Returns null when the source is not available for this dependency. + */ + @Nullable + File getSource(); + + /** + * Returns the Javadoc directory/archive for this dependency. + * + * @return The Javadoc file. Returns null when the Javadoc is not available for this dependency. + */ + @Nullable + File getJavadoc(); +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/model/internal/outcomes/GradleFileBuildOutcome.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/model/internal/outcomes/GradleFileBuildOutcome.java new file mode 100644 index 0000000..3be3b50 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/tooling-api/org/gradle/tooling/model/internal/outcomes/GradleFileBuildOutcome.java @@ -0,0 +1,52 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.model.internal.outcomes; + +import javax.annotation.Nullable; +import java.io.File; + +/** + * A build outcome, that is represented as a file. + * + * @since 1.2 + */ +public interface GradleFileBuildOutcome extends GradleBuildOutcome { + + /** + * The file, were it was produced by the build. + * + * May be a file or a directory. + * + * @return The file. + */ + File getFile(); + + /** + * A canonical identifier for what the outcome is. + * + * The string is free form, but there is expected to be agreement between the + * server and client about the values. For example, the {@link #getFile()} may have any file extension + * while the “type identifier” is “zip” to convey that it is a zip file. + * + * If the value is {@code null}, A type identifier could not be determined. + * + * @return The unique type identifier for the file. + */ + @Nullable + String getTypeIdentifier(); + +} diff --git a/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/version-control/org/gradle/vcs/internal/VcsMappingInternal.java b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/version-control/org/gradle/vcs/internal/VcsMappingInternal.java new file mode 100644 index 0000000..db90ad1 --- /dev/null +++ b/wrapper/dists/gradle-5.1.1-all/97z1ksx6lirer3kbvdnh7jtjg/gradle-5.1.1/src/version-control/org/gradle/vcs/internal/VcsMappingInternal.java @@ -0,0 +1,27 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.vcs.internal; + +import org.gradle.vcs.VcsMapping; +import org.gradle.vcs.VersionControlSpec; + +public interface VcsMappingInternal extends VcsMapping { + + VersionControlSpec getRepository(); + + boolean hasRepository(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.api.NamedDomainObjectCollection.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.api.NamedDomainObjectCollection.html new file mode 100644 index 0000000..12076e8 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.api.NamedDomainObjectCollection.html @@ -0,0 +1,45 @@ + +NamedDomainObjectCollection - Gradle DSL Version 6.7.1

NamedDomainObjectCollection

API Documentation:NamedDomainObjectCollection
Known Subtypes:
NamedDomainObjectSet

A NamedDomainObjectCollection represents a collection of objects that have an inherent, constant, name.

Objects to be added to a named domain object collection must implement equals() in such a way that no two objects +with different names are considered equal. That is, all equality tests must consider the name as an +equality key. Behavior is undefined if two objects with different names are considered equal by their equals() implementation.

All implementations must guarantee that all elements in the collection are uniquely named. That is, +an attempt to add an object with a name equal to the name of any existing object in the collection will fail. +Implementations may choose to simply return false from add(T) or to throw an exception.

Objects in the collection are accessible as read-only properties, using the name of the object +as the property name. For example (assuming the 'name' property provides the object name):

+books.add(new Book(name: "gradle", title: null))
+books.gradle.title = "Gradle in Action"
+

A dynamic method is added for each object which takes a configuration closure. This is equivalent to calling +NamedDomainObjectCollection.getByName(java.lang.String, groovy.lang.Closure). For example:

+books.add(new Book(name: "gradle", title: null))
+books.gradle {
+  title = "Gradle in Action"
+}
+

You can also use the [] operator to access the objects of a collection by name. For example:

+books.add(new Book(name: "gradle", title: null))
+books['gradle'].title = "Gradle in Action"
+

Rule objects can be attached to the collection in order to respond to requests for objects by name +where no object with name exists in the collection. This mechanism can be used to create objects on demand. +For example:

+books.addRule('create any') { books.add(new Book(name: "gradle", title: null)) }
+books.gradle.name == "gradle"
+

Properties

No properties

Methods

MethodDescription
getByName(name)

Locates an object by name, failing if there is no such object.

getByName(name, configureClosure)

Locates an object by name, failing if there is no such object. The given configure closure is executed against +the object before it is returned from this method. The object is passed to the closure as its delegate.

getByName(name, configureAction)

Locates an object by name, failing if there is no such object. The given configure action is executed against +the object before it is returned from this method.

named(name)

Locates a object by name, without triggering its creation or configuration, failing if there is no such object.

named(name, type)

Locates a object by name and type, without triggering its creation or configuration, failing if there is no such object.

named(name, type, configurationAction)

Locates a object by name and type, without triggering its creation or configuration, failing if there is no such object. +The given configure action is executed against the object before it is returned from the provider.

named(name, configurationAction)

Locates a object by name, without triggering its creation or configuration, failing if there is no such object. +The given configure action is executed against the object before it is returned from the provider.

Script blocks

No script blocks

Method details

T getByName(String name)

Locates an object by name, failing if there is no such object.

T getByName(String name, Closure configureClosure)

Locates an object by name, failing if there is no such object. The given configure closure is executed against +the object before it is returned from this method. The object is passed to the closure as its delegate.

T getByName(String name, Action<? super T> configureAction)

Locates an object by name, failing if there is no such object. The given configure action is executed against +the object before it is returned from this method.

Locates a object by name, without triggering its creation or configuration, failing if there is no such object.

NamedDomainObjectProvider<S> named(String name, Class<S> type)

Locates a object by name and type, without triggering its creation or configuration, failing if there is no such object.

NamedDomainObjectProvider<S> named(String name, Class<S> type, Action<? super S> configurationAction)

Locates a object by name and type, without triggering its creation or configuration, failing if there is no such object. +The given configure action is executed against the object before it is returned from the provider.

NamedDomainObjectProvider<T> named(String name, Action<? super T> configurationAction)

Locates a object by name, without triggering its creation or configuration, failing if there is no such object. +The given configure action is executed against the object before it is returned from the provider.

\ No newline at end of file diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.api.plugins.quality.CodeNarcExtension.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.api.plugins.quality.CodeNarcExtension.html new file mode 100644 index 0000000..0520a44 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.api.plugins.quality.CodeNarcExtension.html @@ -0,0 +1,19 @@ + +CodeNarcExtension - Gradle DSL Version 6.7.1

CodeNarcExtension

API Documentation:CodeNarcExtension

Configuration options for the CodeNarc plugin.

Properties

PropertyDescription
config

The CodeNarc configuration to use. Replaces the configFile property.

configFile

The CodeNarc configuration file to use.

ignoreFailures

Whether to allow the build to continue if there are warnings. + +Example: ignoreFailures = true

maxPriority1Violations

The maximum number of priority 1 violations allowed before failing the build.

maxPriority2Violations

The maximum number of priority 2 violations allowed before failing the build.

maxPriority3Violations

The maximum number of priority 3 violations allowed before failing the build.

reportFormat

The format type of the CodeNarc report. One of html, xml, text, console.

reportsDir

The directory where reports will be generated.

sourceSets

The source sets to be analyzed as part of the check and build tasks.

toolVersion

The version of the code quality tool to be used.

Methods

No methods

Script blocks

No script blocks

Property details

The CodeNarc configuration to use. Replaces the configFile property.

Default with codenarc plugin:
${project.projectDir}/config/codenarc/codenarc.xml

File configFile

The CodeNarc configuration file to use.

Default with codenarc plugin:
${project.projectDir}/config/codenarc/codenarc.xml

boolean ignoreFailures

Whether to allow the build to continue if there are warnings. + +Example: ignoreFailures = true

Default:
false

int maxPriority1Violations

The maximum number of priority 1 violations allowed before failing the build.

Default with codenarc plugin:
0

int maxPriority2Violations

The maximum number of priority 2 violations allowed before failing the build.

Default with codenarc plugin:
0

int maxPriority3Violations

The maximum number of priority 3 violations allowed before failing the build.

Default with codenarc plugin:
0

String reportFormat

The format type of the CodeNarc report. One of html, xml, text, console.

Default with codenarc plugin:
html

File reportsDir

The directory where reports will be generated.

Collection<SourceSet> sourceSets

The source sets to be analyzed as part of the check and build tasks.

Default:
project.sourceSets

String toolVersion

The version of the code quality tool to be used.

\ No newline at end of file diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.api.tasks.bundling.War.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.api.tasks.bundling.War.html new file mode 100644 index 0000000..58a6145 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.api.tasks.bundling.War.html @@ -0,0 +1,250 @@ + +War - Gradle DSL Version 6.7.1

War

API Documentation:War

Assembles a WAR archive.

Properties

PropertyDescription
appendix
Deprecated
Replaced

The appendix part of the archive name, if any.

archiveAppendix

The appendix part of the archive name, if any.

archiveBaseName

The base name of the archive.

archiveClassifier

The classifier part of the archive name, if any.

archiveExtension

The extension part of the archive name.

archiveFile

The RegularFile where the archive is constructed. +The path is simply the destinationDirectory plus the archiveFileName.

archiveFileName

The archive name. If the name has not been explicitly set, the pattern for the name is: +[archiveBaseName]-[archiveAppendix]-[archiveVersion]-[archiveClassifier].[archiveExtension]

archiveName
Deprecated
Replaced

The archive name. If the name has not been explicitly set, the pattern for the name is: +[archiveBaseName]-[archiveAppendix]-[archiveVersion]-[archiveClassifier].[archiveExtension]

archivePath
Deprecated
Replaced

The path where the archive is constructed. The path is simply the destinationDirectory plus the archiveFileName.

archiveVersion

The version part of the archive name.

baseName
Deprecated
Replaced

The base name of the archive.

caseSensitive

Specifies whether case-sensitive pattern matching should be used.

classifier
Deprecated
Replaced

The classifier part of the archive name, if any.

classpath

The classpath to include in the WAR archive. Any JAR or ZIP files in this classpath are included in the WEB-INF/lib directory. Any directories in this classpath are included in +the WEB-INF/classes directory.

destinationDir
Deprecated
Replaced

The directory where the archive is generated into.

destinationDirectory

The directory where the archive will be placed.

dirMode

The Unix permissions to use for the target directories. null means that existing +permissions are preserved. It is dependent on the copy action implementation whether these permissions +will actually be applied.

duplicatesStrategy

The strategy to use when trying to copy more than one file to the same destination. +

entryCompression

The compression level of the entries of the archive. If set to ZipEntryCompression.DEFLATED (the default), each entry is +compressed using the DEFLATE algorithm. If set to ZipEntryCompression.STORED the entries of the archive are left uncompressed.

excludes

The set of exclude patterns.

extension
Deprecated
Replaced

The extension part of the archive name.

fileMode

The Unix permissions to use for the target files. null means that existing +permissions are preserved. It is dependent on the copy action implementation whether these permissions +will actually be applied.

includeEmptyDirs

Tells if empty target directories will be included in the copy.

includes

The set of include patterns.

manifest

The manifest for this JAR archive.

metadataCharset

The character set used to encode JAR metadata like file names. +Defaults to UTF-8. +You can change this property but it is not recommended as JVMs expect JAR metadata to be encoded using UTF-8

preserveFileTimestamps

Specifies whether file timestamps should be preserved in the archive. +

reproducibleFileOrder

Specifies whether to enforce a reproducible file order when reading files from directories. +

source

The source files for this task.

version
Deprecated
Replaced

The version part of the archive name, if any.

webXml

The web.xml file to include in the WAR archive. When null, no web.xml file is included in the WAR.

zip64

Whether the zip can contain more than 65535 files and/or support files greater than 4GB in size. +

Methods

MethodDescription
classpath(classpath)

Adds files to the classpath to include in the WAR archive.

eachFile(closure)

Adds an action to be applied to each file as it about to be copied into its destination. The given closure is +called with a FileCopyDetails as its parameter. Actions are executed in the order +added, and are inherited from the parent spec.

eachFile(action)

Adds an action to be applied to each file as it is about to be copied into its destination. The action can change +the destination path of the file, filter the contents of the file, or exclude the file from the result entirely. +Actions are executed in the order added, and are inherited from the parent spec.

exclude(excludeSpec)

Adds an exclude spec. This method may be called multiple times to append new specs.The given closure is passed a +FileTreeElement as its parameter. The closure should return true or false. Example: + +

exclude(excludes)

Adds an ANT style exclude pattern. This method may be called multiple times to append new patterns and multiple +patterns may be specified in a single call. + +If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match +any exclude pattern to be processed.

exclude(excludes)

Adds an ANT style exclude pattern. This method may be called multiple times to append new patterns and multiple +patterns may be specified in a single call. + +If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match +any exclude pattern to be processed.

exclude(excludeSpec)

Adds an exclude spec. This method may be called multiple times to append new specs. + +If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match +any exclude pattern to be processed.

expand(properties)

Expands property references in each file as it is copied. More specifically, each file is transformed using +Groovy's SimpleTemplateEngine. This means you can use simple property references, such as +$property or ${property} in the file. You can also include arbitrary Groovy code in the +file, such as ${version ?: 'unknown'} or ${classpath*.name.join(' ')}

filesMatching(patterns, action)

Configure the FileCopyDetails for each file whose path matches any of the specified Ant-style patterns. +This is equivalent to using eachFile() and selectively applying a configuration based on the file's path.

filesMatching(pattern, action)

Configure the FileCopyDetails for each file whose path matches the specified Ant-style pattern. +This is equivalent to using eachFile() and selectively applying a configuration based on the file's path.

filesNotMatching(patterns, action)

Configure the FileCopyDetails for each file whose path does not match any of the specified +Ant-style patterns. This is equivalent to using eachFile() and selectively applying a configuration based on the +file's path.

filesNotMatching(pattern, action)

Configure the FileCopyDetails for each file whose path does not match the specified +Ant-style pattern. This is equivalent to using eachFile() and selectively applying a configuration based on the +file's path.

filter(closure)

Adds a content filter based on the provided closure. The Closure will be called with each line (stripped of line +endings) and should return a String to replace the line or null to remove the line. If every line is +removed, the result will be an empty file, not an absent one.

filter(filterType)

Adds a content filter to be used during the copy. Multiple calls to filter, add additional filters to the +filter chain. Each filter should implement java.io.FilterReader. Include org.apache.tools.ant.filters.* for access to all the standard Ant filters.

filter(properties, filterType)

Adds a content filter to be used during the copy. Multiple calls to filter, add additional filters to the +filter chain. Each filter should implement java.io.FilterReader. Include org.apache.tools.ant.filters.* for access to all the standard Ant filters.

filter(transformer)

Adds a content filter based on the provided transformer. The Closure will be called with each line (stripped of line +endings) and should return a String to replace the line or null to remove the line. If every line is +removed, the result will be an empty file, not an absent one.

from(sourcePath, c)

Specifies the source files or directories for a copy and creates a child CopySourceSpec. The given source +path is evaluated as per Project.files(java.lang.Object[]) .

from(sourcePath, configureAction)

Specifies the source files or directories for a copy and creates a child CopySpec. The given source +path is evaluated as per Project.files(java.lang.Object[]) .

from(sourcePaths)

Specifies source files or directories for a copy. The given paths are evaluated as per Project.files(java.lang.Object[]).

include(includeSpec)

Adds an include spec. This method may be called multiple times to append new specs. The given closure is passed a +FileTreeElement as its parameter. + +If includes are not provided, then all files in this container will be included. If includes are provided, then a +file must match at least one of the include patterns or specs to be included.

include(includes)

Adds an ANT style include pattern. This method may be called multiple times to append new patterns and multiple +patterns may be specified in a single call. + +If includes are not provided, then all files in this container will be included. If includes are provided, then a +file must match at least one of the include patterns to be processed.

include(includes)

Adds an ANT style include pattern. This method may be called multiple times to append new patterns and multiple +patterns may be specified in a single call. + +If includes are not provided, then all files in this container will be included. If includes are provided, then a +file must match at least one of the include patterns to be processed.

include(includeSpec)

Adds an include spec. This method may be called multiple times to append new specs. + +If includes are not provided, then all files in this container will be included. If includes are provided, then a +file must match at least one of the include patterns or specs to be included.

into(destPath)

Specifies the destination directory *inside* the archive for the files. +The destination is evaluated as per Project.file(java.lang.Object). +Don't mix it up with AbstractArchiveTask.getDestinationDirectory() which specifies the output directory for the archive.

into(destPath, configureClosure)

Creates and configures a child CopySpec with a destination directory *inside* the archive for the files. +The destination is evaluated as per Project.file(java.lang.Object). +Don't mix it up with AbstractArchiveTask.getDestinationDirectory() which specifies the output directory for the archive.

into(destPath, copySpec)

Creates and configures a child CopySpec with a destination directory *inside* the archive for the files. +The destination is evaluated as per Project.file(java.lang.Object). +Don't mix it up with AbstractArchiveTask.getDestinationDirectory() which specifies the output directory for the archive.

manifest(configureClosure)

Configures the manifest for this JAR archive. + +

manifest(configureAction)

Configures the manifest for this JAR archive. + +

metaInf(configureClosure)

Adds content to this JAR archive's META-INF directory. + +

metaInf(configureAction)

Adds content to this JAR archive's META-INF directory. + +

rename(closure)

Renames a source file. The closure will be called with a single parameter, the name of the file. +The closure should return a String object with a new target name. The closure may return null, +in which case the original name will be used.

rename(sourceRegEx, replaceWith)

Renames files based on a regular expression. Uses java.util.regex type of regular expressions. Note that the +replace string should use the '$1' syntax to refer to capture groups in the source regular expression. Files +that do not match the source regular expression will be copied with the original name. + +

rename(sourceRegEx, replaceWith)

Renames files based on a regular expression. See CopyProcessingSpec.rename(java.lang.String, java.lang.String).

rename(renamer)

Renames a source file. The function will be called with a single parameter, the name of the file. +The function should return a new target name. The function may return null, +in which case the original name will be used.

webInf(configureClosure)

Adds some content to the WEB-INF directory for this WAR archive. + +

webInf(configureAction)

Adds some content to the WEB-INF directory for this WAR archive. + +

with(sourceSpecs)

Adds the given specs as a child of this spec. + +

Script blocks

No script blocks

Property details

String appendix

Note: This property is deprecated and will be removed in the next major version of Gradle.

Note: This property has been replaced by archiveAppendix.

The appendix part of the archive name, if any.

Default with war plugin:
""

Property<String> archiveAppendix

The appendix part of the archive name, if any.

Default with war plugin:
""

Property<String> archiveBaseName

The base name of the archive.

Default with war plugin:
project.archivesBaseName

Property<String> archiveClassifier

The classifier part of the archive name, if any.

Default with war plugin:
""

Property<String> archiveExtension

The extension part of the archive name.

Provider<RegularFile> archiveFile

The RegularFile where the archive is constructed. +The path is simply the destinationDirectory plus the archiveFileName.

Default with war plugin:
${destinationDirectory}/${archiveFileName}

Property<String> archiveFileName

The archive name. If the name has not been explicitly set, the pattern for the name is: +[archiveBaseName]-[archiveAppendix]-[archiveVersion]-[archiveClassifier].[archiveExtension]

Default with war plugin:
${archiveBaseName}-${archiveAppendix}-${archiveVersion}-${archiveClassifier}.${archiveExtension}

String archiveName

Note: This property is deprecated and will be removed in the next major version of Gradle.

Note: This property has been replaced by archiveFileName.

The archive name. If the name has not been explicitly set, the pattern for the name is: +[archiveBaseName]-[archiveAppendix]-[archiveVersion]-[archiveClassifier].[archiveExtension]

Default with war plugin:
${archiveBaseName}-${archiveAppendix}-${archiveVersion}-${archiveClassifier}.${archiveExtension}

File archivePath (read-only)

Note: This property is deprecated and will be removed in the next major version of Gradle.

Note: This property has been replaced by archiveFile.

The path where the archive is constructed. The path is simply the destinationDirectory plus the archiveFileName.

Default with war plugin:
${destinationDirectory}/${archiveFileName}

Property<String> archiveVersion

The version part of the archive name.

Default with war plugin:
project.version

String baseName

Note: This property is deprecated and will be removed in the next major version of Gradle.

Note: This property has been replaced by archiveBaseName.

The base name of the archive.

Default with war plugin:
project.archivesBaseName

boolean caseSensitive

Specifies whether case-sensitive pattern matching should be used.

Default with war plugin:
true

String classifier

Note: This property is deprecated and will be removed in the next major version of Gradle.

Note: This property has been replaced by archiveClassifier.

The classifier part of the archive name, if any.

Default with war plugin:
""

FileCollection classpath

The classpath to include in the WAR archive. Any JAR or ZIP files in this classpath are included in the WEB-INF/lib directory. Any directories in this classpath are included in +the WEB-INF/classes directory.

Default with war plugin:
project.sourceSets.main.runtimeClasspath - project.configurations.providedRuntime

File destinationDir

Note: This property is deprecated and will be removed in the next major version of Gradle.

Note: This property has been replaced by destinationDirectory.

The directory where the archive is generated into.

Default with war plugin:
project.distsDir

DirectoryProperty destinationDirectory

The directory where the archive will be placed.

Default with war plugin:
project.distsDir

Integer dirMode

The Unix permissions to use for the target directories. null means that existing +permissions are preserved. It is dependent on the copy action implementation whether these permissions +will actually be applied.

Default with war plugin:
null

DuplicatesStrategy duplicatesStrategy

The strategy to use when trying to copy more than one file to the same destination. +

+The value can be set with a case insensitive string of the enum value (e.g. 'exclude' for DuplicatesStrategy.EXCLUDE). +

+This strategy can be overridden for individual files by using CopySpec.eachFile(org.gradle.api.Action) or CopySpec.filesMatching(java.lang.String, org.gradle.api.Action).

Default with war plugin:
DuplicatesStrategy.INHERIT

ZipEntryCompression entryCompression

The compression level of the entries of the archive. If set to ZipEntryCompression.DEFLATED (the default), each entry is +compressed using the DEFLATE algorithm. If set to ZipEntryCompression.STORED the entries of the archive are left uncompressed.

Default:
ZipEntryCompression.DEFLATED

Set<String> excludes

The set of exclude patterns.

Default with war plugin:
[]

String extension

Note: This property is deprecated and will be removed in the next major version of Gradle.

Note: This property has been replaced by archiveExtension.

The extension part of the archive name.

Integer fileMode

The Unix permissions to use for the target files. null means that existing +permissions are preserved. It is dependent on the copy action implementation whether these permissions +will actually be applied.

Default with war plugin:
null

boolean includeEmptyDirs

Tells if empty target directories will be included in the copy.

Default with war plugin:
true

Set<String> includes

The set of include patterns.

Default with war plugin:
[]

Manifest manifest

The manifest for this JAR archive.

String metadataCharset

The character set used to encode JAR metadata like file names. +Defaults to UTF-8. +You can change this property but it is not recommended as JVMs expect JAR metadata to be encoded using UTF-8

Default:
UTF-8

boolean preserveFileTimestamps

Specifies whether file timestamps should be preserved in the archive. +

+If false this ensures that archive entries have the same time for builds between different machines, Java versions and operating systems. +

Default with war plugin:
true

boolean reproducibleFileOrder

Specifies whether to enforce a reproducible file order when reading files from directories. +

+Gradle will then walk the directories on disk which are part of this archive in a reproducible order +independent of file systems and operating systems. +This helps Gradle reliably produce byte-for-byte reproducible archives. +

Default with war plugin:
false

FileCollection source (read-only)

The source files for this task.

String version

Note: This property is deprecated and will be removed in the next major version of Gradle.

Note: This property has been replaced by archiveVersion.

The version part of the archive name, if any.

Default with war plugin:
project.version

File webXml

The web.xml file to include in the WAR archive. When null, no web.xml file is included in the WAR.

Default with war plugin:
null

boolean zip64

Whether the zip can contain more than 65535 files and/or support files greater than 4GB in size. +

+The standard zip format has hard limits on file size and count. +The Zip64 format extension +practically removes these limits and is therefore required for building large zips. +

+However, not all Zip readers support the Zip64 extensions. +Notably, the ZipInputStream JDK class does not support Zip64 for versions earlier than Java 7. +This means you should not enable this property if you are building JARs to be used with Java 6 and earlier runtimes.

Default:
false

Method details

void classpath(Object... classpath)

Adds files to the classpath to include in the WAR archive.

AbstractCopyTask eachFile(Closure closure)

Adds an action to be applied to each file as it about to be copied into its destination. The given closure is +called with a FileCopyDetails as its parameter. Actions are executed in the order +added, and are inherited from the parent spec.

AbstractCopyTask eachFile(Action<? super FileCopyDetails> action)

Adds an action to be applied to each file as it is about to be copied into its destination. The action can change +the destination path of the file, filter the contents of the file, or exclude the file from the result entirely. +Actions are executed in the order added, and are inherited from the parent spec.

AbstractCopyTask exclude(Closure excludeSpec)

Adds an exclude spec. This method may be called multiple times to append new specs.The given closure is passed a +FileTreeElement as its parameter. The closure should return true or false. Example: + +

+copySpec {
+  from 'source'
+  into 'destination'
+  //an example of excluding files from certain configuration:
+  exclude { it.file in configurations.someConf.files }
+}
+

+ +If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match +any exclude pattern to be processed.

AbstractCopyTask exclude(Iterable<String> excludes)

Adds an ANT style exclude pattern. This method may be called multiple times to append new patterns and multiple +patterns may be specified in a single call. + +If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match +any exclude pattern to be processed.

AbstractCopyTask exclude(String... excludes)

Adds an ANT style exclude pattern. This method may be called multiple times to append new patterns and multiple +patterns may be specified in a single call. + +If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match +any exclude pattern to be processed.

AbstractCopyTask exclude(Spec<FileTreeElement> excludeSpec)

Adds an exclude spec. This method may be called multiple times to append new specs. + +If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match +any exclude pattern to be processed.

AbstractCopyTask expand(Map<String, ?> properties)

Expands property references in each file as it is copied. More specifically, each file is transformed using +Groovy's SimpleTemplateEngine. This means you can use simple property references, such as +$property or ${property} in the file. You can also include arbitrary Groovy code in the +file, such as ${version ?: 'unknown'} or ${classpath*.name.join(' ')}

AbstractCopyTask filesMatching(Iterable<String> patterns, Action<? super FileCopyDetails> action)

Configure the FileCopyDetails for each file whose path matches any of the specified Ant-style patterns. +This is equivalent to using eachFile() and selectively applying a configuration based on the file's path.

AbstractCopyTask filesMatching(String pattern, Action<? super FileCopyDetails> action)

Configure the FileCopyDetails for each file whose path matches the specified Ant-style pattern. +This is equivalent to using eachFile() and selectively applying a configuration based on the file's path.

AbstractCopyTask filesNotMatching(Iterable<String> patterns, Action<? super FileCopyDetails> action)

Configure the FileCopyDetails for each file whose path does not match any of the specified +Ant-style patterns. This is equivalent to using eachFile() and selectively applying a configuration based on the +file's path.

AbstractCopyTask filesNotMatching(String pattern, Action<? super FileCopyDetails> action)

Configure the FileCopyDetails for each file whose path does not match the specified +Ant-style pattern. This is equivalent to using eachFile() and selectively applying a configuration based on the +file's path.

AbstractCopyTask filter(Closure closure)

Adds a content filter based on the provided closure. The Closure will be called with each line (stripped of line +endings) and should return a String to replace the line or null to remove the line. If every line is +removed, the result will be an empty file, not an absent one.

AbstractCopyTask filter(Class<? extends FilterReader> filterType)

Adds a content filter to be used during the copy. Multiple calls to filter, add additional filters to the +filter chain. Each filter should implement java.io.FilterReader. Include org.apache.tools.ant.filters.* for access to all the standard Ant filters.

Examples: +

+filter(StripJavaComments)
+filter(com.mycompany.project.CustomFilter)
+

AbstractCopyTask filter(Map<String, ?> properties, Class<? extends FilterReader> filterType)

Adds a content filter to be used during the copy. Multiple calls to filter, add additional filters to the +filter chain. Each filter should implement java.io.FilterReader. Include org.apache.tools.ant.filters.* for access to all the standard Ant filters.

Filter properties may be specified using groovy map syntax.

Examples: +

+filter(HeadFilter, lines:25, skip:2)
+filter(ReplaceTokens, tokens:[copyright:'2009', version:'2.3.1'])
+

Adds a content filter based on the provided transformer. The Closure will be called with each line (stripped of line +endings) and should return a String to replace the line or null to remove the line. If every line is +removed, the result will be an empty file, not an absent one.

AbstractCopyTask from(Object sourcePath, Closure c)

Specifies the source files or directories for a copy and creates a child CopySourceSpec. The given source +path is evaluated as per Project.files(java.lang.Object[]) .

AbstractCopyTask from(Object sourcePath, Action<? super CopySpec> configureAction)

Specifies the source files or directories for a copy and creates a child CopySpec. The given source +path is evaluated as per Project.files(java.lang.Object[]) .

AbstractCopyTask from(Object... sourcePaths)

Specifies source files or directories for a copy. The given paths are evaluated as per Project.files(java.lang.Object[]).

AbstractCopyTask include(Closure includeSpec)

Adds an include spec. This method may be called multiple times to append new specs. The given closure is passed a +FileTreeElement as its parameter. + +If includes are not provided, then all files in this container will be included. If includes are provided, then a +file must match at least one of the include patterns or specs to be included.

AbstractCopyTask include(Iterable<String> includes)

Adds an ANT style include pattern. This method may be called multiple times to append new patterns and multiple +patterns may be specified in a single call. + +If includes are not provided, then all files in this container will be included. If includes are provided, then a +file must match at least one of the include patterns to be processed.

AbstractCopyTask include(String... includes)

Adds an ANT style include pattern. This method may be called multiple times to append new patterns and multiple +patterns may be specified in a single call. + +If includes are not provided, then all files in this container will be included. If includes are provided, then a +file must match at least one of the include patterns to be processed.

AbstractCopyTask include(Spec<FileTreeElement> includeSpec)

Adds an include spec. This method may be called multiple times to append new specs. + +If includes are not provided, then all files in this container will be included. If includes are provided, then a +file must match at least one of the include patterns or specs to be included.

Specifies the destination directory *inside* the archive for the files. +The destination is evaluated as per Project.file(java.lang.Object). +Don't mix it up with AbstractArchiveTask.getDestinationDirectory() which specifies the output directory for the archive.

AbstractArchiveTask into(Object destPath, Closure configureClosure)

Creates and configures a child CopySpec with a destination directory *inside* the archive for the files. +The destination is evaluated as per Project.file(java.lang.Object). +Don't mix it up with AbstractArchiveTask.getDestinationDirectory() which specifies the output directory for the archive.

CopySpec into(Object destPath, Action<? super CopySpec> copySpec)

Creates and configures a child CopySpec with a destination directory *inside* the archive for the files. +The destination is evaluated as per Project.file(java.lang.Object). +Don't mix it up with AbstractArchiveTask.getDestinationDirectory() which specifies the output directory for the archive.

Jar manifest(Closure<?> configureClosure)

Configures the manifest for this JAR archive. + +

The given closure is executed to configure the manifest. The Manifest is passed to the closure as its delegate.

Jar manifest(Action<? super Manifest> configureAction)

Configures the manifest for this JAR archive. + +

The given action is executed to configure the manifest.

CopySpec metaInf(Closure<?> configureClosure)

Adds content to this JAR archive's META-INF directory. + +

The given closure is executed to configure a CopySpec. The CopySpec is passed to the closure as its delegate.

CopySpec metaInf(Action<? super CopySpec> configureAction)

Adds content to this JAR archive's META-INF directory. + +

The given action is executed to configure a CopySpec.

AbstractCopyTask rename(Closure closure)

Renames a source file. The closure will be called with a single parameter, the name of the file. +The closure should return a String object with a new target name. The closure may return null, +in which case the original name will be used.

AbstractCopyTask rename(String sourceRegEx, String replaceWith)

Renames files based on a regular expression. Uses java.util.regex type of regular expressions. Note that the +replace string should use the '$1' syntax to refer to capture groups in the source regular expression. Files +that do not match the source regular expression will be copied with the original name. + +

Example: +

+rename '(.*)_OEM_BLUE_(.*)', '$1$2'
+

+would map the file 'style_OEM_BLUE_.css' to 'style.css'

AbstractCopyTask rename(Pattern sourceRegEx, String replaceWith)

Renames files based on a regular expression. See CopyProcessingSpec.rename(java.lang.String, java.lang.String).

Renames a source file. The function will be called with a single parameter, the name of the file. +The function should return a new target name. The function may return null, +in which case the original name will be used.

CopySpec webInf(Closure configureClosure)

Adds some content to the WEB-INF directory for this WAR archive. + +

The given closure is executed to configure a CopySpec. The CopySpec is passed to the closure as its delegate.

CopySpec webInf(Action<? super CopySpec> configureAction)

Adds some content to the WEB-INF directory for this WAR archive. + +

The given action is executed to configure a CopySpec.

CopySpec with(CopySpec... sourceSpecs)

Adds the given specs as a child of this spec. + +

+def contentSpec = copySpec {
+  from("content") {
+    include "**/*.txt"
+  }
+}
+
+task copy(type: Copy) {
+  into "$buildDir/copy"
+  with contentSpec
+}
+
\ No newline at end of file diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.api.tasks.scala.ScalaCompile.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.api.tasks.scala.ScalaCompile.html new file mode 100644 index 0000000..c6e9e82 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.api.tasks.scala.ScalaCompile.html @@ -0,0 +1,90 @@ + +ScalaCompile - Gradle DSL Version 6.7.1

ScalaCompile

API Documentation:ScalaCompile

Compiles Scala source files, and optionally, Java source files.

Properties

PropertyDescription
classpath

The classpath to use to compile the source files.

destinationDir
Replaced

The directory to generate the .class files into.

destinationDirectory
Incubating

The directory property that represents the directory to generate the .class files into.

excludes

The set of exclude patterns.

includes

The set of include patterns.

options

The Java compilation options.

scalaClasspath

The classpath to use to load the Scala compiler.

scalaCompileOptions

The Scala compilation options.

scalaCompilerPlugins
Incubating

The Scala compiler plugins to use.

source

The source for this task, after the include and exclude patterns have been applied. Ignores source files which do not exist. + +

sourceCompatibility

The Java language level to use to compile the source files.

targetCompatibility

The target JVM to generate the .class files for.

Methods

MethodDescription
exclude(excludeSpec)

Adds an exclude spec. This method may be called multiple times to append new specs.The given closure is passed a +FileTreeElement as its parameter. The closure should return true or false. Example: + +

exclude(excludes)

Adds an ANT style exclude pattern. This method may be called multiple times to append new patterns and multiple +patterns may be specified in a single call. + +If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match +any exclude pattern to be processed.

exclude(excludes)

Adds an ANT style exclude pattern. This method may be called multiple times to append new patterns and multiple +patterns may be specified in a single call. + +If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match +any exclude pattern to be processed.

exclude(excludeSpec)

Adds an exclude spec. This method may be called multiple times to append new specs. + +If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match +any exclude pattern to be processed.

include(includeSpec)

Adds an include spec. This method may be called multiple times to append new specs. The given closure is passed a +FileTreeElement as its parameter. + +If includes are not provided, then all files in this container will be included. If includes are provided, then a +file must match at least one of the include patterns or specs to be included.

include(includes)

Adds an ANT style include pattern. This method may be called multiple times to append new patterns and multiple +patterns may be specified in a single call. + +If includes are not provided, then all files in this container will be included. If includes are provided, then a +file must match at least one of the include patterns to be processed.

include(includes)

Adds an ANT style include pattern. This method may be called multiple times to append new patterns and multiple +patterns may be specified in a single call. + +If includes are not provided, then all files in this container will be included. If includes are provided, then a +file must match at least one of the include patterns to be processed.

include(includeSpec)

Adds an include spec. This method may be called multiple times to append new specs. + +If includes are not provided, then all files in this container will be included. If includes are provided, then a +file must match at least one of the include patterns or specs to be included.

source(sources)

Adds some source to this task. The given source objects will be evaluated as per Project.files(java.lang.Object[]).

Script blocks

No script blocks

Property details

FileCollection classpath

The classpath to use to compile the source files.

Default with scala plugin:
sourceSet.compileClasspath

File destinationDir

Note: This property has been replaced by destinationDirectory.

The directory to generate the .class files into.

Default with scala plugin:
sourceSet.sourceDirectorySet.destinationDirectory

DirectoryProperty destinationDirectory

Note: This property is incubating and may change in a future version of Gradle.

The directory property that represents the directory to generate the .class files into.

Default with scala plugin:
sourceSet.sourceDirectorySet.destinationDirectory

Set<String> excludes

The set of exclude patterns.

Set<String> includes

The set of include patterns.

CompileOptions options (read-only)

The Java compilation options.

FileCollection scalaClasspath

The classpath to use to load the Scala compiler.

Default with scala plugin:
scala-compiler dependency matching the scala-library version found on classpath

BaseScalaCompileOptions scalaCompileOptions (read-only)

The Scala compilation options.

FileCollection scalaCompilerPlugins

Note: This property is incubating and may change in a future version of Gradle.

The Scala compiler plugins to use.

Default with scala plugin:
The list of compiler plugins is resolved from the scalaCompilerPlugins configuration

FileTree source (read-only)

The source for this task, after the include and exclude patterns have been applied. Ignores source files which do not exist. + +

+The PathSensitivity for the sources is configured to be PathSensitivity.ABSOLUTE. +If your sources are less strict, please change it accordingly by overriding this method in your subclass. +

Default with scala plugin:
sourceSet.scala

String sourceCompatibility

The Java language level to use to compile the source files.

Default with scala plugin:
project.sourceCompatibility

String targetCompatibility

The target JVM to generate the .class files for.

Default with scala plugin:
project.targetCompatibility

Method details

SourceTask exclude(Closure excludeSpec)

Adds an exclude spec. This method may be called multiple times to append new specs.The given closure is passed a +FileTreeElement as its parameter. The closure should return true or false. Example: + +

+copySpec {
+  from 'source'
+  into 'destination'
+  //an example of excluding files from certain configuration:
+  exclude { it.file in configurations.someConf.files }
+}
+

+ +If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match +any exclude pattern to be processed.

SourceTask exclude(Iterable<String> excludes)

Adds an ANT style exclude pattern. This method may be called multiple times to append new patterns and multiple +patterns may be specified in a single call. + +If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match +any exclude pattern to be processed.

SourceTask exclude(String... excludes)

Adds an ANT style exclude pattern. This method may be called multiple times to append new patterns and multiple +patterns may be specified in a single call. + +If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match +any exclude pattern to be processed.

SourceTask exclude(Spec<FileTreeElement> excludeSpec)

Adds an exclude spec. This method may be called multiple times to append new specs. + +If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match +any exclude pattern to be processed.

SourceTask include(Closure includeSpec)

Adds an include spec. This method may be called multiple times to append new specs. The given closure is passed a +FileTreeElement as its parameter. + +If includes are not provided, then all files in this container will be included. If includes are provided, then a +file must match at least one of the include patterns or specs to be included.

SourceTask include(Iterable<String> includes)

Adds an ANT style include pattern. This method may be called multiple times to append new patterns and multiple +patterns may be specified in a single call. + +If includes are not provided, then all files in this container will be included. If includes are provided, then a +file must match at least one of the include patterns to be processed.

SourceTask include(String... includes)

Adds an ANT style include pattern. This method may be called multiple times to append new patterns and multiple +patterns may be specified in a single call. + +If includes are not provided, then all files in this container will be included. If includes are provided, then a +file must match at least one of the include patterns to be processed.

SourceTask include(Spec<FileTreeElement> includeSpec)

Adds an include spec. This method may be called multiple times to append new specs. + +If includes are not provided, then all files in this container will be included. If includes are provided, then a +file must match at least one of the include patterns or specs to be included.

SourceTask source(Object... sources)

Adds some source to this task. The given source objects will be evaluated as per Project.files(java.lang.Object[]).

\ No newline at end of file diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.language.c.CSourceSet.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.language.c.CSourceSet.html new file mode 100644 index 0000000..8c4ea01 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.language.c.CSourceSet.html @@ -0,0 +1,47 @@ + +CSourceSet - Gradle DSL Version 6.7.1

CSourceSet

API Documentation:CSourceSet

Note: This class is incubating and may change in a future version of Gradle.

A set of C source files. + +

A C source set contains a set of source files, together with an optional set of exported header files.

+plugins {
+    id 'c'
+}
+
+model {
+    components {
+        main(NativeLibrarySpec) {
+            sources {
+                c {
+                    source {
+                        srcDirs "src/main/cpp", "src/shared/c++"
+                        include "**/*.c"
+                    }
+                    exportedHeaders {
+                        srcDirs "src/main/include"
+                    }
+                }
+            }
+        }
+    }
+}
+

Properties

PropertyDescription
exportedHeaders
Incubating

The headers as a directory set.

libs
Incubating

The libraries that this source set requires.

preCompiledHeader
Incubating

The pre-compiled header configured for this source set.

source
Incubating

The source files.

Methods

MethodDescription
lib(library)
Incubating

Adds a library that this source set requires. This method accepts the following types: + +

Script blocks

No script blocks

Property details

SourceDirectorySet exportedHeaders (read-only)

Note: This property is incubating and may change in a future version of Gradle.

The headers as a directory set.

Collection<?> libs (read-only)

Note: This property is incubating and may change in a future version of Gradle.

The libraries that this source set requires.

String preCompiledHeader

Note: This property is incubating and may change in a future version of Gradle.

The pre-compiled header configured for this source set.

SourceDirectorySet source (read-only)

Note: This property is incubating and may change in a future version of Gradle.

The source files.

Method details

void lib(Object library)

Note: This method is incubating and may change in a future version of Gradle.

Adds a library that this source set requires. This method accepts the following types: + +

+ +The Map notation supports the following String attributes: + +

  • project: the path to the project containing the library (optional, defaults to current project)
  • library: the name of the library (required)
  • linkage: the library linkage required ['shared'/'static'] (optional, defaults to 'shared')
\ No newline at end of file diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.language.objectivec.tasks.ObjectiveCCompile.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.language.objectivec.tasks.ObjectiveCCompile.html new file mode 100644 index 0000000..1b431b0 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.language.objectivec.tasks.ObjectiveCCompile.html @@ -0,0 +1,80 @@ + +ObjectiveCCompile - Gradle DSL Version 6.7.1

ObjectiveCCompile

API Documentation:ObjectiveCCompile

Note: This class is incubating and may change in a future version of Gradle.

Compiles Objective-C source files into object files.

Properties

PropertyDescription
actions

The sequence of Action objects which will be executed by this task, in the order of +execution.

ant

The AntBuilder for this task. You can use this in your build file to execute ant +tasks.

compilerArgs

Additional arguments to provide to the compiler.

convention

The Convention object for this task. A Plugin can use the convention object to +contribute properties and methods to this task.

debuggable

Should the compiler generate debuggable code?

dependsOn

The dependencies of this task.

description

The description of this task.

destroyables

The destroyables of this task.

didWork

Checks if the task actually did any work. Even if a Task executes, it may determine that it has nothing to +do. For example, a compilation task may determine that source files have not changed since the last time a the +task was run.

enabled

Returns if this task is enabled or not.

extensions

The container of extensions.

finalizedBy

Returns tasks that finalize this task.

group

The task group which this task belongs to. The task group is used in reports and user interfaces to +group related tasks together when presenting a list of tasks to the user.

includes

The header directories to be used for compilation.

inputs

The inputs of this task.

localState

The local state of this task.

logger

The logger for this task. You can use this in your build file to write log messages.

logging

The LoggingManager which can be used to receive logging and to control the +standard output/error capture for this task. By default, System.out is redirected to the Gradle logging system at +the QUIET log level, and System.err is redirected at the ERROR log level.

macros

Macros that should be defined for the compiler.

mustRunAfter

Returns tasks that this task must run after.

name

The name of this task. The name uniquely identifies the task within its Project.

objectFileDir

The directory where object files will be generated.

optimized

Should the compiler generate optimized code?

outputs

The outputs of this task.

path

The path of the task, which is a fully qualified name for the task. The path of a task is the path of +its Project plus the name of the task, separated by :.

positionIndependentCode

Should the compiler generate position independent code?

project

The Project which this task belongs to.

source

The source files to be compiled.

state

The execution state of this task. This provides information about the execution of this task, such as +whether it has executed, been skipped, has failed, etc.

systemIncludes

The system include directories to be used for compilation.

targetPlatform

The platform being compiled for.

taskDependencies

Returns a TaskDependency which contains all the tasks that this task depends on.

temporaryDir

Returns a directory which this task can use to write temporary files to. Each task instance is provided with a +separate temporary directory. There are no guarantees that the contents of this directory will be kept beyond the +execution of the task.

timeout
Incubating

The timeout of this task.

toolChain

The tool chain used for compilation.

Methods

MethodDescription
dependsOn(paths)

Adds the given dependencies to this task. See here for a description of the types +of objects which can be used as task dependencies.

doFirst(action)

Adds the given closure to the beginning of this task's action list. The closure is passed this task as a +parameter when executed.

doFirst(actionName, action)

Adds the given Action to the beginning of this task's action list.

doFirst(action)

Adds the given Action to the beginning of this task's action list.

doLast(action)

Adds the given closure to the end of this task's action list. The closure is passed this task as a parameter +when executed.

doLast(actionName, action)

Adds the given Action to the end of this task's action list.

doLast(action)

Adds the given Action to the end of this task's action list.

finalizedBy(paths)

Adds the given finalizer tasks for this task.

hasProperty(propertyName)

Determines if this task has the given property. See here for details of the +properties which are available for a task.

includes(includeRoots)

Add directories where the compiler should search for header files.

mustRunAfter(paths)

Specifies that this task must run after all of the supplied tasks.

onlyIf(onlyIfClosure)

Execute the task only if the given closure returns true. The closure will be evaluated at task execution +time, not during configuration. The closure will be passed a single parameter, this task. If the closure returns +false, the task will be skipped.

onlyIf(onlyIfSpec)

Execute the task only if the given spec is satisfied. The spec will be evaluated at task execution time, not +during configuration. If the Spec is not satisfied, the task will be skipped.

property(propertyName)

Returns the value of the given property of this task. This method locates a property as follows:

setProperty(name, value)

Sets a property of this task. This method searches for a property with the given name in the following +locations, and sets the property on the first location where it finds the property.

source(sourceFiles)

Adds a set of source files to be compiled. The provided sourceFiles object is evaluated as per Project.files(java.lang.Object[]).

Script blocks

No script blocks

Property details

List<Action<? super Task>> actions

The sequence of Action objects which will be executed by this task, in the order of +execution.

AntBuilder ant (read-only)

The AntBuilder for this task. You can use this in your build file to execute ant +tasks.

ListProperty<String> compilerArgs

Additional arguments to provide to the compiler.

Convention convention (read-only)

The Convention object for this task. A Plugin can use the convention object to +contribute properties and methods to this task.

boolean debuggable

Should the compiler generate debuggable code?

Set<Object> dependsOn

The dependencies of this task.

String description

The description of this task.

TaskDestroyables destroyables (read-only)

The destroyables of this task.

boolean didWork

Checks if the task actually did any work. Even if a Task executes, it may determine that it has nothing to +do. For example, a compilation task may determine that source files have not changed since the last time a the +task was run.

boolean enabled

Returns if this task is enabled or not.

ExtensionContainer extensions (read-only)

The container of extensions.

TaskDependency finalizedBy

Returns tasks that finalize this task.

String group

The task group which this task belongs to. The task group is used in reports and user interfaces to +group related tasks together when presenting a list of tasks to the user.

ConfigurableFileCollection includes (read-only)

The header directories to be used for compilation.

TaskInputs inputs (read-only)

The inputs of this task.

TaskLocalState localState (read-only)

The local state of this task.

Logger logger (read-only)

The logger for this task. You can use this in your build file to write log messages.

LoggingManager logging (read-only)

The LoggingManager which can be used to receive logging and to control the +standard output/error capture for this task. By default, System.out is redirected to the Gradle logging system at +the QUIET log level, and System.err is redirected at the ERROR log level.

Map<String, String> macros

Macros that should be defined for the compiler.

TaskDependency mustRunAfter

Returns tasks that this task must run after.

String name (read-only)

The name of this task. The name uniquely identifies the task within its Project.

DirectoryProperty objectFileDir

The directory where object files will be generated.

boolean optimized

Should the compiler generate optimized code?

TaskOutputs outputs (read-only)

The outputs of this task.

String path (read-only)

The path of the task, which is a fully qualified name for the task. The path of a task is the path of +its Project plus the name of the task, separated by :.

boolean positionIndependentCode

Should the compiler generate position independent code?

Project project (read-only)

The Project which this task belongs to.

ConfigurableFileCollection source (read-only)

The source files to be compiled.

TaskState state (read-only)

The execution state of this task. This provides information about the execution of this task, such as +whether it has executed, been skipped, has failed, etc.

ConfigurableFileCollection systemIncludes (read-only)

The system include directories to be used for compilation.

Property<NativePlatform> targetPlatform

The platform being compiled for.

TaskDependency taskDependencies (read-only)

Returns a TaskDependency which contains all the tasks that this task depends on.

File temporaryDir (read-only)

Returns a directory which this task can use to write temporary files to. Each task instance is provided with a +separate temporary directory. There are no guarantees that the contents of this directory will be kept beyond the +execution of the task.

Note: This property is incubating and may change in a future version of Gradle.

The timeout of this task.

+task myTask {
+    timeout = Duration.ofMinutes(10)
+}
+

+The Thread executing this task will be interrupted if the task takes longer than the specified amount of time to run. +In order for a task to work properly with this feature, it needs to react to interrupts and must clean up any resources it opened. +

By default, tasks never time out.

The tool chain used for compilation.

Method details

Task dependsOn(Object... paths)

Adds the given dependencies to this task. See here for a description of the types +of objects which can be used as task dependencies.

Task doFirst(Closure action)

Adds the given closure to the beginning of this task's action list. The closure is passed this task as a +parameter when executed.

Task doFirst(String actionName, Action<? super Task> action)

Adds the given Action to the beginning of this task's action list.

Task doFirst(Action<? super Task> action)

Adds the given Action to the beginning of this task's action list.

Task doLast(Closure action)

Adds the given closure to the end of this task's action list. The closure is passed this task as a parameter +when executed.

Task doLast(String actionName, Action<? super Task> action)

Adds the given Action to the end of this task's action list.

Task doLast(Action<? super Task> action)

Adds the given Action to the end of this task's action list.

Task finalizedBy(Object... paths)

Adds the given finalizer tasks for this task.

+task taskY {
+    finalizedBy "taskX"
+}
+

See here for a description of the types of objects which can be used to specify +a finalizer task.

boolean hasProperty(String propertyName)

Determines if this task has the given property. See here for details of the +properties which are available for a task.

void includes(Object includeRoots)

Add directories where the compiler should search for header files.

Task mustRunAfter(Object... paths)

Specifies that this task must run after all of the supplied tasks.

+task taskY {
+    mustRunAfter "taskX"
+}
+

For each supplied task, this action adds a task 'ordering', and does not specify a 'dependency' between the tasks. +As such, it is still possible to execute 'taskY' without first executing the 'taskX' in the example.

See here for a description of the types of objects which can be used to specify +an ordering relationship.

void onlyIf(Closure onlyIfClosure)

Execute the task only if the given closure returns true. The closure will be evaluated at task execution +time, not during configuration. The closure will be passed a single parameter, this task. If the closure returns +false, the task will be skipped.

You may add multiple such predicates. The task is skipped if any of the predicates return false.

Typical usage:myTask.onlyIf { isProductionEnvironment() }

void onlyIf(Spec<? super Task> onlyIfSpec)

Execute the task only if the given spec is satisfied. The spec will be evaluated at task execution time, not +during configuration. If the Spec is not satisfied, the task will be skipped.

You may add multiple such predicates. The task is skipped if any of the predicates return false.

Typical usage (from Java):

myTask.onlyIf(new Spec<Task>() {
+   boolean isSatisfiedBy(Task task) {
+      return isProductionEnvironment();
+   }
+});
+

Object property(String propertyName)

Returns the value of the given property of this task. This method locates a property as follows:

  1. If this task object has a property with the given name, return the value of the property.
  2. If this task has an extension with the given name, return the extension.
  3. If this task's convention object has a property with the given name, return the value of the property.
  4. If this task has an extra property with the given name, return the value of the property.
  5. If not found, throw MissingPropertyException

void setProperty(String name, Object value)

Sets a property of this task. This method searches for a property with the given name in the following +locations, and sets the property on the first location where it finds the property.

  1. The task object itself. For example, the enabled project property.
  2. The task's convention object.
  3. The task's extra properties.

+ +If the property is not found, a MissingPropertyException is thrown.

void source(Object sourceFiles)

Adds a set of source files to be compiled. The provided sourceFiles object is evaluated as per Project.files(java.lang.Object[]).

\ No newline at end of file diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.nativeplatform.NativeLibraryBinary.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.nativeplatform.NativeLibraryBinary.html new file mode 100644 index 0000000..ca63be9 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.nativeplatform.NativeLibraryBinary.html @@ -0,0 +1,15 @@ + +NativeLibraryBinary - Gradle DSL Version 6.7.1

NativeLibraryBinary

API Documentation:NativeLibraryBinary

Note: This class is incubating and may change in a future version of Gradle.

A physical representation of a NativeLibrary component.

Properties

PropertyDescription
buildType
Incubating

The BuildType used to construct this binary.

flavor
Incubating

The Flavor that this binary was built with.

targetPlatform
Incubating

The NativePlatform that this binary is targeted to run on.

Methods

No methods

Script blocks

No script blocks

Property details

BuildType buildType (read-only)

Note: This property is incubating and may change in a future version of Gradle.

The BuildType used to construct this binary.

Flavor flavor (read-only)

Note: This property is incubating and may change in a future version of Gradle.

The Flavor that this binary was built with.

NativePlatform targetPlatform (read-only)

Note: This property is incubating and may change in a future version of Gradle.

The NativePlatform that this binary is targeted to run on.

\ No newline at end of file diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.nativeplatform.tasks.CreateStaticLibrary.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.nativeplatform.tasks.CreateStaticLibrary.html new file mode 100644 index 0000000..ab6294e --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.nativeplatform.tasks.CreateStaticLibrary.html @@ -0,0 +1,80 @@ + +CreateStaticLibrary - Gradle DSL Version 6.7.1

CreateStaticLibrary

API Documentation:CreateStaticLibrary

Assembles a static library from object files.

Properties

PropertyDescription
actions

The sequence of Action objects which will be executed by this task, in the order of +execution.

ant

The AntBuilder for this task. You can use this in your build file to execute ant +tasks.

convention

The Convention object for this task. A Plugin can use the convention object to +contribute properties and methods to this task.

dependsOn

The dependencies of this task.

description

The description of this task.

destroyables

The destroyables of this task.

didWork

Checks if the task actually did any work. Even if a Task executes, it may determine that it has nothing to +do. For example, a compilation task may determine that source files have not changed since the last time a the +task was run.

enabled

Returns if this task is enabled or not.

extensions

The container of extensions.

finalizedBy

Returns tasks that finalize this task.

group

The task group which this task belongs to. The task group is used in reports and user interfaces to +group related tasks together when presenting a list of tasks to the user.

inputs

The inputs of this task.

localState

The local state of this task.

logger

The logger for this task. You can use this in your build file to write log messages.

logging

The LoggingManager which can be used to receive logging and to control the +standard output/error capture for this task. By default, System.out is redirected to the Gradle logging system at +the QUIET log level, and System.err is redirected at the ERROR log level.

mustRunAfter

Returns tasks that this task must run after.

name

The name of this task. The name uniquely identifies the task within its Project.

outputFile

The file where the output binary will be located.

outputs

The outputs of this task.

path

The path of the task, which is a fully qualified name for the task. The path of a task is the path of +its Project plus the name of the task, separated by :.

project

The Project which this task belongs to.

source

The source object files to be passed to the archiver.

state

The execution state of this task. This provides information about the execution of this task, such as +whether it has executed, been skipped, has failed, etc.

staticLibArgs

Additional arguments passed to the archiver.

targetPlatform

The platform being linked for.

taskDependencies

Returns a TaskDependency which contains all the tasks that this task depends on.

temporaryDir

Returns a directory which this task can use to write temporary files to. Each task instance is provided with a +separate temporary directory. There are no guarantees that the contents of this directory will be kept beyond the +execution of the task.

timeout
Incubating

The timeout of this task.

toolChain

The tool chain used for linking.

Methods

MethodDescription
dependsOn(paths)

Adds the given dependencies to this task. See here for a description of the types +of objects which can be used as task dependencies.

doFirst(action)

Adds the given closure to the beginning of this task's action list. The closure is passed this task as a +parameter when executed.

doFirst(actionName, action)

Adds the given Action to the beginning of this task's action list.

doFirst(action)

Adds the given Action to the beginning of this task's action list.

doLast(action)

Adds the given closure to the end of this task's action list. The closure is passed this task as a parameter +when executed.

doLast(actionName, action)

Adds the given Action to the end of this task's action list.

doLast(action)

Adds the given Action to the end of this task's action list.

finalizedBy(paths)

Adds the given finalizer tasks for this task.

hasProperty(propertyName)

Determines if this task has the given property. See here for details of the +properties which are available for a task.

mustRunAfter(paths)

Specifies that this task must run after all of the supplied tasks.

onlyIf(onlyIfClosure)

Execute the task only if the given closure returns true. The closure will be evaluated at task execution +time, not during configuration. The closure will be passed a single parameter, this task. If the closure returns +false, the task will be skipped.

onlyIf(onlyIfSpec)

Execute the task only if the given spec is satisfied. The spec will be evaluated at task execution time, not +during configuration. If the Spec is not satisfied, the task will be skipped.

property(propertyName)

Returns the value of the given property of this task. This method locates a property as follows:

setProperty(name, value)

Sets a property of this task. This method searches for a property with the given name in the following +locations, and sets the property on the first location where it finds the property.

source(source)

Adds a set of object files to be linked.

Script blocks

No script blocks

Property details

List<Action<? super Task>> actions

The sequence of Action objects which will be executed by this task, in the order of +execution.

AntBuilder ant (read-only)

The AntBuilder for this task. You can use this in your build file to execute ant +tasks.

Convention convention (read-only)

The Convention object for this task. A Plugin can use the convention object to +contribute properties and methods to this task.

Set<Object> dependsOn

The dependencies of this task.

String description

The description of this task.

TaskDestroyables destroyables (read-only)

The destroyables of this task.

boolean didWork

Checks if the task actually did any work. Even if a Task executes, it may determine that it has nothing to +do. For example, a compilation task may determine that source files have not changed since the last time a the +task was run.

boolean enabled

Returns if this task is enabled or not.

ExtensionContainer extensions (read-only)

The container of extensions.

TaskDependency finalizedBy

Returns tasks that finalize this task.

String group

The task group which this task belongs to. The task group is used in reports and user interfaces to +group related tasks together when presenting a list of tasks to the user.

TaskInputs inputs (read-only)

The inputs of this task.

TaskLocalState localState (read-only)

The local state of this task.

Logger logger (read-only)

The logger for this task. You can use this in your build file to write log messages.

LoggingManager logging (read-only)

The LoggingManager which can be used to receive logging and to control the +standard output/error capture for this task. By default, System.out is redirected to the Gradle logging system at +the QUIET log level, and System.err is redirected at the ERROR log level.

TaskDependency mustRunAfter

Returns tasks that this task must run after.

String name (read-only)

The name of this task. The name uniquely identifies the task within its Project.

The file where the output binary will be located.

TaskOutputs outputs (read-only)

The outputs of this task.

String path (read-only)

The path of the task, which is a fully qualified name for the task. The path of a task is the path of +its Project plus the name of the task, separated by :.

Project project (read-only)

The Project which this task belongs to.

FileCollection source (read-only)

The source object files to be passed to the archiver.

TaskState state (read-only)

The execution state of this task. This provides information about the execution of this task, such as +whether it has executed, been skipped, has failed, etc.

ListProperty<String> staticLibArgs

Additional arguments passed to the archiver.

Property<NativePlatform> targetPlatform

The platform being linked for.

TaskDependency taskDependencies (read-only)

Returns a TaskDependency which contains all the tasks that this task depends on.

File temporaryDir (read-only)

Returns a directory which this task can use to write temporary files to. Each task instance is provided with a +separate temporary directory. There are no guarantees that the contents of this directory will be kept beyond the +execution of the task.

Note: This property is incubating and may change in a future version of Gradle.

The timeout of this task.

+task myTask {
+    timeout = Duration.ofMinutes(10)
+}
+

+The Thread executing this task will be interrupted if the task takes longer than the specified amount of time to run. +In order for a task to work properly with this feature, it needs to react to interrupts and must clean up any resources it opened. +

By default, tasks never time out.

The tool chain used for linking.

Method details

Task dependsOn(Object... paths)

Adds the given dependencies to this task. See here for a description of the types +of objects which can be used as task dependencies.

Task doFirst(Closure action)

Adds the given closure to the beginning of this task's action list. The closure is passed this task as a +parameter when executed.

Task doFirst(String actionName, Action<? super Task> action)

Adds the given Action to the beginning of this task's action list.

Task doFirst(Action<? super Task> action)

Adds the given Action to the beginning of this task's action list.

Task doLast(Closure action)

Adds the given closure to the end of this task's action list. The closure is passed this task as a parameter +when executed.

Task doLast(String actionName, Action<? super Task> action)

Adds the given Action to the end of this task's action list.

Task doLast(Action<? super Task> action)

Adds the given Action to the end of this task's action list.

Task finalizedBy(Object... paths)

Adds the given finalizer tasks for this task.

+task taskY {
+    finalizedBy "taskX"
+}
+

See here for a description of the types of objects which can be used to specify +a finalizer task.

boolean hasProperty(String propertyName)

Determines if this task has the given property. See here for details of the +properties which are available for a task.

Task mustRunAfter(Object... paths)

Specifies that this task must run after all of the supplied tasks.

+task taskY {
+    mustRunAfter "taskX"
+}
+

For each supplied task, this action adds a task 'ordering', and does not specify a 'dependency' between the tasks. +As such, it is still possible to execute 'taskY' without first executing the 'taskX' in the example.

See here for a description of the types of objects which can be used to specify +an ordering relationship.

void onlyIf(Closure onlyIfClosure)

Execute the task only if the given closure returns true. The closure will be evaluated at task execution +time, not during configuration. The closure will be passed a single parameter, this task. If the closure returns +false, the task will be skipped.

You may add multiple such predicates. The task is skipped if any of the predicates return false.

Typical usage:myTask.onlyIf { isProductionEnvironment() }

void onlyIf(Spec<? super Task> onlyIfSpec)

Execute the task only if the given spec is satisfied. The spec will be evaluated at task execution time, not +during configuration. If the Spec is not satisfied, the task will be skipped.

You may add multiple such predicates. The task is skipped if any of the predicates return false.

Typical usage (from Java):

myTask.onlyIf(new Spec<Task>() {
+   boolean isSatisfiedBy(Task task) {
+      return isProductionEnvironment();
+   }
+});
+

Object property(String propertyName)

Returns the value of the given property of this task. This method locates a property as follows:

  1. If this task object has a property with the given name, return the value of the property.
  2. If this task has an extension with the given name, return the extension.
  3. If this task's convention object has a property with the given name, return the value of the property.
  4. If this task has an extra property with the given name, return the value of the property.
  5. If not found, throw MissingPropertyException

void setProperty(String name, Object value)

Sets a property of this task. This method searches for a property with the given name in the following +locations, and sets the property on the first location where it finds the property.

  1. The task object itself. For example, the enabled project property.
  2. The task's convention object.
  3. The task's extra properties.

+ +If the property is not found, a MissingPropertyException is thrown.

void source(Object source)

Adds a set of object files to be linked.

The provided source object is evaluated as per Project.files(java.lang.Object[]).

\ No newline at end of file diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.nativeplatform.test.xctest.tasks.XCTest.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.nativeplatform.test.xctest.tasks.XCTest.html new file mode 100644 index 0000000..c4f2f27 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.nativeplatform.test.xctest.tasks.XCTest.html @@ -0,0 +1,46 @@ + +XCTest - Gradle DSL Version 6.7.1

XCTest

API Documentation:XCTest

Executes XCTest tests. Test are always run in a single execution.

Properties

PropertyDescription
binResultsDir
Deprecated
Replaced

The root folder for the test results in internal binary format.

ignoreFailures

Specifies whether the build should break when the verifications performed by this task fail.

reports

The reports that this task potentially produces.

runScriptFile

Returns test suite bundle or executable location

testInstallDirectory

The test suite bundle or executable location

workingDirectory

The working directory property for this test.

Methods

MethodDescription
addTestListener(listener)

Registers a test listener with this task. Consider also the following handy methods for quicker hooking into test execution: AbstractTestTask.beforeTest(groovy.lang.Closure), AbstractTestTask.afterTest(groovy.lang.Closure), AbstractTestTask.beforeSuite(groovy.lang.Closure), AbstractTestTask.afterSuite(groovy.lang.Closure)

addTestOutputListener(listener)

Registers a output listener with this task. Quicker way of hooking into output events is using the AbstractTestTask.onOutput(groovy.lang.Closure) method.

afterSuite(closure)

Adds a closure to be notified after a test suite has executed. A TestDescriptor and TestResult instance are passed to the closure as a +parameter.

afterTest(closure)

Adds a closure to be notified after a test has executed. A TestDescriptor and TestResult instance are passed to the closure as a parameter.

beforeSuite(closure)

Adds a closure to be notified before a test suite is executed. A TestDescriptor instance is passed to the closure as a parameter.

beforeTest(closure)

Adds a closure to be notified before a test is executed. A TestDescriptor instance is passed to the closure as a parameter.

onOutput(closure)

Adds a closure to be notified when output from the test received. A TestDescriptor and TestOutputEvent instance are +passed to the closure as a parameter. + +

removeTestListener(listener)

Unregisters a test listener with this task. This method will only remove listeners that were added by calling AbstractTestTask.addTestListener(org.gradle.api.tasks.testing.TestListener) on this task. If the listener was +registered with Gradle using Gradle.addListener(java.lang.Object) this method will not do anything. Instead, use Gradle.removeListener(java.lang.Object).

removeTestOutputListener(listener)

Unregisters a test output listener with this task. This method will only remove listeners that were added by calling AbstractTestTask.addTestOutputListener(org.gradle.api.tasks.testing.TestOutputListener) on this task. If the +listener was registered with Gradle using Gradle.addListener(java.lang.Object) this method will not do anything. Instead, use Gradle.removeListener(java.lang.Object).

reports(configureAction)

Configures the reports that this task potentially produces.

setTestNameIncludePatterns(testNamePattern)

Sets the test name patterns to be included in execution. +Classes or method names are supported, wildcard '*' is supported. +For more information see the user guide chapter on testing. + +For more information on supported patterns see TestFilter

Script blocks

No script blocks

Property details

File binResultsDir

Note: This property is deprecated and will be removed in the next major version of Gradle.

Note: This property has been replaced by binaryResultsDirectory.

The root folder for the test results in internal binary format.

Default:
project.testResultsDir/binary/task.name

boolean ignoreFailures

Specifies whether the build should break when the verifications performed by this task fail.

TestTaskReports reports (read-only)

The reports that this task potentially produces.

RegularFileProperty runScriptFile

Returns test suite bundle or executable location

DirectoryProperty testInstallDirectory

The test suite bundle or executable location

DirectoryProperty workingDirectory

The working directory property for this test.

Method details

void addTestListener(TestListener listener)

Registers a test listener with this task. Consider also the following handy methods for quicker hooking into test execution: AbstractTestTask.beforeTest(groovy.lang.Closure), AbstractTestTask.afterTest(groovy.lang.Closure), AbstractTestTask.beforeSuite(groovy.lang.Closure), AbstractTestTask.afterSuite(groovy.lang.Closure)

This listener will NOT be notified of tests executed by other tasks. To +get that behavior, use Gradle.addListener(java.lang.Object).

void addTestOutputListener(TestOutputListener listener)

Registers a output listener with this task. Quicker way of hooking into output events is using the AbstractTestTask.onOutput(groovy.lang.Closure) method.

void afterSuite(Closure closure)

Adds a closure to be notified after a test suite has executed. A TestDescriptor and TestResult instance are passed to the closure as a +parameter.

This method is also called after all test suites are executed. The provided descriptor will have a null parent suite.

void afterTest(Closure closure)

Adds a closure to be notified after a test has executed. A TestDescriptor and TestResult instance are passed to the closure as a parameter.

void beforeSuite(Closure closure)

Adds a closure to be notified before a test suite is executed. A TestDescriptor instance is passed to the closure as a parameter.

This method is also called before any test suites are executed. The provided descriptor will have a null parent suite.

void beforeTest(Closure closure)

Adds a closure to be notified before a test is executed. A TestDescriptor instance is passed to the closure as a parameter.

void onOutput(Closure closure)

Adds a closure to be notified when output from the test received. A TestDescriptor and TestOutputEvent instance are +passed to the closure as a parameter. + +

+apply plugin: 'java'
+
+test {
+   onOutput { descriptor, event ->
+       if (event.destination == TestOutputEvent.Destination.StdErr) {
+           logger.error("Test: " + descriptor + ", error: " + event.message)
+       }
+   }
+}
+

void removeTestListener(TestListener listener)

Unregisters a test listener with this task. This method will only remove listeners that were added by calling AbstractTestTask.addTestListener(org.gradle.api.tasks.testing.TestListener) on this task. If the listener was +registered with Gradle using Gradle.addListener(java.lang.Object) this method will not do anything. Instead, use Gradle.removeListener(java.lang.Object).

void removeTestOutputListener(TestOutputListener listener)

Unregisters a test output listener with this task. This method will only remove listeners that were added by calling AbstractTestTask.addTestOutputListener(org.gradle.api.tasks.testing.TestOutputListener) on this task. If the +listener was registered with Gradle using Gradle.addListener(java.lang.Object) this method will not do anything. Instead, use Gradle.removeListener(java.lang.Object).

TestTaskReports reports(Action<? super TestTaskReports> configureAction)

Configures the reports that this task potentially produces.

AbstractTestTask setTestNameIncludePatterns(List<String> testNamePattern)

Sets the test name patterns to be included in execution. +Classes or method names are supported, wildcard '*' is supported. +For more information see the user guide chapter on testing. + +For more information on supported patterns see TestFilter

\ No newline at end of file diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.plugins.ide.idea.GenerateIdeaProject.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.plugins.ide.idea.GenerateIdeaProject.html new file mode 100644 index 0000000..e1cfb0b --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.plugins.ide.idea.GenerateIdeaProject.html @@ -0,0 +1,17 @@ + +GenerateIdeaProject - Gradle DSL Version 6.7.1

GenerateIdeaProject

API Documentation:GenerateIdeaProject

Generates an IDEA project file for root project *only*. If you want to fine tune the idea configuration

At this moment nearly all configuration is done via IdeaProject.

Properties

PropertyDescription
ideaProject

The Idea project model containing the details required to generate the project file.

inputFile

The input file to load the initial configuration from. Defaults to the output file. If the specified input file +does not exist, this task uses some default initial configuration.

outputFile

output *.ipr file

Methods

No methods

Script blocks

No script blocks

Property details

IdeaProject ideaProject

The Idea project model containing the details required to generate the project file.

Default with idea plugin:
project.idea.project

File inputFile

The input file to load the initial configuration from. Defaults to the output file. If the specified input file +does not exist, this task uses some default initial configuration.

File outputFile

output *.ipr file

Default with idea plugin:
${project.projectDir}/${project.name}.ipr
\ No newline at end of file diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.testing.jacoco.tasks.JacocoBase.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.testing.jacoco.tasks.JacocoBase.html new file mode 100644 index 0000000..4983d25 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/dsl/org.gradle.testing.jacoco.tasks.JacocoBase.html @@ -0,0 +1,82 @@ + +JacocoBase - Gradle DSL Version 6.7.1

JacocoBase

API Documentation:JacocoBase

Base class for Jacoco tasks.

Properties

PropertyDescription
actions

The sequence of Action objects which will be executed by this task, in the order of +execution.

ant

The AntBuilder for this task. You can use this in your build file to execute ant +tasks.

convention

The Convention object for this task. A Plugin can use the convention object to +contribute properties and methods to this task.

dependsOn

The dependencies of this task.

description

The description of this task.

destroyables

The destroyables of this task.

didWork

Checks if the task actually did any work. Even if a Task executes, it may determine that it has nothing to +do. For example, a compilation task may determine that source files have not changed since the last time a the +task was run.

enabled

Returns if this task is enabled or not.

extensions

The container of extensions.

finalizedBy

Returns tasks that finalize this task.

group

The task group which this task belongs to. The task group is used in reports and user interfaces to +group related tasks together when presenting a list of tasks to the user.

inputs

The inputs of this task.

jacocoClasspath

Classpath containing Jacoco classes for use by the task.

localState

The local state of this task.

logger

The logger for this task. You can use this in your build file to write log messages.

logging

The LoggingManager which can be used to receive logging and to control the +standard output/error capture for this task. By default, System.out is redirected to the Gradle logging system at +the QUIET log level, and System.err is redirected at the ERROR log level.

mustRunAfter

Returns tasks that this task must run after.

name

The name of this task. The name uniquely identifies the task within its Project.

outputs

The outputs of this task.

path

The path of the task, which is a fully qualified name for the task. The path of a task is the path of +its Project plus the name of the task, separated by :.

project

The Project which this task belongs to.

state

The execution state of this task. This provides information about the execution of this task, such as +whether it has executed, been skipped, has failed, etc.

taskDependencies

Returns a TaskDependency which contains all the tasks that this task depends on.

temporaryDir

Returns a directory which this task can use to write temporary files to. Each task instance is provided with a +separate temporary directory. There are no guarantees that the contents of this directory will be kept beyond the +execution of the task.

timeout
Incubating

The timeout of this task.

Methods

MethodDescription
dependsOn(paths)

Adds the given dependencies to this task. See here for a description of the types +of objects which can be used as task dependencies.

doFirst(action)

Adds the given closure to the beginning of this task's action list. The closure is passed this task as a +parameter when executed.

doFirst(actionName, action)

Adds the given Action to the beginning of this task's action list.

doFirst(action)

Adds the given Action to the beginning of this task's action list.

doLast(action)

Adds the given closure to the end of this task's action list. The closure is passed this task as a parameter +when executed.

doLast(actionName, action)

Adds the given Action to the end of this task's action list.

doLast(action)

Adds the given Action to the end of this task's action list.

finalizedBy(paths)

Adds the given finalizer tasks for this task.

hasProperty(propertyName)

Determines if this task has the given property. See here for details of the +properties which are available for a task.

mustRunAfter(paths)

Specifies that this task must run after all of the supplied tasks.

onlyIf(onlyIfClosure)

Execute the task only if the given closure returns true. The closure will be evaluated at task execution +time, not during configuration. The closure will be passed a single parameter, this task. If the closure returns +false, the task will be skipped.

onlyIf(onlyIfSpec)

Execute the task only if the given spec is satisfied. The spec will be evaluated at task execution time, not +during configuration. If the Spec is not satisfied, the task will be skipped.

property(propertyName)

Returns the value of the given property of this task. This method locates a property as follows:

setProperty(name, value)

Sets a property of this task. This method searches for a property with the given name in the following +locations, and sets the property on the first location where it finds the property.

Script blocks

No script blocks

Property details

List<Action<? super Task>> actions

The sequence of Action objects which will be executed by this task, in the order of +execution.

AntBuilder ant (read-only)

The AntBuilder for this task. You can use this in your build file to execute ant +tasks.

Convention convention (read-only)

The Convention object for this task. A Plugin can use the convention object to +contribute properties and methods to this task.

Set<Object> dependsOn

The dependencies of this task.

String description

The description of this task.

TaskDestroyables destroyables (read-only)

The destroyables of this task.

boolean didWork

Checks if the task actually did any work. Even if a Task executes, it may determine that it has nothing to +do. For example, a compilation task may determine that source files have not changed since the last time a the +task was run.

boolean enabled

Returns if this task is enabled or not.

ExtensionContainer extensions (read-only)

The container of extensions.

TaskDependency finalizedBy

Returns tasks that finalize this task.

String group

The task group which this task belongs to. The task group is used in reports and user interfaces to +group related tasks together when presenting a list of tasks to the user.

TaskInputs inputs (read-only)

The inputs of this task.

FileCollection jacocoClasspath

Classpath containing Jacoco classes for use by the task.

Default with jacoco plugin:
+ project.configurations.jacocoAnt +

TaskLocalState localState (read-only)

The local state of this task.

Logger logger (read-only)

The logger for this task. You can use this in your build file to write log messages.

LoggingManager logging (read-only)

The LoggingManager which can be used to receive logging and to control the +standard output/error capture for this task. By default, System.out is redirected to the Gradle logging system at +the QUIET log level, and System.err is redirected at the ERROR log level.

TaskDependency mustRunAfter

Returns tasks that this task must run after.

String name (read-only)

The name of this task. The name uniquely identifies the task within its Project.

TaskOutputs outputs (read-only)

The outputs of this task.

String path (read-only)

The path of the task, which is a fully qualified name for the task. The path of a task is the path of +its Project plus the name of the task, separated by :.

Project project (read-only)

The Project which this task belongs to.

TaskState state (read-only)

The execution state of this task. This provides information about the execution of this task, such as +whether it has executed, been skipped, has failed, etc.

TaskDependency taskDependencies (read-only)

Returns a TaskDependency which contains all the tasks that this task depends on.

File temporaryDir (read-only)

Returns a directory which this task can use to write temporary files to. Each task instance is provided with a +separate temporary directory. There are no guarantees that the contents of this directory will be kept beyond the +execution of the task.

Note: This property is incubating and may change in a future version of Gradle.

The timeout of this task.

+task myTask {
+    timeout = Duration.ofMinutes(10)
+}
+

+The Thread executing this task will be interrupted if the task takes longer than the specified amount of time to run. +In order for a task to work properly with this feature, it needs to react to interrupts and must clean up any resources it opened. +

By default, tasks never time out.

Method details

Task dependsOn(Object... paths)

Adds the given dependencies to this task. See here for a description of the types +of objects which can be used as task dependencies.

Task doFirst(Closure action)

Adds the given closure to the beginning of this task's action list. The closure is passed this task as a +parameter when executed.

Task doFirst(String actionName, Action<? super Task> action)

Adds the given Action to the beginning of this task's action list.

Task doFirst(Action<? super Task> action)

Adds the given Action to the beginning of this task's action list.

Task doLast(Closure action)

Adds the given closure to the end of this task's action list. The closure is passed this task as a parameter +when executed.

Task doLast(String actionName, Action<? super Task> action)

Adds the given Action to the end of this task's action list.

Task doLast(Action<? super Task> action)

Adds the given Action to the end of this task's action list.

Task finalizedBy(Object... paths)

Adds the given finalizer tasks for this task.

+task taskY {
+    finalizedBy "taskX"
+}
+

See here for a description of the types of objects which can be used to specify +a finalizer task.

boolean hasProperty(String propertyName)

Determines if this task has the given property. See here for details of the +properties which are available for a task.

Task mustRunAfter(Object... paths)

Specifies that this task must run after all of the supplied tasks.

+task taskY {
+    mustRunAfter "taskX"
+}
+

For each supplied task, this action adds a task 'ordering', and does not specify a 'dependency' between the tasks. +As such, it is still possible to execute 'taskY' without first executing the 'taskX' in the example.

See here for a description of the types of objects which can be used to specify +an ordering relationship.

void onlyIf(Closure onlyIfClosure)

Execute the task only if the given closure returns true. The closure will be evaluated at task execution +time, not during configuration. The closure will be passed a single parameter, this task. If the closure returns +false, the task will be skipped.

You may add multiple such predicates. The task is skipped if any of the predicates return false.

Typical usage:myTask.onlyIf { isProductionEnvironment() }

void onlyIf(Spec<? super Task> onlyIfSpec)

Execute the task only if the given spec is satisfied. The spec will be evaluated at task execution time, not +during configuration. If the Spec is not satisfied, the task will be skipped.

You may add multiple such predicates. The task is skipped if any of the predicates return false.

Typical usage (from Java):

myTask.onlyIf(new Spec<Task>() {
+   boolean isSatisfiedBy(Task task) {
+      return isProductionEnvironment();
+   }
+});
+

Object property(String propertyName)

Returns the value of the given property of this task. This method locates a property as follows:

  1. If this task object has a property with the given name, return the value of the property.
  2. If this task has an extension with the given name, return the extension.
  3. If this task's convention object has a property with the given name, return the value of the property.
  4. If this task has an extra property with the given name, return the value of the property.
  5. If not found, throw MissingPropertyException

void setProperty(String name, Object value)

Sets a property of this task. This method searches for a property with the given name in the following +locations, and sets the property on the first location where it finds the property.

  1. The task object itself. For example, the enabled project property.
  2. The task's convention object.
  3. The task's extra properties.

+ +If the property is not found, a MissingPropertyException is thrown.

\ No newline at end of file diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/jquery/jquery-ui.css b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/jquery/jquery-ui.css new file mode 100644 index 0000000..c4487b4 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/jquery/jquery-ui.css @@ -0,0 +1,582 @@ +/*! jQuery UI - v1.12.1 - 2018-12-06 +* http://jqueryui.com +* Includes: core.css, autocomplete.css, menu.css, theme.css +* To view and modify this theme, visit http://jqueryui.com/themeroller/?scope=&folderName=custom-theme&bgImgOpacityError=95&bgImgOpacityHighlight=55&bgImgOpacityActive=65&bgImgOpacityHover=75&bgImgOpacityDefault=75&bgImgOpacityContent=75&bgImgOpacityHeader=75&cornerRadiusShadow=8px&offsetLeftShadow=-8px&offsetTopShadow=-8px&thicknessShadow=8px&opacityShadow=30&bgImgOpacityShadow=0&bgTextureShadow=flat&bgColorShadow=%23aaaaaa&opacityOverlay=30&bgImgOpacityOverlay=0&bgTextureOverlay=flat&bgColorOverlay=%23aaaaaa&iconColorError=%23cd0a0a&fcError=%23cd0a0a&borderColorError=%23cd0a0a&bgTextureError=glass&bgColorError=%23fef1ec&iconColorHighlight=%232e83ff&fcHighlight=%23363636&borderColorHighlight=%23fcefa1&bgTextureHighlight=glass&bgColorHighlight=%23fbf9ee&iconColorActive=%23454545&fcActive=%23212121&borderColorActive=%23aaaaaa&bgTextureActive=glass&bgColorActive=%23dadada&iconColorHover=%23454545&fcHover=%23212121&borderColorHover=%23999999&bgTextureHover=glass&bgColorHover=%23dadada&iconColorDefault=%23888888&fcDefault=%23555555&borderColorDefault=%23d3d3d3&bgTextureDefault=glass&bgColorDefault=%23e6e6e6&iconColorContent=%23222222&fcContent=%23222222&borderColorContent=%23aaaaaa&bgTextureContent=flat&bgColorContent=%23ffffff&iconColorHeader=%23222222&fcHeader=%23222222&borderColorHeader=%23aaaaaa&bgTextureHeader=highlight_soft&bgColorHeader=%23cccccc&cornerRadius=4px&fwDefault=normal&fsDefault=1.1em&ffDefault=Verdana%2CArial%2Csans-serif +* Copyright jQuery Foundation and other contributors; Licensed MIT */ + +/* Layout helpers +----------------------------------*/ +.ui-helper-hidden { + display: none; +} +.ui-helper-hidden-accessible { + border: 0; + clip: rect(0 0 0 0); + height: 1px; + margin: -1px; + overflow: hidden; + padding: 0; + position: absolute; + width: 1px; +} +.ui-helper-reset { + margin: 0; + padding: 0; + border: 0; + outline: 0; + line-height: 1.3; + text-decoration: none; + font-size: 100%; + list-style: none; +} +.ui-helper-clearfix:before, +.ui-helper-clearfix:after { + content: ""; + display: table; + border-collapse: collapse; +} +.ui-helper-clearfix:after { + clear: both; +} +.ui-helper-zfix { + width: 100%; + height: 100%; + top: 0; + left: 0; + position: absolute; + opacity: 0; + filter:Alpha(Opacity=0); /* support: IE8 */ +} + +.ui-front { + z-index: 100; +} + + +/* Interaction Cues +----------------------------------*/ +.ui-state-disabled { + cursor: default !important; + pointer-events: none; +} + + +/* Icons +----------------------------------*/ +.ui-icon { + display: inline-block; + vertical-align: middle; + margin-top: -.25em; + position: relative; + text-indent: -99999px; + overflow: hidden; + background-repeat: no-repeat; +} + +.ui-widget-icon-block { + left: 50%; + margin-left: -8px; + display: block; +} + +/* Misc visuals +----------------------------------*/ + +/* Overlays */ +.ui-widget-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; +} +.ui-autocomplete { + position: absolute; + top: 0; + left: 0; + cursor: default; +} +.ui-menu { + list-style: none; + padding: 0; + margin: 0; + display: block; + outline: 0; +} +.ui-menu .ui-menu { + position: absolute; +} +.ui-menu .ui-menu-item { + margin: 0; + cursor: pointer; + /* support: IE10, see #8844 */ + list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); +} +.ui-menu .ui-menu-item-wrapper { + position: relative; + padding: 3px 1em 3px .4em; +} +.ui-menu .ui-menu-divider { + margin: 5px 0; + height: 0; + font-size: 0; + line-height: 0; + border-width: 1px 0 0 0; +} +.ui-menu .ui-state-focus, +.ui-menu .ui-state-active { + margin: -1px; +} + +/* icon support */ +.ui-menu-icons { + position: relative; +} +.ui-menu-icons .ui-menu-item-wrapper { + padding-left: 2em; +} + +/* left-aligned */ +.ui-menu .ui-icon { + position: absolute; + top: 0; + bottom: 0; + left: .2em; + margin: auto 0; +} + +/* right-aligned */ +.ui-menu .ui-menu-icon { + left: auto; + right: 0; +} + +/* Component containers +----------------------------------*/ +.ui-widget { + font-family: Verdana,Arial,sans-serif; + font-size: 1.1em; +} +.ui-widget .ui-widget { + font-size: 1em; +} +.ui-widget input, +.ui-widget select, +.ui-widget textarea, +.ui-widget button { + font-family: Verdana,Arial,sans-serif; + font-size: 1em; +} +.ui-widget.ui-widget-content { + border: 1px solid #d3d3d3; +} +.ui-widget-content { + border: 1px solid #aaaaaa; + background: #ffffff; + color: #222222; +} +.ui-widget-content a { + color: #222222; +} +.ui-widget-header { + border: 1px solid #aaaaaa; + background: #cccccc url("images/ui-bg_highlight-soft_75_cccccc_1x100.png") 50% 50% repeat-x; + color: #222222; + font-weight: bold; +} +.ui-widget-header a { + color: #222222; +} + +/* Interaction states +----------------------------------*/ +.ui-state-default, +.ui-widget-content .ui-state-default, +.ui-widget-header .ui-state-default, +.ui-button, + +/* We use html here because we need a greater specificity to make sure disabled +works properly when clicked or hovered */ +html .ui-button.ui-state-disabled:hover, +html .ui-button.ui-state-disabled:active { + border: 1px solid #d3d3d3; + background: #e6e6e6 url("images/ui-bg_glass_75_e6e6e6_1x400.png") 50% 50% repeat-x; + font-weight: normal; + color: #555555; +} +.ui-state-default a, +.ui-state-default a:link, +.ui-state-default a:visited, +a.ui-button, +a:link.ui-button, +a:visited.ui-button, +.ui-button { + color: #555555; + text-decoration: none; +} +.ui-state-hover, +.ui-widget-content .ui-state-hover, +.ui-widget-header .ui-state-hover, +.ui-state-focus, +.ui-widget-content .ui-state-focus, +.ui-widget-header .ui-state-focus, +.ui-button:hover, +.ui-button:focus { + border: 1px solid #999999; + background: #dadada url("images/ui-bg_glass_75_dadada_1x400.png") 50% 50% repeat-x; + font-weight: normal; + color: #212121; +} +.ui-state-hover a, +.ui-state-hover a:hover, +.ui-state-hover a:link, +.ui-state-hover a:visited, +.ui-state-focus a, +.ui-state-focus a:hover, +.ui-state-focus a:link, +.ui-state-focus a:visited, +a.ui-button:hover, +a.ui-button:focus { + color: #212121; + text-decoration: none; +} + +.ui-visual-focus { + box-shadow: 0 0 3px 1px rgb(94, 158, 214); +} +.ui-state-active, +.ui-widget-content .ui-state-active, +.ui-widget-header .ui-state-active, +a.ui-button:active, +.ui-button:active, +.ui-button.ui-state-active:hover { + border: 1px solid #aaaaaa; + background: #dadada url("images/ui-bg_glass_65_dadada_1x400.png") 50% 50% repeat-x; + font-weight: normal; + color: #212121; +} +.ui-icon-background, +.ui-state-active .ui-icon-background { + border: #aaaaaa; + background-color: #212121; +} +.ui-state-active a, +.ui-state-active a:link, +.ui-state-active a:visited { + color: #212121; + text-decoration: none; +} + +/* Interaction Cues +----------------------------------*/ +.ui-state-highlight, +.ui-widget-content .ui-state-highlight, +.ui-widget-header .ui-state-highlight { + border: 1px solid #fcefa1; + background: #fbf9ee url("images/ui-bg_glass_55_fbf9ee_1x400.png") 50% 50% repeat-x; + color: #363636; +} +.ui-state-checked { + border: 1px solid #fcefa1; + background: #fbf9ee; +} +.ui-state-highlight a, +.ui-widget-content .ui-state-highlight a, +.ui-widget-header .ui-state-highlight a { + color: #363636; +} +.ui-state-error, +.ui-widget-content .ui-state-error, +.ui-widget-header .ui-state-error { + border: 1px solid #cd0a0a; + background: #fef1ec url("images/ui-bg_glass_95_fef1ec_1x400.png") 50% 50% repeat-x; + color: #cd0a0a; +} +.ui-state-error a, +.ui-widget-content .ui-state-error a, +.ui-widget-header .ui-state-error a { + color: #cd0a0a; +} +.ui-state-error-text, +.ui-widget-content .ui-state-error-text, +.ui-widget-header .ui-state-error-text { + color: #cd0a0a; +} +.ui-priority-primary, +.ui-widget-content .ui-priority-primary, +.ui-widget-header .ui-priority-primary { + font-weight: bold; +} +.ui-priority-secondary, +.ui-widget-content .ui-priority-secondary, +.ui-widget-header .ui-priority-secondary { + opacity: .7; + filter:Alpha(Opacity=70); /* support: IE8 */ + font-weight: normal; +} +.ui-state-disabled, +.ui-widget-content .ui-state-disabled, +.ui-widget-header .ui-state-disabled { + opacity: .35; + filter:Alpha(Opacity=35); /* support: IE8 */ + background-image: none; +} +.ui-state-disabled .ui-icon { + filter:Alpha(Opacity=35); /* support: IE8 - See #6059 */ +} + +/* Icons +----------------------------------*/ + +/* states and images */ +.ui-icon { + width: 16px; + height: 16px; +} +.ui-icon, +.ui-widget-content .ui-icon { + background-image: url("images/ui-icons_222222_256x240.png"); +} +.ui-widget-header .ui-icon { + background-image: url("images/ui-icons_222222_256x240.png"); +} +.ui-state-hover .ui-icon, +.ui-state-focus .ui-icon, +.ui-button:hover .ui-icon, +.ui-button:focus .ui-icon { + background-image: url("images/ui-icons_454545_256x240.png"); +} +.ui-state-active .ui-icon, +.ui-button:active .ui-icon { + background-image: url("images/ui-icons_454545_256x240.png"); +} +.ui-state-highlight .ui-icon, +.ui-button .ui-state-highlight.ui-icon { + background-image: url("images/ui-icons_2e83ff_256x240.png"); +} +.ui-state-error .ui-icon, +.ui-state-error-text .ui-icon { + background-image: url("images/ui-icons_cd0a0a_256x240.png"); +} +.ui-button .ui-icon { + background-image: url("images/ui-icons_888888_256x240.png"); +} + +/* positioning */ +.ui-icon-blank { background-position: 16px 16px; } +.ui-icon-caret-1-n { background-position: 0 0; } +.ui-icon-caret-1-ne { background-position: -16px 0; } +.ui-icon-caret-1-e { background-position: -32px 0; } +.ui-icon-caret-1-se { background-position: -48px 0; } +.ui-icon-caret-1-s { background-position: -65px 0; } +.ui-icon-caret-1-sw { background-position: -80px 0; } +.ui-icon-caret-1-w { background-position: -96px 0; } +.ui-icon-caret-1-nw { background-position: -112px 0; } +.ui-icon-caret-2-n-s { background-position: -128px 0; } +.ui-icon-caret-2-e-w { background-position: -144px 0; } +.ui-icon-triangle-1-n { background-position: 0 -16px; } +.ui-icon-triangle-1-ne { background-position: -16px -16px; } +.ui-icon-triangle-1-e { background-position: -32px -16px; } +.ui-icon-triangle-1-se { background-position: -48px -16px; } +.ui-icon-triangle-1-s { background-position: -65px -16px; } +.ui-icon-triangle-1-sw { background-position: -80px -16px; } +.ui-icon-triangle-1-w { background-position: -96px -16px; } +.ui-icon-triangle-1-nw { background-position: -112px -16px; } +.ui-icon-triangle-2-n-s { background-position: -128px -16px; } +.ui-icon-triangle-2-e-w { background-position: -144px -16px; } +.ui-icon-arrow-1-n { background-position: 0 -32px; } +.ui-icon-arrow-1-ne { background-position: -16px -32px; } +.ui-icon-arrow-1-e { background-position: -32px -32px; } +.ui-icon-arrow-1-se { background-position: -48px -32px; } +.ui-icon-arrow-1-s { background-position: -65px -32px; } +.ui-icon-arrow-1-sw { background-position: -80px -32px; } +.ui-icon-arrow-1-w { background-position: -96px -32px; } +.ui-icon-arrow-1-nw { background-position: -112px -32px; } +.ui-icon-arrow-2-n-s { background-position: -128px -32px; } +.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } +.ui-icon-arrow-2-e-w { background-position: -160px -32px; } +.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } +.ui-icon-arrowstop-1-n { background-position: -192px -32px; } +.ui-icon-arrowstop-1-e { background-position: -208px -32px; } +.ui-icon-arrowstop-1-s { background-position: -224px -32px; } +.ui-icon-arrowstop-1-w { background-position: -240px -32px; } +.ui-icon-arrowthick-1-n { background-position: 1px -48px; } +.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } +.ui-icon-arrowthick-1-e { background-position: -32px -48px; } +.ui-icon-arrowthick-1-se { background-position: -48px -48px; } +.ui-icon-arrowthick-1-s { background-position: -64px -48px; } +.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } +.ui-icon-arrowthick-1-w { background-position: -96px -48px; } +.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } +.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } +.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } +.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } +.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } +.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } +.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } +.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } +.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } +.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } +.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } +.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } +.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } +.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } +.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } +.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } +.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } +.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } +.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } +.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } +.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } +.ui-icon-arrow-4 { background-position: 0 -80px; } +.ui-icon-arrow-4-diag { background-position: -16px -80px; } +.ui-icon-extlink { background-position: -32px -80px; } +.ui-icon-newwin { background-position: -48px -80px; } +.ui-icon-refresh { background-position: -64px -80px; } +.ui-icon-shuffle { background-position: -80px -80px; } +.ui-icon-transfer-e-w { background-position: -96px -80px; } +.ui-icon-transferthick-e-w { background-position: -112px -80px; } +.ui-icon-folder-collapsed { background-position: 0 -96px; } +.ui-icon-folder-open { background-position: -16px -96px; } +.ui-icon-document { background-position: -32px -96px; } +.ui-icon-document-b { background-position: -48px -96px; } +.ui-icon-note { background-position: -64px -96px; } +.ui-icon-mail-closed { background-position: -80px -96px; } +.ui-icon-mail-open { background-position: -96px -96px; } +.ui-icon-suitcase { background-position: -112px -96px; } +.ui-icon-comment { background-position: -128px -96px; } +.ui-icon-person { background-position: -144px -96px; } +.ui-icon-print { background-position: -160px -96px; } +.ui-icon-trash { background-position: -176px -96px; } +.ui-icon-locked { background-position: -192px -96px; } +.ui-icon-unlocked { background-position: -208px -96px; } +.ui-icon-bookmark { background-position: -224px -96px; } +.ui-icon-tag { background-position: -240px -96px; } +.ui-icon-home { background-position: 0 -112px; } +.ui-icon-flag { background-position: -16px -112px; } +.ui-icon-calendar { background-position: -32px -112px; } +.ui-icon-cart { background-position: -48px -112px; } +.ui-icon-pencil { background-position: -64px -112px; } +.ui-icon-clock { background-position: -80px -112px; } +.ui-icon-disk { background-position: -96px -112px; } +.ui-icon-calculator { background-position: -112px -112px; } +.ui-icon-zoomin { background-position: -128px -112px; } +.ui-icon-zoomout { background-position: -144px -112px; } +.ui-icon-search { background-position: -160px -112px; } +.ui-icon-wrench { background-position: -176px -112px; } +.ui-icon-gear { background-position: -192px -112px; } +.ui-icon-heart { background-position: -208px -112px; } +.ui-icon-star { background-position: -224px -112px; } +.ui-icon-link { background-position: -240px -112px; } +.ui-icon-cancel { background-position: 0 -128px; } +.ui-icon-plus { background-position: -16px -128px; } +.ui-icon-plusthick { background-position: -32px -128px; } +.ui-icon-minus { background-position: -48px -128px; } +.ui-icon-minusthick { background-position: -64px -128px; } +.ui-icon-close { background-position: -80px -128px; } +.ui-icon-closethick { background-position: -96px -128px; } +.ui-icon-key { background-position: -112px -128px; } +.ui-icon-lightbulb { background-position: -128px -128px; } +.ui-icon-scissors { background-position: -144px -128px; } +.ui-icon-clipboard { background-position: -160px -128px; } +.ui-icon-copy { background-position: -176px -128px; } +.ui-icon-contact { background-position: -192px -128px; } +.ui-icon-image { background-position: -208px -128px; } +.ui-icon-video { background-position: -224px -128px; } +.ui-icon-script { background-position: -240px -128px; } +.ui-icon-alert { background-position: 0 -144px; } +.ui-icon-info { background-position: -16px -144px; } +.ui-icon-notice { background-position: -32px -144px; } +.ui-icon-help { background-position: -48px -144px; } +.ui-icon-check { background-position: -64px -144px; } +.ui-icon-bullet { background-position: -80px -144px; } +.ui-icon-radio-on { background-position: -96px -144px; } +.ui-icon-radio-off { background-position: -112px -144px; } +.ui-icon-pin-w { background-position: -128px -144px; } +.ui-icon-pin-s { background-position: -144px -144px; } +.ui-icon-play { background-position: 0 -160px; } +.ui-icon-pause { background-position: -16px -160px; } +.ui-icon-seek-next { background-position: -32px -160px; } +.ui-icon-seek-prev { background-position: -48px -160px; } +.ui-icon-seek-end { background-position: -64px -160px; } +.ui-icon-seek-start { background-position: -80px -160px; } +/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ +.ui-icon-seek-first { background-position: -80px -160px; } +.ui-icon-stop { background-position: -96px -160px; } +.ui-icon-eject { background-position: -112px -160px; } +.ui-icon-volume-off { background-position: -128px -160px; } +.ui-icon-volume-on { background-position: -144px -160px; } +.ui-icon-power { background-position: 0 -176px; } +.ui-icon-signal-diag { background-position: -16px -176px; } +.ui-icon-signal { background-position: -32px -176px; } +.ui-icon-battery-0 { background-position: -48px -176px; } +.ui-icon-battery-1 { background-position: -64px -176px; } +.ui-icon-battery-2 { background-position: -80px -176px; } +.ui-icon-battery-3 { background-position: -96px -176px; } +.ui-icon-circle-plus { background-position: 0 -192px; } +.ui-icon-circle-minus { background-position: -16px -192px; } +.ui-icon-circle-close { background-position: -32px -192px; } +.ui-icon-circle-triangle-e { background-position: -48px -192px; } +.ui-icon-circle-triangle-s { background-position: -64px -192px; } +.ui-icon-circle-triangle-w { background-position: -80px -192px; } +.ui-icon-circle-triangle-n { background-position: -96px -192px; } +.ui-icon-circle-arrow-e { background-position: -112px -192px; } +.ui-icon-circle-arrow-s { background-position: -128px -192px; } +.ui-icon-circle-arrow-w { background-position: -144px -192px; } +.ui-icon-circle-arrow-n { background-position: -160px -192px; } +.ui-icon-circle-zoomin { background-position: -176px -192px; } +.ui-icon-circle-zoomout { background-position: -192px -192px; } +.ui-icon-circle-check { background-position: -208px -192px; } +.ui-icon-circlesmall-plus { background-position: 0 -208px; } +.ui-icon-circlesmall-minus { background-position: -16px -208px; } +.ui-icon-circlesmall-close { background-position: -32px -208px; } +.ui-icon-squaresmall-plus { background-position: -48px -208px; } +.ui-icon-squaresmall-minus { background-position: -64px -208px; } +.ui-icon-squaresmall-close { background-position: -80px -208px; } +.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } +.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } +.ui-icon-grip-solid-vertical { background-position: -32px -224px; } +.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } +.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } +.ui-icon-grip-diagonal-se { background-position: -80px -224px; } + + +/* Misc visuals +----------------------------------*/ + +/* Corner radius */ +.ui-corner-all, +.ui-corner-top, +.ui-corner-left, +.ui-corner-tl { + border-top-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-top, +.ui-corner-right, +.ui-corner-tr { + border-top-right-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-left, +.ui-corner-bl { + border-bottom-left-radius: 4px; +} +.ui-corner-all, +.ui-corner-bottom, +.ui-corner-right, +.ui-corner-br { + border-bottom-right-radius: 4px; +} + +/* Overlays */ +.ui-widget-overlay { + background: #aaaaaa; + opacity: .3; + filter: Alpha(Opacity=30); /* support: IE8 */ +} +.ui-widget-shadow { + -webkit-box-shadow: -8px -8px 8px #aaaaaa; + box-shadow: -8px -8px 8px #aaaaaa; +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/Script.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/Script.html new file mode 100644 index 0000000..966d110 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/Script.html @@ -0,0 +1,962 @@ + + + + + +Script (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface Script

+
+
+
+
    +
  • +
    +
    public interface Script
    +

    This interface is implemented by all Gradle scripts to add in some Gradle-specific methods. As your compiled + script class will implement this interface, you can use the methods and properties declared by this interface + directly in your script.

    + +

    Generally, a Script object will have a delegate object attached to it. For example, a build script will + have a Project instance attached to it, and an initialization script will have a Gradle instance attached to it. Any property reference or method call which is not found + on this Script object is forwarded to the delegate object.

    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        apply

        +
        void apply​(Closure closure)
        +

        Configures the delegate object for this script using plugins or scripts. + +

        The given closure is used to configure an ObjectConfigurationAction which is + then used to configure the delegate object.

        +
        +
        Parameters:
        +
        closure - The closure to configure the ObjectConfigurationAction.
        +
        +
      • +
      + + + +
        +
      • +

        apply

        +
        void apply​(Map<String,​?> options)
        +

        Configures the delegate object for this script using plugins or scripts. + +

        The following options are available:

        + +
        • from: A script to apply to the delegate object. Accepts any path supported by uri(Object).
        • + +
        • plugin: The id or implementation class of the plugin to apply to the delegate object.
        • + +
        • to: The target delegate object or objects.
        + +

        For more detail, see ObjectConfigurationAction.

        +
        +
        Parameters:
        +
        options - The options to use to configure the ObjectConfigurationAction.
        +
        +
      • +
      + + + +
        +
      • +

        getBuildscript

        +
        ScriptHandler getBuildscript()
        +
        Returns the script handler for this script. You can use this handler to manage the classpath used to compile and + execute this script.
        +
        +
        Returns:
        +
        the classpath handler. Never returns null.
        +
        +
      • +
      + + + +
        +
      • +

        buildscript

        +
        void buildscript​(Closure configureClosure)
        +
        Configures the classpath for this script. + +

        The given closure is executed against this script's ScriptHandler. The ScriptHandler is passed + to the closure as the closure's delegate.

        +
        +
        Parameters:
        +
        configureClosure - the closure to use to configure the script classpath.
        +
        +
      • +
      + + + +
        +
      • +

        file

        +
        File file​(Object path)
        +

        Resolves a file path relative to the directory containing this script. This works as described for Project.file(Object)

        +
        +
        Parameters:
        +
        path - The object to resolve as a File.
        +
        Returns:
        +
        The resolved file. Never returns null.
        +
        +
      • +
      + + + +
        +
      • +

        file

        +
        File file​(Object path,
        +          PathValidation validation)
        +   throws InvalidUserDataException
        +

        Resolves a file path relative to the directory containing this script and validates it using the given scheme. + See PathValidation for the list of possible validations.

        +
        +
        Parameters:
        +
        path - An object to resolve as a File.
        +
        validation - The validation to perform on the file.
        +
        Returns:
        +
        The resolved file. Never returns null.
        +
        Throws:
        +
        InvalidUserDataException - When the file does not meet the given validation constraint.
        +
        +
      • +
      + + + +
        +
      • +

        uri

        +
        URI uri​(Object path)
        +

        Resolves a file path to a URI, relative to the directory containing this script. Evaluates the provided path + object as described for file(Object), with the exception that any URI scheme is supported, not just + 'file:' URIs.

        +
        +
        Parameters:
        +
        path - The object to resolve as a URI.
        +
        Returns:
        +
        The resolved URI. Never returns null.
        +
        +
      • +
      + + + + + + + +
        +
      • +

        files

        +
        ConfigurableFileCollection files​(Object paths,
        +                                 Closure configureClosure)
        +

        Creates a new ConfigurableFileCollection using the given paths. The file collection is configured + using the given closure. This method works as described for Project.files(Object, groovy.lang.Closure). + Relative paths are resolved relative to the directory containing this script.

        +
        +
        Parameters:
        +
        paths - The contents of the file collection. Evaluated as per files(Object...).
        +
        configureClosure - The closure to use to configure the file collection.
        +
        Returns:
        +
        the configured file tree. Never returns null.
        +
        +
      • +
      + + + +
        +
      • +

        relativePath

        +
        String relativePath​(Object path)
        +

        Returns the relative path from the directory containing this script to the given path. The given path object + is (logically) resolved as described for file(Object), from which a relative path is calculated.

        +
        +
        Parameters:
        +
        path - The path to convert to a relative path.
        +
        Returns:
        +
        The relative path. Never returns null.
        +
        +
      • +
      + + + +
        +
      • +

        fileTree

        +
        ConfigurableFileTree fileTree​(Object baseDir)
        +

        Creates a new ConfigurableFileTree using the given base directory. The given baseDir path is evaluated + as per file(Object).

        + +

        The returned file tree is lazy, so that it scans for files only when the contents of the file tree are + queried. The file tree is also live, so that it scans for files each time the contents of the file tree are + queried.

        +
        +
        Parameters:
        +
        baseDir - The base directory of the file tree. Evaluated as per file(Object).
        +
        Returns:
        +
        the file tree. Never returns null.
        +
        +
      • +
      + + + +
        +
      • +

        fileTree

        +
        ConfigurableFileTree fileTree​(Map<String,​?> args)
        +

        Creates a new ConfigurableFileTree using the provided map of arguments. The map will be applied as + properties on the new file tree. Example:

        +
        + fileTree(dir:'src', excludes:['**/ignore/**','**/.svn/**'])
        + 
        +

        The returned file tree is lazy, so that it scans for files only when the contents of the file tree are + queried. The file tree is also live, so that it scans for files each time the contents of the file tree are + queried.

        +
        +
        Parameters:
        +
        args - map of property assignments to ConfigurableFileTree object
        +
        Returns:
        +
        the configured file tree. Never returns null.
        +
        +
      • +
      + + + +
        +
      • +

        fileTree

        +
        ConfigurableFileTree fileTree​(Object baseDir,
        +                              Closure configureClosure)
        +

        Creates a new ConfigurableFileTree using the given base directory. The given baseDir path is evaluated + as per file(Object). The closure will be used to configure the new file tree. + The file tree is passed to the closure as its delegate. Example:

        + +
        + fileTree('src') {
        +    exclude '**/.svn/**'
        + }.copy { into 'dest'}
        + 
        + +

        The returned file tree is lazy, so that it scans for files only when the contents of the file tree are + queried. The file tree is also live, so that it scans for files each time the contents of the file tree are + queried.

        +
        +
        Parameters:
        +
        baseDir - The base directory of the file tree. Evaluated as per file(Object).
        +
        configureClosure - Closure to configure the ConfigurableFileTree object.
        +
        Returns:
        +
        the configured file tree. Never returns null.
        +
        +
      • +
      + + + +
        +
      • +

        zipTree

        +
        FileTree zipTree​(Object zipPath)
        +

        Creates a new FileTree which contains the contents of the given ZIP file. The given zipPath path is + evaluated as per file(Object). You can combine this method with the copy(groovy.lang.Closure) + method to unzip a ZIP file.

        + +

        The returned file tree is lazy, so that it scans for files only when the contents of the file tree are + queried. The file tree is also live, so that it scans for files each time the contents of the file tree are + queried.

        +
        +
        Parameters:
        +
        zipPath - The ZIP file. Evaluated as per file(Object).
        +
        Returns:
        +
        the file tree. Never returns null.
        +
        +
      • +
      + + + +
        +
      • +

        tarTree

        +
        FileTree tarTree​(Object tarPath)
        +
        Creates a new FileTree which contains the contents of the given TAR file. The given tarPath path can be: + + + The returned file tree is lazy, so that it scans for files only when the contents of the file tree are + queried. The file tree is also live, so that it scans for files each time the contents of the file tree are + queried. +

        + Unless custom implementation of resources is passed, the tar tree attempts to guess the compression based on the file extension. +

        + You can combine this method with the copy(groovy.lang.Closure) + method to untar a TAR file: + +

        + task untar(type: Copy) {
        +   from tarTree('someCompressedTar.gzip')
        +
        +   //tar tree attempts to guess the compression based on the file extension
        +   //however if you must specify the compression explicitly you can:
        +   from tarTree(resources.gzip('someTar.ext'))
        +
        +   //in case you work with unconventionally compressed tars
        +   //you can provide your own implementation of a ReadableResource:
        +   //from tarTree(yourOwnResource as ReadableResource)
        +
        +   into 'dest'
        + }
        + 
        +
        +
        Parameters:
        +
        tarPath - The TAR file or an instance of Resource.
        +
        Returns:
        +
        the file tree. Never returns null.
        +
        +
      • +
      + + + +
        +
      • +

        copy

        +
        WorkResult copy​(Closure closure)
        +
        Copy the specified files. The given closure is used to configure a CopySpec, which + is then used to copy the files. Example: +
        + copy {
        +    from configurations.runtimeClasspath
        +    into 'build/deploy/lib'
        + }
        + 
        + Note that CopySpecs can be nested: +
        + copy {
        +    into 'build/webroot'
        +    exclude '**/.svn/**'
        +    from('src/main/webapp') {
        +       include '**/*.jsp'
        +       filter(ReplaceTokens, tokens:[copyright:'2009', version:'2.3.1'])
        +    }
        +    from('src/main/js') {
        +       include '**/*.js'
        +    }
        + }
        + 
        +
        +
        Parameters:
        +
        closure - Closure to configure the CopySpec
        +
        Returns:
        +
        WorkResult that can be used to check if the copy did any work.
        +
        +
      • +
      + + + +
        +
      • +

        copySpec

        +
        CopySpec copySpec​(Closure closure)
        +
        Creates a CopySpec which can later be used to copy files or create an archive. The + given closure is used to configure the CopySpec before it is returned by this + method.
        +
        +
        Parameters:
        +
        closure - Closure to configure the CopySpec
        +
        Returns:
        +
        The CopySpec
        +
        +
      • +
      + + + +
        +
      • +

        mkdir

        +
        File mkdir​(Object path)
        +
        Creates a directory and returns a file pointing to it.
        +
        +
        Parameters:
        +
        path - The path for the directory to be created. Evaluated as per file(Object).
        +
        Returns:
        +
        the created directory
        +
        Throws:
        +
        InvalidUserDataException - If the path points to an existing file.
        +
        +
      • +
      + + + +
        +
      • +

        delete

        +
        boolean delete​(Object... paths)
        +
        Deletes files and directories.
        +
        +
        Parameters:
        +
        paths - Any type of object accepted by Project.files(Object...)
        +
        Returns:
        +
        true if anything got deleted, false otherwise
        +
        +
      • +
      + + + +
        +
      • +

        javaexec

        +
        ExecResult javaexec​(Closure closure)
        +
        Executes a Java main class. The closure configures a JavaExecSpec.
        +
        +
        Parameters:
        +
        closure - The closure for configuring the execution.
        +
        Returns:
        +
        the result of the execution
        +
        +
      • +
      + + + +
        +
      • +

        javaexec

        +
        ExecResult javaexec​(Action<? super JavaExecSpec> action)
        +
        Executes a Java main class.
        +
        +
        Parameters:
        +
        action - The action for configuring the execution.
        +
        Returns:
        +
        the result of the execution
        +
        +
      • +
      + + + +
        +
      • +

        exec

        +
        ExecResult exec​(Closure closure)
        +
        Executes an external command. The closure configures a ExecSpec.
        +
        +
        Parameters:
        +
        closure - The closure for configuring the execution.
        +
        Returns:
        +
        the result of the execution
        +
        +
      • +
      + + + +
        +
      • +

        exec

        +
        ExecResult exec​(Action<? super ExecSpec> action)
        +
        Executes an external command.
        +
        +
        Parameters:
        +
        action - The action for configuring the execution.
        +
        Returns:
        +
        the result of the execution
        +
        +
      • +
      + + + +
        +
      • +

        getLogging

        +
        LoggingManager getLogging()
        +
        Returns the LoggingManager which can be used to receive logging and to control the + standard output/error capture for this script. By default, System.out is redirected to the Gradle logging system + at the QUIET log level, and System.err is redirected at the ERROR log level.
        +
        +
        Returns:
        +
        the LoggingManager. Never returns null.
        +
        +
      • +
      + + + +
        +
      • +

        getLogger

        +
        Logger getLogger()
        +
        Returns the logger for this script. You can use this in your script to write log messages.
        +
        +
        Returns:
        +
        The logger. Never returns null.
        +
        +
      • +
      + + + +
        +
      • +

        getResources

        +
        ResourceHandler getResources()
        +
        Provides access to resource-specific utility methods, for example factory methods that create various resources.
        +
        +
        Returns:
        +
        Returned instance contains various resource-specific utility methods.
        +
        +
      • +
      + + + +
        +
      • +

        provider

        +
        <T> Provider<T> provider​(Callable<T> value)
        +
        Creates a Provider implementation based on the provided value.
        +
        +
        Parameters:
        +
        value - The java.util.concurrent.Callable use to calculate the value.
        +
        Returns:
        +
        The provider. Never returns null.
        +
        Throws:
        +
        InvalidUserDataException - If the provided value is null.
        +
        Since:
        +
        4.0
        +
        See Also:
        +
        ProviderFactory.provider(Callable)
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/artifacts/ExternalModuleDependency.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/artifacts/ExternalModuleDependency.html new file mode 100644 index 0000000..78e132b --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/artifacts/ExternalModuleDependency.html @@ -0,0 +1,346 @@ + + + + + +ExternalModuleDependency (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface ExternalModuleDependency

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        isChanging

        +
        boolean isChanging()
        +
        Returns whether or not Gradle should always check for a change in the remote repository.
        +
        +
        See Also:
        +
        setChanging(boolean)
        +
        +
      • +
      + + + +
        +
      • +

        setChanging

        +
        ExternalModuleDependency setChanging​(boolean changing)
        +
        Sets whether or not Gradle should always check for a change in the remote repository. If set to true, Gradle will + check the remote repository even if a dependency with the same version is already in the local cache. Defaults to + false.
        +
        +
        Parameters:
        +
        changing - Whether or not Gradle should always check for a change in the remote repository
        +
        Returns:
        +
        this
        +
        +
      • +
      + + + + +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/artifacts/component/ComponentSelector.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/artifacts/component/ComponentSelector.html new file mode 100644 index 0000000..447d1ef --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/artifacts/component/ComponentSelector.html @@ -0,0 +1,325 @@ + + + + + +ComponentSelector (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface ComponentSelector

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getDisplayName

        +
        String getDisplayName()
        +
        Returns a human-consumable display name for this selector.
        +
        +
        Returns:
        +
        Display name
        +
        Since:
        +
        1.10
        +
        +
      • +
      + + + +
        +
      • +

        matchesStrictly

        +
        boolean matchesStrictly​(ComponentIdentifier identifier)
        +
        Checks if selector matches component identifier.
        +
        +
        Parameters:
        +
        identifier - Component identifier
        +
        Returns:
        +
        if this selector matches exactly the given component identifier.
        +
        Since:
        +
        1.10
        +
        +
      • +
      + + + +
        +
      • +

        getAttributes

        +
        AttributeContainer getAttributes()
        +
        The attributes of the module to select the component from. The attributes only include + selector specific attributes. This means it typically doesn't include any consumer specific attribute.
        +
        +
        Returns:
        +
        the attributes
        +
        Since:
        +
        4.9
        +
        +
      • +
      + + + +
        +
      • +

        getRequestedCapabilities

        +
        List<Capability> getRequestedCapabilities()
        +
        The requested capabilities.
        +
        +
        Returns:
        +
        the requested capabilities. If returning an empty list, the implicit capability will be used.
        +
        Since:
        +
        5.3
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/artifacts/maven/PomFilterContainer.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/artifacts/maven/PomFilterContainer.html new file mode 100644 index 0000000..2f6257a --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/artifacts/maven/PomFilterContainer.html @@ -0,0 +1,631 @@ + + + + + +PomFilterContainer (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface PomFilterContainer

+
+
+
+ +
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + + + + + + + + + +
        +
      • +

        getPom

        +
        MavenPom getPom()
        +
        Deprecated.
        +
        Returns the POM property of the custom filter. + The POM property can be used to customize the POM generation. By default the properties of such a POM object are all null. + Null means that Gradle will use default values for generating the Maven POM. Those default values are derived from the deployable artifact + and from the project type (e.g. java, war, ...). If you explicitly set a POM property, Gradle will use those instead.
        +
        +
        Returns:
        +
        The Maven Pom
        +
        +
      • +
      + + + +
        +
      • +

        setPom

        +
        void setPom​(MavenPom defaultPom)
        +
        Deprecated.
        +

        Sets the default POM to be used. This POM is active if no custom filters have been added (see addFilter(String, org.gradle.api.artifacts.maven.PublishFilter)). + If at least one custom filter has been added the default POM is not used any longer.

        +

        Usually you don't need to set this property as the default value provides you a POM object you might use for configuration. + By default the properties of such a POM object are all null. + If they are null, Gradle will use default values for generating the Maven POM. Those default values are derived from the deployable artifact + and from the project type (e.g. java, war, ...). If you explicitly set a POM property, Gradle will use this instead.

        +
      • +
      + + + +
        +
      • +

        addFilter

        +
        MavenPom addFilter​(String name,
        +                   PublishFilter publishFilter)
        +
        Deprecated.
        +
        If you want to deploy more than one artifact you need to define filters to select each of those artifacts. The method + returns a POM object associated with this filter, that allows you to customize the POM generation for the artifact selected + by the filter.
        +
        +
        Parameters:
        +
        name - The name of the filter
        +
        publishFilter - The filter to use
        +
        Returns:
        +
        The POM associated with the filter
        +
        +
      • +
      + + + + + + + + + + + + + + + + + + + +
        +
      • +

        pom

        +
        MavenPom pom​(String name,
        +             Closure configureClosure)
        +
        Deprecated.
        +
        Configures a POM by a closure. The closure statements are delegated to the POM object associated with the given name.
        +
        +
        Returns:
        +
        The POM object associated with the given name.
        +
        See Also:
        +
        pom(String)
        +
        +
      • +
      + + + +
        +
      • +

        pom

        +
        MavenPom pom​(Closure configureClosure)
        +
        Deprecated.
        +
        Configures the default POM by a closure. The closure statements are delegated to the default POM.
        +
        +
        Returns:
        +
        The default POM.
        +
        See Also:
        +
        getPom()
        +
        +
      • +
      + + + +
        +
      • +

        pom

        +
        MavenPom pom​(String name,
        +             Action<? super MavenPom> configureAction)
        +
        Deprecated.
        +
        Configures a POM by an action. The action is executed against the POM object associated with the given name.
        +
        +
        Returns:
        +
        The POM object associated with the given name.
        +
        Since:
        +
        4.2
        +
        See Also:
        +
        pom(String)
        +
        +
      • +
      + + + +
        +
      • +

        pom

        +
        MavenPom pom​(Action<? super MavenPom> configureAction)
        +
        Deprecated.
        +
        Configures the default POM by an action.
        +
        +
        Returns:
        +
        The default POM.
        +
        Since:
        +
        4.2
        +
        See Also:
        +
        getPom()
        +
        +
      • +
      + + + +
        +
      • +

        getActivePomFilters

        +
        Iterable<org.gradle.api.publication.maven.internal.PomFilter> getActivePomFilters()
        +
        Deprecated.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/artifacts/repositories/RepositoryResourceAccessor.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/artifacts/repositories/RepositoryResourceAccessor.html new file mode 100644 index 0000000..04da69e --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/artifacts/repositories/RepositoryResourceAccessor.html @@ -0,0 +1,251 @@ + + + + + +RepositoryResourceAccessor (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface RepositoryResourceAccessor

+
+
+
+
    +
  • +
    +
    public interface RepositoryResourceAccessor
    +
    Provides access to resources on an artifact repository. Gradle takes care of caching + the resources locally. The scope of the cache may depend on the accessor: users should + refer to the javadocs of the methods providing an accessor to determine the scope.
    +
    +
    Since:
    +
    4.0
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        withResource

        +
        void withResource​(String relativePath,
        +                  Action<? super InputStream> action)
        +
        Perform an action on the contents of a remote resource.
        +
        +
        Parameters:
        +
        relativePath - path to the resource, relative to the base URI of the repository
        +
        action - action to execute on the resource
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/artifacts/result/ComponentSelectionDescriptor.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/artifacts/result/ComponentSelectionDescriptor.html new file mode 100644 index 0000000..46b3cd4 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/artifacts/result/ComponentSelectionDescriptor.html @@ -0,0 +1,268 @@ + + + + + +ComponentSelectionDescriptor (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface ComponentSelectionDescriptor

+
+
+
+
    +
  • +
    +
    public interface ComponentSelectionDescriptor
    +
    A component selection description, which wraps a cause with an optional custom description.
    +
    +
    Since:
    +
    4.6
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getCause

        +
        ComponentSelectionCause getCause()
        +
        Returns the cause associated with this descriptor
        +
        +
        Returns:
        +
        a component selection cause
        +
        +
      • +
      + + + +
        +
      • +

        getDescription

        +
        String getDescription()
        +
        Returns a description for the selection. This may be the default description of a cause, + or a custom description provided typically through a rule.
        +
        +
        Returns:
        +
        the description of this component selection
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/artifacts/verification/DependencyVerificationMode.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/artifacts/verification/DependencyVerificationMode.html new file mode 100644 index 0000000..70c5183 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/artifacts/verification/DependencyVerificationMode.html @@ -0,0 +1,389 @@ + + + + + +DependencyVerificationMode (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Enum DependencyVerificationMode

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Serializable, Comparable<DependencyVerificationMode>
    +
    +
    +
    @Incubating
    +public enum DependencyVerificationMode
    +extends Enum<DependencyVerificationMode>
    +
    The different dependency verification modes. By default, Gradle + will use the strict mode, which means that it will verify dependencies + and fail as soon as possible, to avoid as much compromising of + the builds as possible. + + There are, however, two additional modes which can be used: the lenient + one will collect all errors but only log them to the CLI. This is useful + when updating the file and you want to collect as many errors as possible + before failing. + + The last one is "off", meaning that even if verification metadata is + present, Gradle will not perform any verification. This can typically + be used whenever verification should only happen on CI.
    +
    +
    Since:
    +
    6.2
    +
    +
  • +
+
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static DependencyVerificationMode[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (DependencyVerificationMode c : DependencyVerificationMode.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static DependencyVerificationMode valueOf​(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/execution/TaskExecutionGraphListener.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/execution/TaskExecutionGraphListener.html new file mode 100644 index 0000000..9a57d82 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/execution/TaskExecutionGraphListener.html @@ -0,0 +1,246 @@ + + + + + +TaskExecutionGraphListener (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface TaskExecutionGraphListener

+
+
+
+
    +
  • +
    +
    public interface TaskExecutionGraphListener
    +

    A TaskExecutionGraphListener is notified when the TaskExecutionGraph has been populated. You can + use this interface in your build file to perform some action based on the contents of the graph, before any tasks are + actually executed.

    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        graphPopulated

        +
        void graphPopulated​(TaskExecutionGraph graph)
        +

        This method is called when the TaskExecutionGraph has been populated, and before any tasks are + executed.

        +
        +
        Parameters:
        +
        graph - The graph. Never null.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/plugins/ApplicationPlugin.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/plugins/ApplicationPlugin.html new file mode 100644 index 0000000..fc0687a --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/plugins/ApplicationPlugin.html @@ -0,0 +1,436 @@ + + + + + +ApplicationPlugin (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class ApplicationPlugin

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/plugins/quality/CodeQualityExtension.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/plugins/quality/CodeQualityExtension.html new file mode 100644 index 0000000..530cdad --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/plugins/quality/CodeQualityExtension.html @@ -0,0 +1,417 @@ + + + + + +CodeQualityExtension (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class CodeQualityExtension

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.gradle.api.plugins.quality.CodeQualityExtension
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CodeQualityExtension

        +
        public CodeQualityExtension()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getToolVersion

        +
        public String getToolVersion()
        +
        The version of the code quality tool to be used.
        +
      • +
      + + + +
        +
      • +

        setToolVersion

        +
        public void setToolVersion​(String toolVersion)
        +
        The version of the code quality tool to be used.
        +
      • +
      + + + +
        +
      • +

        getSourceSets

        +
        public Collection<SourceSet> getSourceSets()
        +
        The source sets to be analyzed as part of the check and build tasks.
        +
      • +
      + + + +
        +
      • +

        setSourceSets

        +
        public void setSourceSets​(Collection<SourceSet> sourceSets)
        +
        The source sets to be analyzed as part of the check and build tasks.
        +
      • +
      + + + +
        +
      • +

        isIgnoreFailures

        +
        public boolean isIgnoreFailures()
        +
        Whether to allow the build to continue if there are warnings. + + Example: ignoreFailures = true
        +
      • +
      + + + +
        +
      • +

        setIgnoreFailures

        +
        public void setIgnoreFailures​(boolean ignoreFailures)
        +
        Whether to allow the build to continue if there are warnings. + + Example: ignoreFailures = true
        +
      • +
      + + + +
        +
      • +

        getReportsDir

        +
        public File getReportsDir()
        +
        The directory where reports will be generated.
        +
      • +
      + + + +
        +
      • +

        setReportsDir

        +
        public void setReportsDir​(File reportsDir)
        +
        The directory where reports will be generated.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/publish/ivy/IvyModuleDescriptorAuthor.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/publish/ivy/IvyModuleDescriptorAuthor.html new file mode 100644 index 0000000..59c095a --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/publish/ivy/IvyModuleDescriptorAuthor.html @@ -0,0 +1,261 @@ + + + + + +IvyModuleDescriptorAuthor (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface IvyModuleDescriptorAuthor

+
+
+
+
    +
  • +
    +
    public interface IvyModuleDescriptorAuthor
    +
    An author of an Ivy publication.
    +
    +
    Since:
    +
    4.8
    +
    See Also:
    +
    IvyModuleDescriptorSpec
    +
    +
  • +
+
+
+ +
+
+ +
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/publish/ivy/IvyModuleDescriptorDescription.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/publish/ivy/IvyModuleDescriptorDescription.html new file mode 100644 index 0000000..921f529 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/publish/ivy/IvyModuleDescriptorDescription.html @@ -0,0 +1,261 @@ + + + + + +IvyModuleDescriptorDescription (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface IvyModuleDescriptorDescription

+
+
+
+
    +
  • +
    +
    public interface IvyModuleDescriptorDescription
    +
    The description of an Ivy publication.
    +
    +
    Since:
    +
    4.8
    +
    See Also:
    +
    IvyModuleDescriptorSpec
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getText

        +
        Property<String> getText()
        +
        The text of this description.
        +
      • +
      + + + +
        +
      • +

        getHomepage

        +
        Property<String> getHomepage()
        +
        The homepage of the publication of this description.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/reporting/ConfigurableReport.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/reporting/ConfigurableReport.html new file mode 100644 index 0000000..69b3805 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/reporting/ConfigurableReport.html @@ -0,0 +1,376 @@ + + + + + +ConfigurableReport (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface ConfigurableReport

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setEnabled

        +
        void setEnabled​(boolean enabled)
        +
        Whether or not this report should be generated by whatever generates it.
        +
        +
        Specified by:
        +
        setEnabled in interface Report
        +
        Parameters:
        +
        enabled - Whether or not this report should be generated by whatever generates it.
        +
        Since:
        +
        4.0
        +
        See Also:
        +
        Report.isEnabled()
        +
        +
      • +
      + + + +
        +
      • +

        setEnabled

        +
        void setEnabled​(Provider<Boolean> enabled)
        +
        Whether or not this report should be generated by whatever generates it.
        +
        +
        Parameters:
        +
        enabled - Provider for indicating whether or not this report should be generated by whatever generates it.
        +
        Since:
        +
        4.0
        +
        See Also:
        +
        Report.isEnabled()
        +
        +
      • +
      + + + +
        +
      • +

        setDestination

        +
        void setDestination​(File file)
        +
        Sets the destination for the report.
        +
        +
        Parameters:
        +
        file - The destination for the report.
        +
        Since:
        +
        4.0
        +
        See Also:
        +
        Report.getDestination()
        +
        +
      • +
      + + + +
        +
      • +

        setDestination

        +
        void setDestination​(Provider<File> provider)
        +
        Sets the destination for the report.
        +
        +
        Parameters:
        +
        provider - The provider of the destination for the report.
        +
        Since:
        +
        4.0
        +
        See Also:
        +
        Report.getDestination()
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/tasks/GroovyRuntime.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/tasks/GroovyRuntime.html new file mode 100644 index 0000000..de60e9f --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/tasks/GroovyRuntime.html @@ -0,0 +1,322 @@ + + + + + +GroovyRuntime (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class GroovyRuntime

+
+
+ +
+
    +
  • +
    +
    public class GroovyRuntime
    +extends Object
    +
    Provides information related to the Groovy runtime(s) used in a project. Added by the + GroovyBasePlugin as a project extension named groovyRuntime. + +

    Example usage: + +

    +     plugins {
    +         id 'groovy'
    +     }
    +
    +     repositories {
    +         mavenCentral()
    +     }
    +
    +     dependencies {
    +         implementation "org.codehaus.groovy:groovy-all:2.1.2"
    +     }
    +
    +     def groovyClasspath = groovyRuntime.inferGroovyClasspath(configurations.compile)
    +     // The returned class path can be used to configure the 'groovyClasspath' property of tasks
    +     // such as 'GroovyCompile' or 'Groovydoc', or to execute these and other Groovy tools directly.
    + 
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        GroovyRuntime

        +
        public GroovyRuntime​(Project project)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        inferGroovyClasspath

        +
        public FileCollection inferGroovyClasspath​(Iterable<File> classpath)
        +
        Searches the specified class path for Groovy Jars (groovy(-indy), groovy-all(-indy)) and returns a corresponding class path for executing Groovy tools such as the Groovy + compiler and Groovydoc tool. The tool versions will match those of the Groovy Jars found. If no Groovy Jars are found on the specified class path, a class path with the contents of the + groovy configuration will be returned. + +

        The returned class path may be empty, or may fail to resolve when asked for its contents.

        +
        +
        Parameters:
        +
        classpath - a class path containing Groovy Jars
        +
        Returns:
        +
        a corresponding class path for executing Groovy tools such as the Groovy compiler and Groovydoc tool
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/tasks/TaskFilePropertyBuilder.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/tasks/TaskFilePropertyBuilder.html new file mode 100644 index 0000000..7750668 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/tasks/TaskFilePropertyBuilder.html @@ -0,0 +1,254 @@ + + + + + +TaskFilePropertyBuilder (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface TaskFilePropertyBuilder

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        withPropertyName

        +
        TaskFilePropertyBuilder withPropertyName​(String propertyName)
        +
        Sets the name for this property. The name must be a non-empty string. + +

        If the method is not called, or if it is called with null, a name + will be assigned to the property automatically.

        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/tasks/testing/TestResult.ResultType.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/tasks/testing/TestResult.ResultType.html new file mode 100644 index 0000000..af1239e --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/tasks/testing/TestResult.ResultType.html @@ -0,0 +1,376 @@ + + + + + +TestResult.ResultType (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Enum TestResult.ResultType

+
+
+ +
+ +
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static TestResult.ResultType[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (TestResult.ResultType c : TestResult.ResultType.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static TestResult.ResultType valueOf​(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/tasks/testing/junit/package-summary.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/tasks/testing/junit/package-summary.html new file mode 100644 index 0000000..dfe68d5 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/api/tasks/testing/junit/package-summary.html @@ -0,0 +1,159 @@ + + + + + +org.gradle.api.tasks.testing.junit (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + +
+

Package org.gradle.api.tasks.testing.junit

+
+
+ + +
JUnit specific testing classes.
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    JUnitOptions +
    The JUnit specific test options.
    +
    +
  • +
+
+ + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/buildinit/tasks/InitBuild.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/buildinit/tasks/InitBuild.html new file mode 100644 index 0000000..d2457cd --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/buildinit/tasks/InitBuild.html @@ -0,0 +1,656 @@ + + + + + +InitBuild (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class InitBuild

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, ExtensionAware, Task, org.gradle.util.Configurable<Task>
    +
    +
    +
    public class InitBuild
    +extends DefaultTask
    +
    Generates a Gradle project structure.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        InitBuild

        +
        public InitBuild()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getType

        +
        @Input
        +public String getType()
        +
        The desired type of project to generate, defaults to 'pom' if a 'pom.xml' is found in the project root and if no 'pom.xml' is found, it defaults to 'basic'. + + This property can be set via command-line option '--type'.
        +
      • +
      + + + +
        +
      • +

        getSplitProject

        +
        @Incubating
        +@Input
        +@Optional
        +public Property<Boolean> getSplitProject()
        +
        Should the build be split into multiple subprojects? + + This property can be set via command-line option '--split-project'.
        +
        +
        Since:
        +
        6.7
        +
        +
      • +
      + + + +
        +
      • +

        getDsl

        +
        @Optional
        +@Input
        +public String getDsl()
        +
        The desired DSL of build scripts to create, defaults to 'groovy'. + + This property can be set via command-line option '--dsl'.
        +
        +
        Since:
        +
        4.5
        +
        +
      • +
      + + + +
        +
      • +

        getProjectName

        +
        @Input
        +public String getProjectName()
        +
        The name of the generated project, defaults to the name of the directory the project is generated in. + + This property can be set via command-line option '--project-name'.
        +
        +
        Since:
        +
        5.0
        +
        +
      • +
      + + + +
        +
      • +

        getPackageName

        +
        @Input
        +public String getPackageName()
        +
        The name of the package to use for generated source. + + This property can be set via command-line option '--package'.
        +
        +
        Since:
        +
        5.0
        +
        +
      • +
      + + + +
        +
      • +

        getTestFramework

        +
        @Nullable
        +@Optional
        +@Input
        +public String getTestFramework()
        +
        The test framework to be used in the generated project. + + This property can be set via command-line option '--test-framework'
        +
      • +
      + + + +
        +
      • +

        getProjectLayoutRegistry

        +
        public org.gradle.buildinit.plugins.internal.ProjectLayoutSetupRegistry getProjectLayoutRegistry()
        +
      • +
      + + + +
        +
      • +

        setupProjectLayout

        +
        public void setupProjectLayout()
        +
      • +
      + + + +
        +
      • +

        setType

        +
        public void setType​(String type)
        +
      • +
      + + + +
        +
      • +

        getAvailableBuildTypes

        +
        public List<String> getAvailableBuildTypes()
        +
      • +
      + + + +
        +
      • +

        setDsl

        +
        public void setDsl​(String dsl)
        +
        Set the build script DSL to be used.
        +
        +
        Since:
        +
        4.5
        +
        +
      • +
      + + + +
        +
      • +

        getAvailableDSLs

        +
        public List<String> getAvailableDSLs()
        +
        Available build script DSLs to be used.
        +
        +
        Since:
        +
        4.5
        +
        +
      • +
      + + + +
        +
      • +

        setTestFramework

        +
        public void setTestFramework​(@Nullable
        +                             String testFramework)
        +
        Set the test framework to be used.
        +
      • +
      + + + +
        +
      • +

        getAvailableTestFrameworks

        +
        public List<String> getAvailableTestFrameworks()
        +
        Available test frameworks.
        +
      • +
      + + + +
        +
      • +

        setProjectName

        +
        public void setProjectName​(String projectName)
        +
        Set the project name.
        +
        +
        Since:
        +
        5.0
        +
        +
      • +
      + + + +
        +
      • +

        setPackageName

        +
        public void setPackageName​(String packageName)
        +
        Set the package name.
        +
        +
        Since:
        +
        5.0
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/caching/configuration/BuildCache.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/caching/configuration/BuildCache.html new file mode 100644 index 0000000..c336fcc --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/caching/configuration/BuildCache.html @@ -0,0 +1,297 @@ + + + + + +BuildCache (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface BuildCache

+
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethodDescription
      booleanisEnabled() +
      Returns whether the build cache is enabled.
      +
      booleanisPush() +
      Returns whether a given build can store outputs in the build cache.
      +
      voidsetEnabled​(boolean enabled) +
      Sets whether the build cache is enabled.
      +
      voidsetPush​(boolean enabled) +
      Sets whether a given build can store outputs in the build cache.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        isEnabled

        +
        boolean isEnabled()
        +
        Returns whether the build cache is enabled.
        +
      • +
      + + + +
        +
      • +

        setEnabled

        +
        void setEnabled​(boolean enabled)
        +
        Sets whether the build cache is enabled.
        +
      • +
      + + + +
        +
      • +

        isPush

        +
        boolean isPush()
        +
        Returns whether a given build can store outputs in the build cache.
        +
      • +
      + + + +
        +
      • +

        setPush

        +
        void setPush​(boolean enabled)
        +
        Sets whether a given build can store outputs in the build cache.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/caching/configuration/package-tree.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/caching/configuration/package-tree.html new file mode 100644 index 0000000..63d152e --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/caching/configuration/package-tree.html @@ -0,0 +1,158 @@ + + + + + +org.gradle.caching.configuration Class Hierarchy (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + +
+

Hierarchy For Package org.gradle.caching.configuration

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+
    +
  • org.gradle.caching.configuration.BuildCache
  • +
  • org.gradle.caching.configuration.CompatibilitySupportForBuildCacheConfiguration + +
  • +
+
+ + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/concurrent/package-summary.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/concurrent/package-summary.html new file mode 100644 index 0000000..ed1cfcc --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/concurrent/package-summary.html @@ -0,0 +1,159 @@ + + + + + +org.gradle.concurrent (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + +
+

Package org.gradle.concurrent

+
+
+ + +
Classes related to Gradle parallelism and concurrency.
+
    +
  • + + + + + + + + + + + + +
    Interface Summary 
    InterfaceDescription
    ParallelismConfiguration +
    A ParallelismConfiguration defines the parallel settings for a Gradle build.
    +
    +
  • +
+
+ + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/language/jvm/tasks/package-tree.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/language/jvm/tasks/package-tree.html new file mode 100644 index 0000000..f521fae --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/language/jvm/tasks/package-tree.html @@ -0,0 +1,169 @@ + + + + + +org.gradle.language.jvm.tasks Class Hierarchy (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + +
+

Hierarchy For Package org.gradle.language.jvm.tasks

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • org.gradle.api.internal.AbstractTask (implements org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal) +
        +
      • org.gradle.api.DefaultTask (implements org.gradle.api.Task) +
          +
        • org.gradle.api.internal.ConventionTask (implements org.gradle.api.internal.IConventionAware) +
            +
          • org.gradle.api.tasks.AbstractCopyTask (implements org.gradle.api.file.CopySpec, org.gradle.api.internal.file.copy.CopySpecSource) + +
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+ + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/language/rc/plugins/WindowsResourceScriptPlugin.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/language/rc/plugins/WindowsResourceScriptPlugin.html new file mode 100644 index 0000000..2c73de9 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/language/rc/plugins/WindowsResourceScriptPlugin.html @@ -0,0 +1,303 @@ + + + + + +WindowsResourceScriptPlugin (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class WindowsResourceScriptPlugin

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.gradle.language.rc.plugins.WindowsResourceScriptPlugin
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Plugin<Project>
    +
    +
    +
    @Incubating
    +public class WindowsResourceScriptPlugin
    +extends Object
    +implements Plugin<Project>
    +
    Adds core language support for Windows resource script files.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        WindowsResourceScriptPlugin

        +
        public WindowsResourceScriptPlugin()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        apply

        +
        public void apply​(Project project)
        +
        Description copied from interface: Plugin
        +
        Apply this plugin to the given target object.
        +
        +
        Specified by:
        +
        apply in interface Plugin<Project>
        +
        Parameters:
        +
        project - The target object
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/language/swift/tasks/SwiftCompile.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/language/swift/tasks/SwiftCompile.html new file mode 100644 index 0000000..d3203a0 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/language/swift/tasks/SwiftCompile.html @@ -0,0 +1,690 @@ + + + + + +SwiftCompile (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class SwiftCompile

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, ExtensionAware, Task, org.gradle.util.Configurable<Task>
    +
    +
    +
    @CacheableTask
    +public class SwiftCompile
    +extends DefaultTask
    +
    Compiles Swift source files into object files.
    +
    +
    Since:
    +
    4.1
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        SwiftCompile

        +
        @Inject
        +public SwiftCompile​(org.gradle.nativeplatform.internal.CompilerOutputFileNamingSchemeFactory compilerOutputFileNamingSchemeFactory,
        +                    org.gradle.internal.file.Deleter deleter)
        +
      • +
      +
    • +
    + + +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/model/ConfigurationCycleException.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/model/ConfigurationCycleException.html new file mode 100644 index 0000000..7405b57 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/model/ConfigurationCycleException.html @@ -0,0 +1,287 @@ + + + + + +ConfigurationCycleException (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class ConfigurationCycleException

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ConfigurationCycleException

        +
        public ConfigurationCycleException​(String message)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/nativeplatform/tasks/package-summary.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/nativeplatform/tasks/package-summary.html new file mode 100644 index 0000000..1a4564a --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/nativeplatform/tasks/package-summary.html @@ -0,0 +1,224 @@ + + + + + +org.gradle.nativeplatform.tasks (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + +
+

Package org.gradle.nativeplatform.tasks

+
+
+ + +
Tasks for building native component projects.
+
    +
  • + + + + + + + + + + + + +
    Interface Summary 
    InterfaceDescription
    ObjectFilesToBinary +
    A task that combines a set of object files into a single binary.
    +
    +
  • +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    AbstractLinkTask +
    Base task for linking a native binary from object files and libraries.
    +
    CreateStaticLibrary +
    Assembles a static library from object files.
    +
    ExtractSymbols +
    Extracts the debug symbols from a binary and stores them in a separate file.
    +
    InstallExecutable +
    Installs an executable with it's dependent libraries so it can be easily executed.
    +
    LinkExecutable +
    Links a binary executable from object files and libraries.
    +
    LinkMachOBundle +
    Links a binary bundle from object files and imported libraries.
    +
    LinkSharedLibrary +
    Links a binary shared library from object files and imported libraries.
    +
    PrefixHeaderFileGenerateTask +
    Generates a prefix header file from a list of headers to be precompiled.
    +
    StripSymbols +
    Strips the debug symbols from a binary
    +
    +
  • +
+
+ + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/nativeplatform/test/cunit/plugins/CUnitPlugin.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/nativeplatform/test/cunit/plugins/CUnitPlugin.html new file mode 100644 index 0000000..457610d --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/nativeplatform/test/cunit/plugins/CUnitPlugin.html @@ -0,0 +1,303 @@ + + + + + +CUnitPlugin (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class CUnitPlugin

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.gradle.nativeplatform.test.cunit.plugins.CUnitPlugin
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Plugin<Project>
    +
    +
    +
    @Incubating
    +public class CUnitPlugin
    +extends Object
    +implements Plugin<Project>
    +
    A plugin that sets up the infrastructure for testing native binaries with CUnit.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        CUnitPlugin

        +
        public CUnitPlugin()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        apply

        +
        public void apply​(Project project)
        +
        Description copied from interface: Plugin
        +
        Apply this plugin to the given target object.
        +
        +
        Specified by:
        +
        apply in interface Plugin<Project>
        +
        Parameters:
        +
        project - The target object
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/nativeplatform/test/tasks/RunTestExecutable.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/nativeplatform/test/tasks/RunTestExecutable.html new file mode 100644 index 0000000..4ce1d74 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/nativeplatform/test/tasks/RunTestExecutable.html @@ -0,0 +1,472 @@ + + + + + +RunTestExecutable (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class RunTestExecutable

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        RunTestExecutable

        +
        public RunTestExecutable()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + + + + + +
        +
      • +

        setOutputDir

        +
        public void setOutputDir​(File outputDir)
        +
      • +
      + + + +
        +
      • +

        getIgnoreFailures

        +
        @Input
        +public boolean getIgnoreFailures()
        +
        Specifies whether the build should break when the verifications performed by this task fail.
        +
        +
        Specified by:
        +
        getIgnoreFailures in interface VerificationTask
        +
        Returns:
        +
        false, when the build should break on failure, true when the failures should be ignored.
        +
        +
      • +
      + + + +
        +
      • +

        isIgnoreFailures

        +
        @Internal
        +public boolean isIgnoreFailures()
        +
      • +
      + + + +
        +
      • +

        setIgnoreFailures

        +
        public void setIgnoreFailures​(boolean ignoreFailures)
        +
        Specifies whether the build should break when the verifications performed by this task fail.
        +
        +
        Specified by:
        +
        setIgnoreFailures in interface VerificationTask
        +
        Parameters:
        +
        ignoreFailures - false to break the build on failure, true to ignore the failures. The default is false.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/nativeplatform/toolchain/VisualCppPlatformToolChain.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/nativeplatform/toolchain/VisualCppPlatformToolChain.html new file mode 100644 index 0000000..983138c --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/nativeplatform/toolchain/VisualCppPlatformToolChain.html @@ -0,0 +1,336 @@ + + + + + +VisualCppPlatformToolChain (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface VisualCppPlatformToolChain

+
+
+
+ +
+
+ +
+
+ +
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/platform/base/LibrarySpec.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/platform/base/LibrarySpec.html new file mode 100644 index 0000000..50c8bfd --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/platform/base/LibrarySpec.html @@ -0,0 +1,253 @@ + + + + + +LibrarySpec (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface LibrarySpec

+
+
+
+ +
+
+ +
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/platform/base/ModuleDependencySpec.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/platform/base/ModuleDependencySpec.html new file mode 100644 index 0000000..dbb5d2c --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/platform/base/ModuleDependencySpec.html @@ -0,0 +1,298 @@ + + + + + +ModuleDependencySpec (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface ModuleDependencySpec

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getGroup

        +
        String getGroup()
        +
        The group of the module this dependency specification refers to.
        +
        +
        Returns:
        +
        the module group name
        +
        +
      • +
      + + + +
        +
      • +

        getName

        +
        String getName()
        +
        The name of the module this dependency specification refers to.
        +
        +
        Returns:
        +
        the module name
        +
        +
      • +
      + + + +
        +
      • +

        getVersion

        +
        @Nullable
        +String getVersion()
        +
        The version range of the module this dependency specification refers to.
        +
        +
        Returns:
        +
        the module version range
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/play/distribution/package-tree.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/play/distribution/package-tree.html new file mode 100644 index 0000000..70b2388 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/play/distribution/package-tree.html @@ -0,0 +1,212 @@ + + + + + +org.gradle.play.distribution Class Hierarchy (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + +
+

Hierarchy For Package org.gradle.play.distribution

+Package Hierarchies: + +
+
+

Interface Hierarchy

+ +
+ + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/play/platform/package-summary.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/play/platform/package-summary.html new file mode 100644 index 0000000..8c339be --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/play/platform/package-summary.html @@ -0,0 +1,157 @@ + + + + + +org.gradle.play.platform (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + +
+

Package org.gradle.play.platform

+
+
+ + +
Classes for managing play platform
+
    +
  • + + + + + + + + + + + + +
    Interface Summary 
    InterfaceDescription
    PlayPlatformDeprecated.
    +
  • +
+
+ + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/plugins/ide/eclipse/GenerateEclipseClasspath.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/plugins/ide/eclipse/GenerateEclipseClasspath.html new file mode 100644 index 0000000..9876475 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/plugins/ide/eclipse/GenerateEclipseClasspath.html @@ -0,0 +1,476 @@ + + + + + +GenerateEclipseClasspath (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class GenerateEclipseClasspath

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.IConventionAware, org.gradle.api.internal.TaskInternal, ExtensionAware, Task, org.gradle.util.Configurable<Task>
    +
    +
    +
    public class GenerateEclipseClasspath
    +extends XmlGeneratorTask<Classpath>
    +
    Generates an Eclipse .classpath file. If you want to fine tune the eclipse configuration +

    + At this moment nearly all configuration is done via EclipseClasspath.

    +
  • +
+
+
+ +
+
+ +
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/plugins/ide/eclipse/model/Container.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/plugins/ide/eclipse/model/Container.html new file mode 100644 index 0000000..8a95bbc --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/plugins/ide/eclipse/model/Container.html @@ -0,0 +1,349 @@ + + + + + +Container (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class Container

+
+
+ +
+ +
+
+ +
+
+ +
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/plugins/ide/eclipse/model/ResourceFilterType.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/plugins/ide/eclipse/model/ResourceFilterType.html new file mode 100644 index 0000000..87d36d3 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/plugins/ide/eclipse/model/ResourceFilterType.html @@ -0,0 +1,363 @@ + + + + + +ResourceFilterType (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Enum ResourceFilterType

+
+
+ +
+ +
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static ResourceFilterType[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (ResourceFilterType c : ResourceFilterType.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static ResourceFilterType valueOf​(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/plugins/javascript/envjs/http/package-summary.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/plugins/javascript/envjs/http/package-summary.html new file mode 100644 index 0000000..6ce6cd7 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/plugins/javascript/envjs/http/package-summary.html @@ -0,0 +1,158 @@ + + + + + +org.gradle.plugins.javascript.envjs.http (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + +
+

Package org.gradle.plugins.javascript.envjs.http

+
+
+ +
+ + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/swiftpm/plugins/package-summary.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/swiftpm/plugins/package-summary.html new file mode 100644 index 0000000..b215eb0 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/swiftpm/plugins/package-summary.html @@ -0,0 +1,159 @@ + + + + + +org.gradle.swiftpm.plugins (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + +
+

Package org.gradle.swiftpm.plugins

+
+
+ + +
Plugins that produce Swift Package Manager manifests from the Gradle model.
+
    +
  • + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    SwiftPackageManagerExportPlugin +
    A plugin that produces a Swift Package Manager manifests from the Gradle model.
    +
    +
  • +
+
+ + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/testing/jacoco/tasks/package-summary.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/testing/jacoco/tasks/package-summary.html new file mode 100644 index 0000000..dd03217 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/testing/jacoco/tasks/package-summary.html @@ -0,0 +1,200 @@ + + + + + +org.gradle.testing.jacoco.tasks (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + +
+

Package org.gradle.testing.jacoco.tasks

+
+
+ + +
Tasks to work with the JaCoCo code coverage library.
+
    +
  • + + + + + + + + + + + + +
    Interface Summary 
    InterfaceDescription
    JacocoReportsContainer +
    The reporting configuration for the JacocoReport task.
    +
    +
  • +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    JacocoBase +
    Base class for Jacoco tasks.
    +
    JacocoCoverageVerification +
    Task for verifying code coverage metrics.
    +
    JacocoMerge +
    Task to merge multiple execution data files into one.
    +
    JacocoReport +
    Task to generate HTML, Xml and CSV reports of Jacoco coverage data.
    +
    JacocoReportBase +
    Base class for Jacoco report tasks.
    +
    +
  • +
+
+ + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/tooling/LongRunningOperation.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/tooling/LongRunningOperation.html new file mode 100644 index 0000000..e82d81d --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/tooling/LongRunningOperation.html @@ -0,0 +1,805 @@ + + + + + +LongRunningOperation (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface LongRunningOperation

+
+
+
+
    +
  • +
    +
    All Known Subinterfaces:
    +
    BuildActionExecuter<T>, BuildLauncher, ConfigurableLauncher<T>, ModelBuilder<T>, TestLauncher
    +
    +
    +
    public interface LongRunningOperation
    +
    Offers ways to communicate both ways with a Gradle operation, be it building a model or running tasks. +

    + Enables tracking progress via listeners that will receive events from the Gradle operation. +

    + Allows providing standard output streams that will receive output if the Gradle operation writes to standard streams. +

    + Allows providing standard input that can be consumed by the gradle operation (useful for interactive builds). +

    + Enables configuring the build run / model request with options like the Java home or JVM arguments. + Those settings might not be supported by the target Gradle version. Refer to Javadoc for those methods + to understand what kind of exception throw and when is it thrown.

    +
    +
    Since:
    +
    1.0-milestone-7
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        setStandardOutput

        +
        LongRunningOperation setStandardOutput​(OutputStream outputStream)
        +
        Sets the OutputStream which should receive standard output logging generated while running the operation. + The default is to discard the output.
        +
        +
        Parameters:
        +
        outputStream - The output stream. The system default character encoding will be used to encode characters written to this stream.
        +
        Returns:
        +
        this
        +
        Since:
        +
        1.0-milestone-7
        +
        +
      • +
      + + + +
        +
      • +

        setStandardError

        +
        LongRunningOperation setStandardError​(OutputStream outputStream)
        +
        Sets the OutputStream which should receive standard error logging generated while running the operation. + The default is to discard the output.
        +
        +
        Parameters:
        +
        outputStream - The output stream. The system default character encoding will be used to encode characters written to this stream.
        +
        Returns:
        +
        this
        +
        Since:
        +
        1.0-milestone-7
        +
        +
      • +
      + + + +
        +
      • +

        setColorOutput

        +
        LongRunningOperation setColorOutput​(boolean colorOutput)
        +
        Specifies whether to generate colored (ANSI encoded) output for logging. The default is to not generate color output. + +

        Supported by Gradle 2.3 or later. Ignored for older versions.

        +
        +
        Parameters:
        +
        colorOutput - true to request color output (using ANSI encoding).
        +
        Returns:
        +
        this
        +
        Since:
        +
        2.3
        +
        +
      • +
      + + + +
        +
      • +

        setStandardInput

        +
        LongRunningOperation setStandardInput​(InputStream inputStream)
        +
        Sets the InputStream that will be used as standard input for this operation. + Defaults to an empty input stream.
        +
        +
        Parameters:
        +
        inputStream - The input stream
        +
        Returns:
        +
        this
        +
        Since:
        +
        1.0-milestone-8
        +
        +
      • +
      + + + +
        +
      • +

        setJavaHome

        +
        LongRunningOperation setJavaHome​(@Nullable
        +                                 File javaHome)
        +                          throws IllegalArgumentException
        +
        Specifies the Java home directory to use for this operation. +

        + BuildEnvironment model contains information such as Java or Gradle environment. + If you want to get hold of this information you can ask tooling API to build this model. +

        + If not configured or null is passed, then the sensible default will be used.

        +
        +
        Parameters:
        +
        javaHome - to use for the Gradle process
        +
        Returns:
        +
        this
        +
        Throws:
        +
        IllegalArgumentException - when supplied javaHome is not a valid folder.
        +
        Since:
        +
        1.0-milestone-8
        +
        +
      • +
      + + + +
        +
      • +

        setJvmArguments

        +
        LongRunningOperation setJvmArguments​(@Nullable
        +                                     String... jvmArguments)
        +
        Specifies the Java VM arguments to use for this operation. +

        + BuildEnvironment model contains information such as Java or Gradle environment. + If you want to get hold of this information you can ask tooling API to build this model. +

        + If not configured, null, or an empty array is passed, then the reasonable default will be used.

        +
        +
        Parameters:
        +
        jvmArguments - to use for the Gradle process
        +
        Returns:
        +
        this
        +
        Since:
        +
        1.0-milestone-8
        +
        +
      • +
      + + + +
        +
      • +

        addJvmArguments

        +
        LongRunningOperation addJvmArguments​(String... jvmArguments)
        +
        Appends Java VM arguments to the existing list.
        +
        +
        Parameters:
        +
        jvmArguments - the argument to use for the Gradle process
        +
        Returns:
        +
        this
        +
        Since:
        +
        5.0
        +
        +
      • +
      + + + +
        +
      • +

        addJvmArguments

        +
        LongRunningOperation addJvmArguments​(Iterable<String> jvmArguments)
        +
        Appends Java VM arguments to the existing list.
        +
        +
        Parameters:
        +
        jvmArguments - the argument to use for the Gradle process
        +
        Returns:
        +
        this
        +
        Since:
        +
        5.0
        +
        +
      • +
      + + + +
        +
      • +

        setJvmArguments

        +
        LongRunningOperation setJvmArguments​(@Nullable
        +                                     Iterable<String> jvmArguments)
        +
        Specifies the Java VM arguments to use for this operation. +

        + BuildEnvironment model contains information such as Java or Gradle environment. + If you want to get hold of this information you can ask tooling API to build this model. +

        + If not configured, null, or an empty list is passed, then the reasonable default will be used.

        +
        +
        Parameters:
        +
        jvmArguments - to use for the Gradle process
        +
        Returns:
        +
        this
        +
        Since:
        +
        2.6
        +
        +
      • +
      + + + +
        +
      • +

        withArguments

        +
        LongRunningOperation withArguments​(@Nullable
        +                                   String... arguments)
        +
        Specify the command line build arguments. Useful mostly for running tasks via BuildLauncher. +

        + Be aware that not all of the Gradle command line options are supported! + Only the build arguments that configure the build execution are supported. + They are modelled in the Gradle API via StartParameter. + Examples of supported build arguments: '--info', '-p'. + The command line instructions that are actually separate commands (like '-?' and '-v') are not supported. + Some other instructions like '--daemon' are also not supported - the tooling API always runs with the daemon. +

        + If an unknown or unsupported command line option is specified, UnsupportedBuildArgumentException + will be thrown at the time the operation is executed via BuildLauncher.run() or ModelBuilder.get(). +

        + For the list of all Gradle command line options please refer to the User Manual + or take a look at the output of the 'gradle -?' command. Majority of arguments modeled by + StartParameter are supported. +

        + The arguments can potentially override some other settings you have configured. + For example, the project directory or Gradle user home directory that are configured + in the GradleConnector. + Also, the task names configured by BuildLauncher.forTasks(String...) can be overridden + if you happen to specify other tasks via the build arguments. +

        + See the example in the docs for BuildLauncher + + If not configured, null, or an empty array is passed, then the reasonable default will be used. + +

        Requires Gradle 1.0 or later.

        +
        +
        Parameters:
        +
        arguments - Gradle command line arguments
        +
        Returns:
        +
        this
        +
        Since:
        +
        1.0
        +
        +
      • +
      + + + +
        +
      • +

        withArguments

        +
        LongRunningOperation withArguments​(@Nullable
        +                                   Iterable<String> arguments)
        +
        Specify the command line build arguments. Useful mostly for running tasks via BuildLauncher. +

        + If not configured, null, or an empty list is passed, then the reasonable default will be used. + +

        Requires Gradle 1.0 or later.

        +
        +
        Parameters:
        +
        arguments - Gradle command line arguments
        +
        Returns:
        +
        this
        +
        Since:
        +
        2.6
        +
        +
      • +
      + + + +
        +
      • +

        addArguments

        +
        LongRunningOperation addArguments​(String... arguments)
        +
        Appends new command line arguments to the existing list. Useful mostly for running tasks via BuildLauncher.
        +
        +
        Parameters:
        +
        arguments - Gradle command line arguments
        +
        Returns:
        +
        this
        +
        Since:
        +
        5.0
        +
        +
      • +
      + + + +
        +
      • +

        addArguments

        +
        LongRunningOperation addArguments​(Iterable<String> arguments)
        +
        Appends new command line arguments to the existing list. Useful mostly for running tasks via BuildLauncher.
        +
        +
        Parameters:
        +
        arguments - Gradle command line arguments
        +
        Returns:
        +
        this
        +
        Since:
        +
        5.0
        +
        +
      • +
      + + + +
        +
      • +

        setEnvironmentVariables

        +
        LongRunningOperation setEnvironmentVariables​(@Nullable
        +                                             Map<String,​String> envVariables)
        +
        Specifies the environment variables to use for this operation. +

        + BuildEnvironment model contains information such as Java or Gradle environment. + If you want to get hold of this information you can ask tooling API to build this model. +

        + If not configured or null is passed, then the reasonable default will be used.

        +
        +
        Parameters:
        +
        envVariables - environment variables
        +
        Returns:
        +
        this
        +
        Since:
        +
        3.5
        +
        +
      • +
      + + + +
        +
      • +

        addProgressListener

        +
        LongRunningOperation addProgressListener​(ProgressListener listener)
        +
        Adds a progress listener which will receive progress events as the operation runs. + +

        This method is intended to be replaced by addProgressListener(org.gradle.tooling.events.ProgressListener). The new progress listener type + provides much richer information and much better handling of parallel operations that run during the build, such as tasks that run in parallel. + You should prefer using the new listener interface where possible. Note, however, that the new interface is supported only for Gradle 2.5. +

        +
        +
        Parameters:
        +
        listener - The listener
        +
        Returns:
        +
        this
        +
        Since:
        +
        1.0-milestone-7
        +
        +
      • +
      + + + +
        +
      • +

        addProgressListener

        +
        LongRunningOperation addProgressListener​(ProgressListener listener)
        +
        Adds a progress listener which will receive progress events of all types as the operation runs. + +

        This method is intended to replace addProgressListener(ProgressListener). You should prefer using the new progress listener method where possible, + as the new interface provides much richer information and much better handling of parallel operations that run during the build. +

        + +

        Supported by Gradle 2.5 or later. Gradle 2.4 supports OperationType.TEST operations only. Ignored for older versions.

        +
        +
        Parameters:
        +
        listener - The listener
        +
        Returns:
        +
        this
        +
        Since:
        +
        2.5
        +
        +
      • +
      + + + +
        +
      • +

        addProgressListener

        +
        LongRunningOperation addProgressListener​(ProgressListener listener,
        +                                         Set<OperationType> operationTypes)
        +
        Adds a progress listener which will receive progress events as the operations of the requested type run. + +

        This method is intended to replace addProgressListener(ProgressListener). You should prefer using the new progress listener method where possible, + as the new interface provides much richer information and much better handling of parallel operations that run during the build. +

        + +

        Supported by Gradle 2.5 or later. Gradle 2.4 supports OperationType.TEST operations only. Ignored for older versions.

        +
        +
        Parameters:
        +
        listener - The listener
        +
        operationTypes - The types of operations to receive progress events for.
        +
        Returns:
        +
        this
        +
        Since:
        +
        2.5
        +
        +
      • +
      + + + +
        +
      • +

        addProgressListener

        +
        LongRunningOperation addProgressListener​(ProgressListener listener,
        +                                         OperationType... operationTypes)
        +
        Adds a progress listener which will receive progress events as the operations of the requested type run. + +

        This method is intended to replace addProgressListener(ProgressListener). You should prefer using the new progress listener method where possible, + as the new interface provides much richer information and much better handling of parallel operations that run during the build. +

        + +

        Supported by Gradle 2.5 or later. Gradle 2.4 supports OperationType.TEST operations only. Ignored for older versions.

        +
        +
        Parameters:
        +
        listener - The listener
        +
        operationTypes - The types of operations to receive progress events for.
        +
        Returns:
        +
        this
        +
        Since:
        +
        2.6
        +
        +
      • +
      + + + +
        +
      • +

        withCancellationToken

        +
        LongRunningOperation withCancellationToken​(CancellationToken cancellationToken)
        +
        Sets the cancellation token to use to cancel the operation if required. + +

        Supported by Gradle 2.1 or later. Ignored for older versions.

        +
        +
        Since:
        +
        2.1
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/tooling/events/task/TaskSuccessResult.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/tooling/events/task/TaskSuccessResult.html new file mode 100644 index 0000000..ba694e6 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/tooling/events/task/TaskSuccessResult.html @@ -0,0 +1,293 @@ + + + + + +TaskSuccessResult (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface TaskSuccessResult

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        isUpToDate

        +
        boolean isUpToDate()
        +
        Returns whether this task was up-to-date.
        +
        +
        Returns:
        +
        true if this task was up-to-date
        +
        +
      • +
      + + + +
        +
      • +

        isFromCache

        +
        boolean isFromCache()
        +
        Returns whether the output for this task was pulled from a build cache when using + task output caching. + +

        NOTE: This will always be false if the Gradle version does + not support task output caching.

        +
        +
        Returns:
        +
        true if the output for this task was from a build cache
        +
        Since:
        +
        3.3
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/tooling/events/transform/package-summary.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/tooling/events/transform/package-summary.html new file mode 100644 index 0000000..f98a5d5 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/tooling/events/transform/package-summary.html @@ -0,0 +1,207 @@ + + + + + +org.gradle.tooling.events.transform (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + +
+

Package org.gradle.tooling.events.transform

+
+
+ + +
Artifact transform execution specific interfaces and classes related to event notifications.
+ +
+ + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/tooling/model/java/JavaRuntime.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/tooling/model/java/JavaRuntime.html new file mode 100644 index 0000000..839e5a4 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/tooling/model/java/JavaRuntime.html @@ -0,0 +1,267 @@ + + + + + +JavaRuntime (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface JavaRuntime

+
+
+
+
    +
  • +
    +
    public interface JavaRuntime
    +
    Represents a Java virtual machine installation.
    +
    +
    Since:
    +
    2.11
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getJavaVersion

        +
        JavaVersion getJavaVersion()
        +
        The Java version of the Java runtime installation.
        +
        +
        Returns:
        +
        The Java version. Never returns null.
        +
        +
      • +
      + + + +
        +
      • +

        getJavaHome

        +
        File getJavaHome()
        +
        The home directory of the Java runtime installation.
        +
        +
        Returns:
        +
        The home directory. Never returns null.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/vcs/VersionControlSpec.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/vcs/VersionControlSpec.html new file mode 100644 index 0000000..aca5501 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/javadoc/org/gradle/vcs/VersionControlSpec.html @@ -0,0 +1,348 @@ + + + + + +VersionControlSpec (Gradle API 6.7.1) + + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface VersionControlSpec

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    Describable
    +
    +
    +
    All Known Subinterfaces:
    +
    GitVersionControlSpec
    +
    +
    +
    public interface VersionControlSpec
    +extends Describable
    +
    Captures user-provided information about a version control repository.
    +
    +
    Since:
    +
    4.4
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getUniqueId

        +
        String getUniqueId()
        +
        Returns a String identifier which will be unique to this version + control specification among other version control specifications.
        +
      • +
      + + + +
        +
      • +

        getRepoName

        +
        String getRepoName()
        +
        Returns the name of the repository.
        +
      • +
      + + + +
        +
      • +

        getRootDir

        +
        String getRootDir()
        +
        Returns the relative path to the root of the build within the repository. + +

        Defaults to an empty relative path, meaning the root of the repository.

        +
        +
        Returns:
        +
        the root directory of the build, relative to the root of this repository.
        +
        Since:
        +
        4.5
        +
        +
      • +
      + + + +
        +
      • +

        setRootDir

        +
        void setRootDir​(String rootDir)
        +
        Sets the relative path to the root of the build within the repository. Use an empty string to refer to the root of the repository.
        +
        +
        Parameters:
        +
        rootDir - The root directory of the build, relative to the root of this repository.
        +
        Since:
        +
        4.5
        +
        +
      • +
      + + + +
        +
      • +

        plugins

        +
        void plugins​(Action<? super InjectedPluginDependencies> configuration)
        +
        Configure injected plugins into this build.
        +
        +
        Parameters:
        +
        configuration - the configuration action for adding injected plugins
        +
        Since:
        +
        4.6
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/release-notes.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/release-notes.html new file mode 100644 index 0000000..2abf963 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/release-notes.html @@ -0,0 +1,1971 @@ + + + + + + Gradle 6.7.1 Release Notes + + + + + + + + +
+

Gradle Release Notes

+

Version 6.7.1

+

The Gradle team is excited to announce Gradle 6.7.1.

+

This release continues on the series of performance improvements, particularly for incremental builds. File system watching introduced in Gradle 6.5 is now ready for production use. You can expect up to 20% build speed improvements in large projects after turning this feature on. Additionally, the experimental configuration cache has been improved to make troubleshooting easier for early adopters.

+

This release introduces Java toolchain support that makes it much easier to build JVM projects using a different version of Java than the one Gradle is running on. Starting with this release, Gradle itself can also run on Java 15.

+

New dependency management features in this release include support for compile only API dependencies, the ability to ignore selected dependencies in dependency locking and version ranges in repository content filtering.

+

This release also includes several general improvements including improved gradle init task, better documentation and new samples.

+

We would like to thank the following community contributors to this release of Gradle:

+

Roberto Perez Alcolea, SheliakLyr, Christian Edward Gruber, René Gröschke, Louis CAD, Campbell Jones, Leonardo Bezerra Silva Júnior, Christoph Dreis, Matthias Robbers, Vladimir Sitnikov, Stefan Oehme, Thad House, Michał Mlak and Jochen Schalanda.

+
+

Table Of Contents

+ +
+
+

Upgrade instructions

+

Switch your build to use Gradle 6.7.1 by updating your wrapper:

+

./gradlew wrapper --gradle-version=6.7.1

+

See the Gradle 6.x upgrade guide to learn about deprecations, breaking changes and other considerations when upgrading to Gradle 6.7.1.

+

NOTE: Gradle 6.7 has had one patch release, which fixed several issues from the original release. We recommend always using the latest patch release.

+

For Java, Groovy, Kotlin and Android compatibility, see the full compatibility notes.

+
+
+

Performance improvements

+

+

File system watching is ready for production use

+

In an incremental build, input and output files are checked to determine what needs to be rebuilt. This feature typically saves a lot of time; however, it adds some I/O overhead, which can be noticeable in large projects when not much has changed since the previous build.

+

Back in Gradle 6.5 we've introduced file-system watching as an experimental feature. When enabled, it allows Gradle to keep what it has learned about the file system in memory during and between builds instead of polling the file system on each build. This significantly reduces the amount of disk I/O needed to determine what has changed since the previous build.

+

This feature is now ready for production use and supported on Linux, Windows and macOS. You can enable it by adding the following to gradle.properties in the project root or in your Gradle user home:

+
org.gradle.vfs.watch=true
+
+

Read more about this new feature and its impact on the Gradle blog!

+ Build time improvements using Santa Tracker Android with file-system watching enabled, Linux with OpenJDK 8. +

+

Configuration cache improvements

+

Gradle 6.6 introduced configuration caching as an experimental feature. This release comes with usability and performance improvements for the configuration cache.

+

Early adopters of configuration cache can use the command line output and HTML report for troubleshooting. Previously, the configuration cache state was saved despite reported problems, which in some situations required manual cache invalidation. In this release, the configuration cache gets discarded when the build fails because of configuration cache problems. Note that you can still ignore known problems.

+

The problem report is also more helpful now. It reports the source of problems more accurately, pointing at the offending location in plugins and scripts in more cases.

+

Loading from the configuration cache is also faster and memory consumption during builds has been reduced, especially for Kotlin and Android builds.

+

Read about this feature and its impact on the Gradle blog. You can also track progress of configuration cache support in core plugins and community plugins.

+
+
+

New JVM ecosystem features

+

+

Toolchain support for JVM projects

+

By default, Gradle uses the same Java version for running Gradle itself and building JVM projects.

+

This is not always desirable. Building projects with different Java versions on different developer machines and CI servers may lead to unexpected issues. Additionally, you may want to build a project using a Java version that running Gradle is not compatible with.

+

Before this release, it required several steps to configure a different Java version for compilation, testing, generating Javadoc, and executing applications.

+

This release introduces the toolchain concept to simplify such a setup. A Java toolchain is a set of tools (javac compiler,java command etc), taken from a local Java installation and used during the build. Instead of manually specifying executables for the various tasks, toolchains provide a centralized place to define the Java version requirements in the build.

+

Setting up a toolchain can be done through the java extensions:

+
java {
+    toolchain {
+        languageVersion = JavaLanguageVersion.of(14)
+    }
+}
+
+

The snippet above makes Gradle use javac, java and javadoc commands from the specified toolchain for compilation, running tests, and generating documentation. Gradle will detect locally installed Java versions to run the build according to the specified requirements.

+

By default, Gradle supports common installation locations on various operating systems as well as popular package managers like asdf-vm, jabba and SDKMAN!. If no matching Java version is available locally, it will download a matching JDK from AdoptOpenJDK.

+ Java Toolchain Download +

Learn more about this new feature in the Java Toolchain documentation and the toolchain sample.

+

+

Support for Java 15

+

Gradle now supports running on and building with Java 15.

+
+
+

New dependency management features

+

+

Compile-only API dependencies for JVM libraries

+

When writing a Java (or Groovy/Kotlin/Scala) library, there are cases where you require dependencies at compilation time which are parts of the API of your library, but which should not be on the runtime classpath.

+

An example of such a dependency is an annotation library with annotations that are not used at runtime. These typically need to be available at compile time of the library's consumers when annotation processors inspect annotations of all classes. Another example is a dependency that is part of the runtime environment the library is expected to run on, but also provides types that are used in the public API of the library.

+

The Java Library Plugin now offers the compileOnlyApi configuration for this purpose. It effectively combines the major properties of the compileOnly configuration (dependency will not be on the runtime classpath) and the api (dependencies are visible for consumers at compile time).

+
plugins {
+  id("java-library")
+  // add Groovy, Kotlin or Scala plugin if desired
+}
+
+dependencies {
+  compileOnlyApi(
+    "com.google.errorprone:error_prone_annotations:2.4.0")
+}
+
+

The behavior of compileOnlyApi dependencies is preserved for published libraries when published with Gradle Module Metadata.

+

+

Ignore dependencies in dependency lock state

+

Dependency locking makes builds using dynamic versions deterministic.

+

When using dependency locking, you may want to use a different frequency of version upgrades for different types of dependencies. For example, you may want to explicitly control external dependencies upgrades with locking but use the latest version for internal dependencies on every build.

+

To enable such use case, this release allows you to specify ignored dependencies in the dependencyLocking extension:

+
dependencyLocking {
+    ignoredDependencies.add("com.example:*")
+}
+
+

With the above, any dependency in the com.example group will be ignored by the lock state validation or writing. This means that the dependencies in this group will be automatically updated without updating the lock file.

+

See the documentation for more details on ignored dependencies in locking.

+

+

Version ranges in repository content filtering

+

Builds can control which repositories are queried for which dependency for better performance and security using repository content filtering. This feature provides performance and security benefits.

+

With this release, when including or excluding a specific dependency version, the build author can use a version range:

+
repositories {
+    maven {
+        url = 'http://some-url'
+        content {
+             excludeVersion('com.google.guava', 'guava', '[19.0,)')
+       }
+    }
+}
+
+

In this case, no guava version after 19.0 will be searched for in the referenced Maven repository.

+
+
+

Other new features and usability improvements

+

+

Abbreviation of kebab-case project names

+

Gradle allows you to abbreviate project and task names from the command-line. For example, you can execute the task compileTestJava by running gradle cTJ.

+

Up until this release, fuzzy name matching only worked for camelCase names (e.g. compileTestJava). This is the recommended convention for task names, but it is unusual for project names. In the Java world, directory names are usually all lowercase by convention and in Gradle, project names usually follow the name of the directory the project is in.

+

Many projects worked around this limitation by using kebab-case project directories (e.g. my-awesome-lib) while defining different camelCase project names in their settings scripts. This allowed them to use project name abbreviations in the command line but added additional complexity to the build.

+

This release changes the fuzzy name matching to support for kebab-case names. Now, you can execute the compileTestJava task in the project my-awesome-lib with the following command:

+
gradle mAL:cT
+
+

+

Bootstrapping new projects with gradle init

+

The built-in init task can be used to quickly create a new Gradle build or convert a Maven build to a Gradle build.

+

In this release, the projects generated by gradle init have been updated to use the latest recommended build authoring practices. Some of the generated builds demonstrate the use of buildSrc for sharing common build logic.

+

For new projects, you can now generate a multi-project build for JVM languages. In order to generate a multi-project build, choose application, select one of the JVM languages and then choose application and library projects:

+
Select type of project to generate:
+  1: basic
+  2: application
+  3: library
+  4: Gradle plugin
+Enter selection (default: basic) [1..4] 2
+
+Select implementation language:
+  1: C++
+  2: Groovy
+  3: Java
+  4: Kotlin
+  5: Scala
+  6: Swift
+Enter selection (default: Java) [1..6] 3
+
+Split functionality across multiple subprojects?:
+   1: no - only one application project
+   2: yes - application and library projects
+Enter selection [1..2] 2
+
+

For Maven-to-Gradle conversion, this release adds support for generating Kotlin DSL scripts.

+

+

Included builds are now visible to buildSrc

+

We recommend that builds use the specially named buildSrc build to organize imperative and common build logic.

+

Sometimes, you may also need to share build logic between buildSrc itself and your root build. In the previous releases, that was not possible because buildSrc could not access build logic from other included builds.

+

In this release, it's now possible to share build logic between buildSrc and the root build or any other included build. This makes it easier to share common repository declarations or conventions between buildSrc and other builds as demonstrated in this sample.

+

NOTE Using a plugin from an included build with buildSrc will break importing your build into Android Studio and IntelliJ until a fix for IDEA-250774 has been released.

+
+
+

Documentation improvements

+

+

New samples

+

The sample index includes new samples, with step-by-step instructions on how to get started with Gradle for different project types and programming languages:

+ +

+

Authoring multi-project builds

+

We've reworked our documentation for authoring multi-project builds that now includes the new guidance on how to share build logic between subprojects with convention plugins.

+
+
+ +

Promoted features are features that were incubating in previous versions of Gradle but are now supported and subject to backwards compatibility. See the User Manual section on the “Feature Lifecycle” for more information.

+ +
+
+

Fixed issues

+
+
+

Known issues

+

Known issues are problems that were discovered post release that are directly related to changes made in this release.

+
+
+

External contributions

+

We love getting contributions from the Gradle community. For information on contributing, please see gradle.org/contribute.

+
+
+

Reporting Problems

+

If you find a problem with this release, please file a bug on GitHub Issues adhering to our issue guidelines. If you're not sure you're encountering a bug, please use the forum.

+

We hope you will build happiness with Gradle, and we look forward to your feedback via Twitter or on GitHub.

+
+
+ + + \ No newline at end of file diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/userguide/compatibility.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/userguide/compatibility.html new file mode 100644 index 0000000..f5db9d4 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/userguide/compatibility.html @@ -0,0 +1,3005 @@ + + + + + + + + +Compatibility Matrix + + + + + + + + + + + + +
+ + + +
+ +
+
+

Java

+
+
+

A Java version between 8 and 15 is required to execute Gradle. Java 16 and later versions are not yet supported.

+
+
+

Java 6 and 7 can still be used for compilation and forked test execution.

+
+
+

Any supported version of Java can be used for compile or test.

+
+
+
+
+

Kotlin

+
+
+

Gradle is tested with Kotlin 1.3.21 through 1.4.0.

+
+
+
+
+

Groovy

+
+
+

Gradle is tested with Groovy 1.5.8 through 2.5.12.

+
+
+
+
+

Android

+
+
+

Gradle is tested with Android Gradle Plugin 3.4, 3.5, 3.6 and 4.0. Alpha and beta versions may or may not work.

+
+
+
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/userguide/img/nativeDependents.png b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/userguide/img/nativeDependents.png new file mode 100644 index 0000000..47a5d2a Binary files /dev/null and b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/userguide/img/nativeDependents.png differ diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/userguide/img/profile.png b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/userguide/img/profile.png new file mode 100644 index 0000000..0f4e2db Binary files /dev/null and b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/userguide/img/profile.png differ diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/userguide/img/wrapper-workflow.png b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/userguide/img/wrapper-workflow.png new file mode 100644 index 0000000..8f22efa Binary files /dev/null and b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/userguide/img/wrapper-workflow.png differ diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/userguide/img/xctest-variant-task-graph.png b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/userguide/img/xctest-variant-task-graph.png new file mode 100644 index 0000000..32319d0 Binary files /dev/null and b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/userguide/img/xctest-variant-task-graph.png differ diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/userguide/resolution_strategy_tuning.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/userguide/resolution_strategy_tuning.html new file mode 100644 index 0000000..9c6ff29 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/userguide/resolution_strategy_tuning.html @@ -0,0 +1,3202 @@ + + + + + + + +Preventing accidental dependency upgrades + + + + + + + + + + + + +
+ + + +
+ +
+
+
+
+

In some situations, you might want to be in total control of the dependency graph. +In particular, you may want to make sure that:

+
+
+
    +
  • +

    the versions declared in a build script actually correspond to the ones being resolved

    +
  • +
  • +

    or make sure that dependency resolution is reproducible over time

    +
  • +
+
+
+

Gradle provides ways to perform this by configuring the resolution strategy.

+
+
+
+
+

Failing on version conflict

+
+
+

There’s a version conflict whenever Gradle finds the same module in two different versions in a dependency graph. +By default, Gradle performs optimistic upgrades, meaning that if version 1.1 and 1.3 are found in the graph, we resolve to the highest version, 1.3. +However, it is easy to miss that some dependencies are upgraded because of a transitive dependency. +In the example above, if 1.1 was a version used in your build script and 1.3 a version brought transitively, you could use 1.3 without actually noticing.

+
+
+

To make sure that you are aware of such upgrades, Gradle provides a mode that can be activated in the resolution strategy of a configuration. +Imagine the following dependencies declaration:

+
+
+
Example 1. Direct dependency version not matching a transitive version
+
+
+
+
+
build.gradle
+
+
dependencies {
+    implementation 'org.apache.commons:commons-lang3:3.0'
+    // the following dependency brings lang3 3.8.1 transitively
+    implementation 'com.opencsv:opencsv:4.6'
+}
+
+
+
+
+
+
+
+
build.gradle.kts
+
+
dependencies {
+    implementation("org.apache.commons:commons-lang3:3.0")
+    // the following dependency brings lang3 3.8.1 transitively
+    implementation("com.opencsv:opencsv:4.6")
+}
+
+
+
+
+
+
+
+

Then by default Gradle would upgrade commons-lang3, but it is possible to fail the build:

+
+
+
Example 2. Fail on version conflict
+
+
+
+
+
build.gradle
+
+
configurations.all {
+    resolutionStrategy {
+        failOnVersionConflict()
+    }
+}
+
+
+
+
+
+
+
+
build.gradle.kts
+
+
configurations.all {
+    resolutionStrategy {
+        failOnVersionConflict()
+    }
+}
+
+
+
+
+
+
+
+
+
+

Making sure resolution is reproducible

+
+
+

There are cases where dependency resolution can be unstable over time. +That is to say that if you build at date D, building at date D+x may give a different resolution result.

+
+
+

This is possible in the following cases:

+
+
+
    +
  • +

    dynamic dependency versions are used (version ranges, latest.release, 1.+, …​)

    +
  • +
  • +

    or changing versions are used (SNAPSHOTs, fixed version with changing contents, …​)

    +
  • +
+
+
+

The recommended way to deal with dynamic versions is to use dependency locking. +However, it is possible to prevent the use of dynamic versions altogether, which is an alternate strategy:

+
+
+
Example 3. Failing on dynamic versions
+
+
+
+
+
build.gradle
+
+
configurations.all {
+    resolutionStrategy {
+        failOnDynamicVersions()
+    }
+}
+
+
+
+
+
+
+
+
build.gradle.kts
+
+
configurations.all {
+    resolutionStrategy {
+        failOnDynamicVersions()
+    }
+}
+
+
+
+
+
+
+
+

Likewise, it’s possible to prevent the use of changing versions by activating this flag:

+
+
+
Example 4. Failing on changing versions
+
+
+
+
+
build.gradle
+
+
configurations.all {
+    resolutionStrategy {
+        failOnChangingVersions()
+    }
+}
+
+
+
+
+
+
+
+
build.gradle.kts
+
+
configurations.all {
+    resolutionStrategy {
+        failOnChangingVersions()
+    }
+}
+
+
+
+
+
+
+
+

It’s a good practice to fail on changing versions at release time.

+
+
+

Eventually, it’s possible to combine both failing on dynamic versions and changing versions using a single call:

+
+
+
Example 5. Failing on non-reproducible resolution
+
+
+
+
+
build.gradle
+
+
configurations.all {
+    resolutionStrategy {
+        failOnNonReproducibleResolution()
+    }
+}
+
+
+
+
+
+
+
+
build.gradle.kts
+
+
configurations.all {
+    resolutionStrategy {
+        failOnNonReproducibleResolution()
+    }
+}
+
+
+
+
+
+
+
+
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/userguide/swift_library_plugin.html b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/userguide/swift_library_plugin.html new file mode 100644 index 0000000..6ade436 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/docs/userguide/swift_library_plugin.html @@ -0,0 +1,3628 @@ + + + + + + + +Swift Library + + + + + + + + + + + + +
+ + + +
+ +
+
+
+
+

The Swift Library Plugin provides the tasks, conventions and conventions for building a Swift library. +In particular, a Swift library provides functionality that can be used by consumers (i.e., other projects using this plugin or the Swift Application Plugin).

+
+
+
+
+

Usage

+
+
+
Example 1. Applying the Swift Library Plugin
+
+
+
+
+
build.gradle
+
+
plugins {
+    id 'swift-library'
+}
+
+
+
+
+
+
+
+
build.gradle.kts
+
+
plugins {
+    `swift-library`
+}
+
+
+
+
+
+
+
+
+
+

Build variants

+
+
+

The Swift Library Plugin understands the following dimensions. +Read the introduction to build variants for more information.

+
+
+
+
Build types - always set to debug and release
+
+

The build type controls the debuggability as well as the optimization of the generated binaries.

+
+
    +
  • +

    debug - Generate debug symbols and don’t optimized the binary

    +
  • +
  • +

    release - Generate debug symbols and optimize, but extract the debug symbols from the binary

    +
  • +
+
+
+
Linkages - default to shared
+
+

The linkage expresses whether a shared library or static library should be created. Libraries can produce a shared library, a static library or both.

+
+
+
+
+

The linkage can be configured as follows:

+
+
+
Example 2. Configure library linkages
+
+
+
+
+
build.gradle
+
+
library {
+    linkage = [Linkage.STATIC, Linkage.SHARED]
+}
+
+
+
+
+
+
+
+
build.gradle.kts
+
+
library {
+    linkage.set(listOf(Linkage.STATIC, Linkage.SHARED))
+}
+
+
+
+
+
+
+
+
+
Target machines - defaults to the build host
+
+

The target machine expresses which machines the application expects to run. +A target machine is identified by its operating system and architecture. +Gradle uses the target machine to decide which tool chain to choose based on availability on the host machine.

+
+
+
+
+

The target machine can be configured as follows:

+
+
+
Example 3. Configure library target machines
+
+
+
+
+
build.gradle
+
+
library {
+    targetMachines = [
+        machines.linux.x86_64,
+        machines.macOS.x86_64
+    ]
+}
+
+
+
+
+
+
+
+
build.gradle.kts
+
+
library {
+    targetMachines.set(listOf(machines.linux.x86_64, machines.macOS.x86_64))
+}
+
+
+
+
+
+
+
+
+
+

Tasks

+
+
+

The following diagram shows the relationships between tasks added by this plugin.

+
+
+

Note the default linkage of a Swift library is shared linkage as shown in the diagram.

+
+
+
+swift shared library task graph +
+
Figure 1. Swift Library Plugin default task graph
+
+
+

With static linkage, the diagram changes to the following:

+
+
+
+swift static library task graph +
+
Figure 2. Swift Library Plugin static library only task graph
+
+
+

Variant-dependent Tasks

+
+

The Swift Library Plugin creates tasks based on variants of the library component. +Read the introduction to build variants for more information. +The following diagrams show the relationship between variant-dependent tasks.

+
+
+
+swift library variant task graph +
+
Figure 3. Swift Library Plugin variant-dependent task graph
+
+
+ + + + + +
+ + +Depending on the linkage property +
+
+
+
+
compileVariantSwift (e.g. compileDebugSwift and compileReleaseSwift) - SwiftCompile
+
+

Depends on: All tasks that contribute source files to the compilation

+
+
+
+

Compiles Swift source files using the selected compiler.

+
+
linkVariant (e.g. linkDebug and linkRelease) - LinkSharedLibrary (shared linkage)
+
+

Depends on: All tasks which contribute to the link libraries, including linkVariant and createVariant tasks from projects that are resolved via project dependencies

+
+
+
+

Links shared library from compiled object files using the selected linker.

+
+
createVariant (e.g. createDebug and createRelease) - CreateStaticLibrary (static linkage)
+
+

Creates static library from compiled object files using selected archiver

+
+
assembleVariant (e.g. assembleDebug and assembleRelease) - Task (lifecycle)
+
+

Depends on: linkVariant (shared linkage) or createVariant (static linkage)

+
+
+
+

Aggregates tasks that assemble the specific variant of this library.

+
+
+
+
+
+

Lifecycle Tasks

+
+

The Swift Library Plugin attaches some of its tasks to the standard lifecycle tasks documented in the Base Plugin chapter — which the Swift Library Plugin applies automatically:

+
+
+
+
assemble - Task (lifecycle)
+
+

Depends on: linkDebug when linkage includes shared or createDebug otherwise.

+
+
+
+

Aggregate task that assembles the debug variant of the shared library (if available) for the current host (if present) in the project. +This task is added by the Base Plugin.

+
+
check - Task (lifecycle)
+
+

Aggregate task that performs verification tasks, such as running the tests. +Some plugins add their own verification task to check. + For example, the XCTest Plugin attach his test task to this lifecycle task. +This task is added by the Base Plugin.

+
+
build - Task (lifecycle)
+
+

Depends on: check, assemble

+
+
+
+

Aggregate tasks that perform a full build of the project. +This task is added by the Base Plugin.

+
+
clean - Delete
+
+

Deletes the build directory and everything in it, i.e. the path specified by the Project.getBuildDir() project property. +This task is added by the Base Plugin.

+
+
+
+
+
+
+
+

Dependency management

+
+
+

Just like the tasks created by the Swift Library Plugin, multiple configurations are created based on the variants of the library component. +Read the introduction to build variants for more information. +The following graph describes the configurations added by the Swift Library Plugin:

+
+
+
+swift library configurations +
+
Figure 4. Swift Library Plugin configurations
+
+
+
    +
  • +

    The configurations in white are the ones a user should use to declare dependencies

    +
  • +
  • +

    The configurations in pink, also known as consumable denoted by (C), are the ones used when a component compiles, links, or runs against the library

    +
  • +
  • +

    The configurations in blue, also known as resolvable denoted by (R), are internal to the component, for its own use

    +
  • +
+
+
+

The following configurations are used to declare dependencies:

+
+
+
+
api
+
+

Used for declaring API dependencies (see API vs implementation section). +This is where you should declare dependencies which are transitively exported to consumers, for compile and link.

+
+
implementation extends api
+
+

Used for declaring implementation dependencies for all variants of the main component (see API vs implementation section). +This is where you should declare dependencies which are purely internal and not meant to be exposed to consumers of any variants.

+
+
mainVariantImplementation (e.g. mainDebugImplementation and mainReleaseImplementation) extends implementation
+
+

Used for declaring implementation dependencies for a specific variant of the main component (see API vs implementation section). +This is where you should declare dependencies which are purely internal and not meant to be exposed to consumers of this specific variant.

+
+
+
+
+

The following configurations are used by consumers:

+
+
+
+
variantSwiftApiElements (e.g. debugSwiftApiElements and releaseSwiftApiElements) extends mainVariantImplementation
+
+

Used for compiling against the library. +This configuration is meant to be used by consumers, to retrieve all the elements necessary to compile against the library.

+
+
variantLinkElements (e.g. debugLinkElements and releaseLinkElements) extends mainVariantImplementation
+
+

Used for linking against the library. +This configuration is meant to be used by consumers, to retrieve all the elements necessary to link against the library.

+
+
variantRuntimeElements (e.g. debugRuntimeElements and releaseRuntimeElements) extends `mainVariantImplementation
+
+

Used for executing the library. +This configuration is meant to be used by consumers, to retrieve all the elements necessary to run against the library.

+
+
+
+
+

The following configurations are used by the library itself:

+
+
+
+
swiftCompileVariant (e.g. swiftCompileDebug and swiftCompileRelease) extends mainVariantImplementation
+
+

Used for compiling the library. +This configuration contains the compile include roots of the library and is therefore used when invoking the Swift compiler to compile it.

+
+
nativeLinkVariant (e.g. nativeLinkDebug and nativeLinkRelease) extends mainVariantImplementation
+
+

Used for linking the library the shared library only. +This configuration contains the libraries of the library and is therefore used when invoking the Swift linker to link it.

+
+
nativeRuntimeVariant (e.g. nativeRuntimeDebug and nativeRuntimeRelease) extends mainVariantImplementation
+
+

Used for executing the library. +This configuration contains the runtime libraries of the library.

+
+
+
+
+

API vs implementation

+
+

The plugin exposes two configurations that can be used to declare dependencies: api and implementation. +The api configuration should be used to declare dependencies which are exported by the library API, whereas the implementation configuration should be used to declare dependencies which are internal to the component.

+
+
+
Example 4. Adding dependencies
+
+
+
+
+
build.gradle
+
+
library {
+    dependencies {
+        // FIXME: Write better deps here.
+        api "io.qt:core:5.1"
+        implementation "io.qt:network:5.1"
+    }
+}
+
+
+
+
+
+
+
+
build.gradle.kts
+
+
library {
+    dependencies {
+        // FIXME: Put real deps here.
+        api("io.qt:core:5.1")
+        implementation("io.qt:network:5.1")
+    }
+}
+
+
+
+
+
+
+
+

Dependencies appearing in the api configurations will be transitively exposed to consumers of the library, and as such will appear on the compile include root and link libraries of consumers. +Dependencies found in the implementation configuration will, on the other hand, not be exposed to consumers, and therefore not leak into the consumer’s compile include root and link libraries. +This comes with several benefits:

+
+
+
    +
  • +

    dependencies do not leak into the compile include roots and link libraries of consumers, so they can never accidentally depend on a transitive dependency

    +
  • +
  • +

    faster compilation thanks to the reduced include roots and link libraries

    +
  • +
  • +

    fewer recompilations when implementation dependencies change since the consumer would not need to be recompiled

    +
  • +
+
+
+
+
+
+

Conventions

+
+
+

The Swift Library Plugin adds conventions for sources and tasks, shown below.

+
+
+

Project layout

+
+

The Swift Library Plugin assumes the project layout shown below. +None of these directories needs to exist or have anything in them. +The Swift Library Plugin will compile whatever it finds and ignore anything missing.

+
+
+
+
src/main/swift
+
+

Swift source with extension of .swift

+
+
+
+
+

You configure the project layout by configuring the source on the library script block.

+
+
+
+

compileVariantSwift Task

+
+

The Swift Library Plugin adds a SwiftCompile instance for each variant of the library component to build (e.g. compileDebugSwift and compileReleaseSwift). +Read the introduction to build variants for more information. +Some of the most common configuration options are shown below.

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+compilerArgs + +

[]

+
+debuggable + +

true

+
+modules + +

configurations.swiftCompileVariant

+
+macros + +

[]

+
+objectFileDir + +

$buildDir/obj/main/variant

+
+optimized + +

false for debug build type or true otherwise

+
+source + +

library.swiftSource

+
+targetPlatform + +

derived from the TargetMachine of the binary

+
+toolChain + +

automatically selected based on target machine

+
+
+
+
+ +
+

The Swift Library Plugin adds a LinkSharedLibrary instance for each variant of the library containing shared linkage as a dimension - e.g. linkDebug and linkRelease. +Read the introduction to build variants for more information. +Some of the most common configuration options are shown below.

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+debuggable + +

true

+
+libs + +

configurations.nativeLinkVariant

+
+linkedFile + +

$buildDir/lib/main/variant/libModule[.so|dylib]

+
+linkerArgs + +

[]

+
+source + +

compileVariantSwift.objects

+
+targetPlatform + +

derived from the TargetMachine of the binary

+
+toolChain + +

automatically selected based on target machine

+
+
+
+
+

createVariant Task

+
+

The Swift Library Plugin adds a CreateStaticLibrary instance for each variant of the library containing static linkage as a dimension - e.g. createDebug and createRelease. +Read the introduction to build variants for more information. +Some of the most common configuration options are shown below.

+
+
+ + + + + + + + + + + + + + + + + + + + + +
+outputFile + +

$buildDir/lib/main/variant/libModule.a

+
+source + +

compileVariantSwift.objects

+
+staticLibArgs + +

[]

+
+targetPlatform + +

derived from the TargetMachine of the binary

+
+toolChain + +

automatically selected based on target machine

+
+
+
+
+
+
+
+ + +
+ + + + + + + + + + \ No newline at end of file diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/lib/javax.inject-1.jar b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/lib/javax.inject-1.jar new file mode 100644 index 0000000..b2a9d0b Binary files /dev/null and b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/lib/javax.inject-1.jar differ diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/lib/minlog-1.2.jar b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/lib/minlog-1.2.jar new file mode 100644 index 0000000..3d174a6 Binary files /dev/null and b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/lib/minlog-1.2.jar differ diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/lib/plugins/gradle-language-native-6.7.1.jar b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/lib/plugins/gradle-language-native-6.7.1.jar new file mode 100644 index 0000000..cc9425a Binary files /dev/null and b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/lib/plugins/gradle-language-native-6.7.1.jar differ diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/lib/plugins/xbean-reflect-3.7.jar b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/lib/plugins/xbean-reflect-3.7.jar new file mode 100644 index 0000000..b7036fe Binary files /dev/null and b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/lib/plugins/xbean-reflect-3.7.jar differ diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/api/HasImplicitReceiver.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/api/HasImplicitReceiver.java new file mode 100644 index 0000000..3d388bd --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/api/HasImplicitReceiver.java @@ -0,0 +1,44 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Marks a SAM interface as a target for lambda expressions / closures + * where the single parameter is passed as the implicit receiver of the + * invocation ({@code this} in Kotlin, {@code delegate} in Groovy) as if + * the lambda expression was an extension method of the parameter type. + * + *
+ *     // copySpec(Action<CopySpec>)
+ *     copySpec {
+ *         from("./sources") // the given CopySpec is the implicit receiver
+ *     }
+ * 
+ * + * @since 3.5 + */ +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target(ElementType.TYPE) +public @interface HasImplicitReceiver { +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/api/JavaVersion.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/api/JavaVersion.java new file mode 100644 index 0000000..b6c0388 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/api/JavaVersion.java @@ -0,0 +1,320 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api; + +import com.google.common.annotations.VisibleForTesting; + +import java.util.ArrayList; +import java.util.List; + +/** + * An enumeration of Java versions. + * Before 9: http://www.oracle.com/technetwork/java/javase/versioning-naming-139433.html + * 9+: http://openjdk.java.net/jeps/223 + */ +public enum JavaVersion { + VERSION_1_1, VERSION_1_2, VERSION_1_3, VERSION_1_4, + VERSION_1_5, VERSION_1_6, VERSION_1_7, VERSION_1_8, + VERSION_1_9, VERSION_1_10, + /** + * Java 11 major version. + * + * @since 4.7 + */ + VERSION_11, + + /** + * Java 12 major version. + * + * @since 5.0 + */ + VERSION_12, + + /** + * Java 13 major version. + * + * @since 6.0 + */ + VERSION_13, + + /** + * Java 14 major version. + * + * @since 6.3 + */ + VERSION_14, + + /** + * Java 15 major version. + * + * @since 6.3 + */ + @Incubating + VERSION_15, + + /** + * Java 16 major version. + * Not officially supported by Gradle. Use at your own risk. + * + * @since 6.3 + */ + @Incubating + VERSION_16, + + /** + * Java 17 major version. + * Not officially supported by Gradle. Use at your own risk. + * + * @since 6.3 + */ + @Incubating + VERSION_17, + + /** + * Higher version of Java. + * @since 4.7 + */ + VERSION_HIGHER; + // Since Java 9, version should be X instead of 1.X + // However, to keep backward compatibility, we change from 11 + private static final int FIRST_MAJOR_VERSION_ORDINAL = 10; + private static JavaVersion currentJavaVersion; + private final String versionName; + + JavaVersion() { + this.versionName = ordinal() >= FIRST_MAJOR_VERSION_ORDINAL ? getMajorVersion() : "1." + getMajorVersion(); + } + + /** + * Converts the given object into a {@code JavaVersion}. + * + * @param value An object whose toString() value is to be converted. May be null. + * @return The version, or null if the provided value is null. + * @throws IllegalArgumentException when the provided value cannot be converted. + */ + public static JavaVersion toVersion(Object value) throws IllegalArgumentException { + if (value == null) { + return null; + } + if (value instanceof JavaVersion) { + return (JavaVersion) value; + } + if (value instanceof Integer) { + return getVersionForMajor((Integer) value); + } + + String name = value.toString(); + + int firstNonVersionCharIndex = findFirstNonVersionCharIndex(name); + + String[] versionStrings = name.substring(0, firstNonVersionCharIndex).split("\\."); + List versions = convertToNumber(name, versionStrings); + + if (isLegacyVersion(versions)) { + assertTrue(name, versions.get(1) > 0); + return getVersionForMajor(versions.get(1)); + } else { + return getVersionForMajor(versions.get(0)); + } + } + + /** + * Returns the version of the current JVM. + * + * @return The version of the current JVM. + */ + public static JavaVersion current() { + if (currentJavaVersion == null) { + currentJavaVersion = toVersion(System.getProperty("java.version")); + } + return currentJavaVersion; + } + + @VisibleForTesting + static void resetCurrent() { + currentJavaVersion = null; + } + + public static JavaVersion forClassVersion(int classVersion) { + return getVersionForMajor(classVersion - 44); //class file versions: 1.1 == 45, 1.2 == 46... + } + + public static JavaVersion forClass(byte[] classData) { + if (classData.length < 8) { + throw new IllegalArgumentException("Invalid class format. Should contain at least 8 bytes"); + } + return forClassVersion(classData[7] & 0xFF); + } + + public boolean isJava5() { + return this == VERSION_1_5; + } + + public boolean isJava6() { + return this == VERSION_1_6; + } + + public boolean isJava7() { + return this == VERSION_1_7; + } + + public boolean isJava8() { + return this == VERSION_1_8; + } + + public boolean isJava9() { + return this == VERSION_1_9; + } + + public boolean isJava10() { + return this == VERSION_1_10; + } + + /** + * Returns if the version is Java 11. + * + * @since 4.7 + */ + public boolean isJava11() { + return this == VERSION_11; + } + + /** + * Returns if the version is Java 12. + * + * @since 5.0 + */ + @Incubating + public boolean isJava12() { + return this == VERSION_12; + } + + public boolean isJava5Compatible() { + return isCompatibleWith(VERSION_1_5); + } + + public boolean isJava6Compatible() { + return isCompatibleWith(VERSION_1_6); + } + + public boolean isJava7Compatible() { + return isCompatibleWith(VERSION_1_7); + } + + public boolean isJava8Compatible() { + return isCompatibleWith(VERSION_1_8); + } + + public boolean isJava9Compatible() { + return isCompatibleWith(VERSION_1_9); + } + + public boolean isJava10Compatible() { + return isCompatibleWith(VERSION_1_10); + } + + /** + * Returns if the version is Java 11 compatible. + * + * @since 4.7 + */ + public boolean isJava11Compatible() { + return isCompatibleWith(VERSION_11); + } + + /** + * Returns if the version is Java 12 compatible. + * + * @since 5.0 + */ + @Incubating + public boolean isJava12Compatible() { + return isCompatibleWith(VERSION_12); + } + + /** + * Returns if this version is compatible with the given version + * + * @since 6.0 + */ + @Incubating + public boolean isCompatibleWith(JavaVersion otherVersion) { + return this.compareTo(otherVersion) >= 0; + } + + @Override + public String toString() { + return versionName; + } + + // We have to keep this for a while: https://github.com/gradle/gradle/issues/4856 + private String getName() { + return versionName; + } + + public String getMajorVersion() { + return String.valueOf(ordinal() + 1); + } + + private static JavaVersion getVersionForMajor(int major) { + return major >= values().length ? JavaVersion.VERSION_HIGHER : values()[major - 1]; + } + + private static void assertTrue(String value, boolean condition) { + if (!condition) { + throw new IllegalArgumentException("Could not determine java version from '" + value + "'."); + } + } + + private static boolean isLegacyVersion(List versions) { + return 1 == versions.get(0) && versions.size() > 1; + } + + private static List convertToNumber(String value, String[] versionStrs) { + List result = new ArrayList(); + for (String s : versionStrs) { + assertTrue(value, !isNumberStartingWithZero(s)); + try { + result.add(Integer.parseInt(s)); + } catch (NumberFormatException e) { + assertTrue(value, false); + } + } + assertTrue(value, !result.isEmpty() && result.get(0) > 0); + return result; + } + + private static boolean isNumberStartingWithZero(String number) { + return number.length() > 1 && number.startsWith("0"); + } + + private static int findFirstNonVersionCharIndex(String s) { + assertTrue(s, s.length() != 0); + + for (int i = 0; i < s.length(); ++i) { + if (!isDigitOrPeriod(s.charAt(i))) { + assertTrue(s, i != 0); + return i; + } + } + + return s.length(); + } + + private static boolean isDigitOrPeriod(char c) { + return (c >= '0' && c <= '9') || c == '.'; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/api/UncheckedIOException.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/api/UncheckedIOException.java new file mode 100644 index 0000000..1dc2f46 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/api/UncheckedIOException.java @@ -0,0 +1,36 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api; + +/** + * UncheckedIOException is used to wrap an {@link java.io.IOException} into an unchecked exception. + */ +public class UncheckedIOException extends RuntimeException { + public UncheckedIOException() { + } + + public UncheckedIOException(String message) { + super(message); + } + + public UncheckedIOException(String message, Throwable cause) { + super(message, cause); + } + + public UncheckedIOException(Throwable cause) { + super(cause); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/internal/ErroringAction.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/internal/ErroringAction.java new file mode 100644 index 0000000..5a7e878 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/internal/ErroringAction.java @@ -0,0 +1,44 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal; + +import org.gradle.api.Action; + +/** + * Action adapter/implementation for action code that may throw exceptions. + * + * Implementations implement doExecute() (instead of execute()) which is allowed to throw checked exceptions. + * Any checked exceptions thrown will be wrapped as unchecked exceptions and re-thrown. + * + * How the exception is wrapped is subject to {@link UncheckedException#throwAsUncheckedException(Throwable)}. + * + * @param The type of object which this action accepts. + */ +public abstract class ErroringAction implements Action { + + @Override + public void execute(T thing) { + try { + doExecute(thing); + } catch (Exception e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + + protected abstract void doExecute(T thing) throws Exception; + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/internal/InternalListener.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/internal/InternalListener.java new file mode 100644 index 0000000..9a03d7f --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/internal/InternalListener.java @@ -0,0 +1,33 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal; + +/** + * Indicator that the object should not be considered user code. + *

+ * Execution of user code listeners are observable as build operations, with provenance information. + * Internal listeners are not. + * This is implemented by decorating user code listeners at the registration site. + * This interface is used to suppress the decoration. + *

+ * User can generally do very little about internal listeners (i.e. they are a fixed cost), + * while they do have control of user code listeners. + *

+ * There are some reusable implementations of this, such as {@link org.gradle.api.internal.InternalAction}. + */ +public interface InternalListener { +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/internal/MutableActionSet.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/internal/MutableActionSet.java new file mode 100644 index 0000000..652eae9 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/internal/MutableActionSet.java @@ -0,0 +1,44 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.internal; + +import org.gradle.api.Action; + +/** + * A mutable composite {@link Action}. Actions are executed in the order added, stopping on the first failure. + * + * This type is not thread-safe. + * + * Consider using {@link org.gradle.internal.ImmutableActionSet} instead of this. + * + * Implements {@link InternalListener} as components themselves should be decorated if appropriate. + */ +public class MutableActionSet implements Action, InternalListener { + private ImmutableActionSet actions = ImmutableActionSet.empty(); + + public void add(Action action) { + this.actions = actions.add(action); + } + + @Override + public void execute(T t) { + actions.execute(t); + } + + public boolean isEmpty() { + return actions.isEmpty(); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/internal/classloader/ClasspathUtil.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/internal/classloader/ClasspathUtil.java new file mode 100644 index 0000000..5bd72e0 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/internal/classloader/ClasspathUtil.java @@ -0,0 +1,177 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.classloader; + +import org.gradle.api.GradleException; +import org.gradle.internal.UncheckedException; +import org.gradle.internal.classpath.ClassPath; +import org.gradle.internal.classpath.DefaultClassPath; +import org.gradle.internal.reflect.JavaMethod; + +import java.io.File; +import java.net.MalformedURLException; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.net.URLClassLoader; +import java.security.CodeSource; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +public class ClasspathUtil { + public static void addUrl(URLClassLoader classLoader, Iterable classpathElements) { + try { + Set original = new HashSet(); + for (URL url : classLoader.getURLs()) { + original.add(toURI(url)); + } + JavaMethod method = JavaMethod.of(URLClassLoader.class, Object.class, "addURL", URL.class); + for (URL classpathElement : classpathElements) { + if (original.add(toURI(classpathElement))) { + method.invoke(classLoader, classpathElement); + } + } + } catch (Throwable t) { + throw new RuntimeException(String.format("Could not add URLs %s to class path for ClassLoader %s", classpathElements, classLoader), t); + } + } + + public static ClassPath getClasspath(ClassLoader classLoader) { + final List implementationClassPath = new ArrayList(); + collectClasspathOf(classLoader, implementationClassPath); + return DefaultClassPath.of(implementationClassPath); + } + + public static void collectClasspathOf(ClassLoader classLoader, final Collection classpathFiles) { + new ClassLoaderVisitor() { + @Override + public void visitClassPath(URL[] classPath) { + for (URL url : classPath) { + if (url.getProtocol() != null && url.getProtocol().equals("file")) { + try { + classpathFiles.add(new File(toURI(url))); + } catch (URISyntaxException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + } + } + }.visit(classLoader); + } + + public static File getClasspathForClass(String targetClassName) { + try { + Class clazz = Class.forName(targetClassName); + if (clazz.getClassLoader() == null) { + return null; + } else { + return getClasspathForClass(Class.forName(targetClassName)); + } + } catch (ClassNotFoundException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + + public static File getClasspathForClass(Class targetClass) { + URI location; + try { + CodeSource codeSource = targetClass.getProtectionDomain().getCodeSource(); + if (codeSource != null && codeSource.getLocation() != null) { + location = toURI(codeSource.getLocation()); + if (location.getScheme().equals("file")) { + return new File(location); + } + } + if (targetClass.getClassLoader() != null) { + String resourceName = targetClass.getName().replace('.', '/') + ".class"; + URL resource = targetClass.getClassLoader().getResource(resourceName); + if (resource != null) { + return getClasspathForResource(resource, resourceName); + } + } + throw new GradleException(String.format("Cannot determine classpath for class %s.", targetClass.getName())); + } catch (URISyntaxException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + + public static File getClasspathForResource(ClassLoader classLoader, String name) { + if (classLoader == null) { + return getClasspathForResource(ClassLoader.getSystemResource(name), name); + } else { + return getClasspathForResource(classLoader.getResource(name), name); + } + } + + public static File getClasspathForResource(URL resource, String name) { + URI location; + try { + location = toURI(resource); + String path = location.getPath(); + if (location.getScheme().equals("file")) { + assert path.endsWith("/" + name); + return new File(path.substring(0, path.length() - (name.length() + 1))); + } else if (location.getScheme().equals("jar")) { + String schemeSpecificPart = location.getRawSchemeSpecificPart(); + int pos = schemeSpecificPart.indexOf("!"); + if (pos > 0) { + assert schemeSpecificPart.substring(pos + 1).equals("/" + name); + URI jarFile = new URI(schemeSpecificPart.substring(0, pos)); + if (jarFile.getScheme().equals("file")) { + return new File(jarFile.getPath()); + } + } + } + } catch (URISyntaxException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + throw new GradleException(String.format("Cannot determine classpath for resource '%s' from location '%s'.", name, location)); + } + + private static URI toURI(URL url) throws URISyntaxException { + try { + return url.toURI(); + } catch (URISyntaxException e) { + try { + return new URL(url.getProtocol(), + url.getHost(), + url.getPort(), + url.getFile().replace(" ", "%20")).toURI(); + } catch (MalformedURLException e1) { + throw UncheckedException.throwAsUncheckedException(e1); + } + } + } + + /** + * Collects all URLs from {@code startingClassloader} (inclusive) until {@code stopAt} (exclusive) into {@code classpath}. + * + * If {@code stopAt} is not a parent of {@code startingClassloader}, this effectively collects all URLs from the classloader hierarchy. + */ + public static void collectClasspathUntil(ClassLoader startingClassloader, ClassLoader stopAt, final Set classpath) { + new ClassLoaderVisitor(stopAt) { + @Override + public void visitClassPath(URL[] classPath) { + classpath.addAll(Arrays.asList(classPath)); + } + }.visit(startingClassloader); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/internal/concurrent/ThreadFactoryImpl.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/internal/concurrent/ThreadFactoryImpl.java new file mode 100644 index 0000000..42f6d0f --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/internal/concurrent/ThreadFactoryImpl.java @@ -0,0 +1,59 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.concurrent; + +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.atomic.AtomicLong; + +/** + * Provides meaningful names to threads created in a thread pool. + * And mark them as managed by Gradle. + */ +public class ThreadFactoryImpl implements ThreadFactory { + private final AtomicLong counter = new AtomicLong(); + private final String displayName; + + public ThreadFactoryImpl(String displayName) { + this.displayName = displayName; + } + + @Override + public Thread newThread(Runnable r) { + Thread thread = new Thread(new ManagedThreadRunnable(r)); + long count = counter.incrementAndGet(); + if (count == 1) { + thread.setName(displayName); + } else { + thread.setName(displayName + " Thread " + count); + } + return thread; + } + + private static class ManagedThreadRunnable implements Runnable { + private final Runnable delegate; + + private ManagedThreadRunnable(Runnable delegate) { + this.delegate = delegate; + } + + @Override + public void run() { + GradleThread.setManaged(); + delegate.run(); + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/internal/serialization/Transient.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/internal/serialization/Transient.java new file mode 100644 index 0000000..5a81e1a --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/base-services/org/gradle/internal/serialization/Transient.java @@ -0,0 +1,108 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.serialization; + +import javax.annotation.Nullable; + +/** + * A value that gets discarded during serialization. + */ +public abstract class Transient implements java.io.Serializable { + + /** + * A mutable variable that gets discarded during serialization. + */ + public static abstract class Var extends Transient { + public abstract void set(T value); + } + + public static Transient of(T value) { + return new ImmutableTransient(value); + } + + public static Var varOf() { + return varOf(null); + } + + public static Var varOf(@Nullable T value) { + return new MutableTransient(value); + } + + @Nullable + public abstract T get(); + + private static class ImmutableTransient extends Transient { + + private final T value; + + public ImmutableTransient(T value) { + this.value = value; + } + + @Override + public T get() { + return value; + } + + private Object writeReplace() { + return DISCARDED; + } + } + + private static class MutableTransient extends Var { + + @Nullable + private T value; + + public MutableTransient(@Nullable T value) { + this.value = value; + } + + @Override + public T get() { + return value; + } + + @Override + public void set(T value) { + this.value = value; + } + + private Object writeReplace() { + return DISCARDED; + } + } + + private static class Discarded extends Var { + + @Override + public void set(T value) { + throw new IllegalStateException("The value of this property cannot be set after it has been discarded during serialization."); + } + + @Override + public T get() { + throw new IllegalStateException("The value of this property has been discarded during serialization."); + } + + private Object readResolve() { + return DISCARDED; + } + } + + private static final Transient DISCARDED = new Discarded(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/build-cache/org/gradle/caching/internal/controller/operations/LoadOperationHitResult.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/build-cache/org/gradle/caching/internal/controller/operations/LoadOperationHitResult.java new file mode 100644 index 0000000..e93f439 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/build-cache/org/gradle/caching/internal/controller/operations/LoadOperationHitResult.java @@ -0,0 +1,39 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.caching.internal.controller.operations; + +import org.gradle.caching.internal.operations.BuildCacheRemoteLoadBuildOperationType; + +public class LoadOperationHitResult implements BuildCacheRemoteLoadBuildOperationType.Result { + + private final long size; + + public LoadOperationHitResult(long size) { + this.size = size; + } + + @Override + public boolean isHit() { + return true; + } + + @Override + public long getArchiveSize() { + return size; + } + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/build-events/org/gradle/internal/build/event/BuildEventListenerRegistryInternal.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/build-events/org/gradle/internal/build/event/BuildEventListenerRegistryInternal.java new file mode 100644 index 0000000..5dd9dbb --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/build-events/org/gradle/internal/build/event/BuildEventListenerRegistryInternal.java @@ -0,0 +1,34 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.build.event; + +import org.gradle.api.provider.Provider; +import org.gradle.build.event.BuildEventsListenerRegistry; +import org.gradle.internal.operations.BuildOperationListener; + +import java.util.List; + +public interface BuildEventListenerRegistryInternal extends BuildEventsListenerRegistry { + /** + * Subscribes the given listener to build operation completion events. Note that no start events are forwarded to the listener. + */ + void onOperationCompletion(Provider provider); + + void subscribe(Provider provider); + + List> getSubscriptions(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/build-init/org/gradle/buildinit/plugins/internal/modifiers/WithIdentifier.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/build-init/org/gradle/buildinit/plugins/internal/modifiers/WithIdentifier.java new file mode 100644 index 0000000..f392a2b --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/build-init/org/gradle/buildinit/plugins/internal/modifiers/WithIdentifier.java @@ -0,0 +1,21 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.buildinit.plugins.internal.modifiers; + +public interface WithIdentifier { + String getId(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/build-option/org/gradle/internal/buildoption/AbstractBuildOption.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/build-option/org/gradle/internal/buildoption/AbstractBuildOption.java new file mode 100644 index 0000000..8df35c2 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/build-option/org/gradle/internal/buildoption/AbstractBuildOption.java @@ -0,0 +1,69 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.buildoption; + +import org.gradle.cli.CommandLineOption; +import org.gradle.cli.CommandLineParser; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +/** + * Provides a basic infrastructure for build option implementations. + * + * @since 4.3 + */ +public abstract class AbstractBuildOption implements BuildOption { + + protected final String gradleProperty; + protected final List commandLineOptionConfigurations; + + public AbstractBuildOption(String gradleProperty) { + this(gradleProperty, (V[]) null); + } + + public AbstractBuildOption(String gradleProperty, V... commandLineOptionConfiguration) { + this.gradleProperty = gradleProperty; + this.commandLineOptionConfigurations = commandLineOptionConfiguration != null ? Arrays.asList(commandLineOptionConfiguration) : Collections.emptyList(); + + } + + @Override + public String getGradleProperty() { + return gradleProperty; + } + + protected boolean isTrue(String value) { + return value != null && value.trim().equalsIgnoreCase("true"); + } + + protected CommandLineOption configureCommandLineOption(CommandLineParser parser, String[] options, String description, boolean deprecated, boolean incubating) { + CommandLineOption option = parser.option(options) + .hasDescription(description); + + if(deprecated) { + option.deprecated(); + } + + if (incubating) { + option.incubating(); + } + + return option; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/code-quality/org/gradle/api/plugins/quality/CodeNarc.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/code-quality/org/gradle/api/plugins/quality/CodeNarc.java new file mode 100644 index 0000000..fb56004 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/code-quality/org/gradle/api/plugins/quality/CodeNarc.java @@ -0,0 +1,251 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.plugins.quality; + +import groovy.lang.Closure; +import org.gradle.api.Action; +import org.gradle.api.Incubating; +import org.gradle.api.file.FileCollection; +import org.gradle.api.file.FileTree; +import org.gradle.api.internal.project.IsolatedAntBuilder; +import org.gradle.api.model.ObjectFactory; +import org.gradle.api.plugins.quality.internal.CodeNarcInvoker; +import org.gradle.api.plugins.quality.internal.CodeNarcReportsImpl; +import org.gradle.api.reporting.Reporting; +import org.gradle.api.resources.TextResource; +import org.gradle.api.tasks.CacheableTask; +import org.gradle.api.tasks.Classpath; +import org.gradle.api.tasks.Input; +import org.gradle.api.tasks.Internal; +import org.gradle.api.tasks.Nested; +import org.gradle.api.tasks.PathSensitive; +import org.gradle.api.tasks.PathSensitivity; +import org.gradle.api.tasks.SourceTask; +import org.gradle.api.tasks.TaskAction; +import org.gradle.api.tasks.VerificationTask; +import org.gradle.util.ClosureBackedAction; + +import javax.inject.Inject; +import java.io.File; + +/** + * Runs CodeNarc against some source files. + */ +@CacheableTask +public class CodeNarc extends SourceTask implements VerificationTask, Reporting { + + private FileCollection codenarcClasspath; + + private FileCollection compilationClasspath; + + private TextResource config; + + private int maxPriority1Violations; + + private int maxPriority2Violations; + + private int maxPriority3Violations; + + private final CodeNarcReports reports; + + private boolean ignoreFailures; + + public CodeNarc() { + reports = getObjectFactory().newInstance(CodeNarcReportsImpl.class, this); + compilationClasspath = getProject().files(); + } + + /** + * The CodeNarc configuration file to use. + */ + @Internal + public File getConfigFile() { + return getConfig() == null ? null : getConfig().asFile(); + } + + /** + * {@inheritDoc} + */ + @Override + @PathSensitive(PathSensitivity.RELATIVE) + public FileTree getSource() { + return super.getSource(); + } + + /** + * The CodeNarc configuration file to use. + */ + public void setConfigFile(File configFile) { + setConfig(getProject().getResources().getText().fromFile(configFile)); + } + + @Inject + protected ObjectFactory getObjectFactory() { + throw new UnsupportedOperationException(); + } + + @Inject + public IsolatedAntBuilder getAntBuilder() { + throw new UnsupportedOperationException(); + } + + @TaskAction + public void run() { + CodeNarcInvoker.invoke(this); + } + + /** + * Configures the reports to be generated by this task. + */ + @Override + public CodeNarcReports reports(Closure closure) { + return reports(new ClosureBackedAction(closure)); + } + + /** + * Configures the reports to be generated by this task. + */ + @Override + public CodeNarcReports reports(Action configureAction) { + configureAction.execute(reports); + return reports; + } + + /** + * The class path containing the CodeNarc library to be used. + */ + @Classpath + public FileCollection getCodenarcClasspath() { + return codenarcClasspath; + } + + /** + * The class path containing the CodeNarc library to be used. + */ + public void setCodenarcClasspath(FileCollection codenarcClasspath) { + this.codenarcClasspath = codenarcClasspath; + } + + /** + * The class path to be used by CodeNarc when compiling classes during analysis. + * + * @since 4.2 + */ + @Incubating + @Classpath + public FileCollection getCompilationClasspath() { + return compilationClasspath; + } + + /** + * The class path to be used by CodeNarc when compiling classes during analysis. + * + * @since 4.2 + */ + @Incubating + public void setCompilationClasspath(FileCollection compilationClasspath) { + this.compilationClasspath = compilationClasspath; + } + + /** + * The CodeNarc configuration to use. Replaces the {@code configFile} property. + * + * @since 2.2 + */ + @Nested + public TextResource getConfig() { + return config; + } + + /** + * The CodeNarc configuration to use. Replaces the {@code configFile} property. + * + * @since 2.2 + */ + public void setConfig(TextResource config) { + this.config = config; + } + + /** + * The maximum number of priority 1 violations allowed before failing the build. + */ + @Input + public int getMaxPriority1Violations() { + return maxPriority1Violations; + } + + /** + * The maximum number of priority 1 violations allowed before failing the build. + */ + public void setMaxPriority1Violations(int maxPriority1Violations) { + this.maxPriority1Violations = maxPriority1Violations; + } + + /** + * The maximum number of priority 2 violations allowed before failing the build. + */ + @Input + public int getMaxPriority2Violations() { + return maxPriority2Violations; + } + + /** + * The maximum number of priority 2 violations allowed before failing the build. + */ + public void setMaxPriority2Violations(int maxPriority2Violations) { + this.maxPriority2Violations = maxPriority2Violations; + } + + /** + * The maximum number of priority 3 violations allowed before failing the build. + */ + @Input + public int getMaxPriority3Violations() { + return maxPriority3Violations; + } + + /** + * The maximum number of priority 3 violations allowed before failing the build. + */ + public void setMaxPriority3Violations(int maxPriority3Violations) { + this.maxPriority3Violations = maxPriority3Violations; + } + + /** + * The reports to be generated by this task. + */ + @Override + @Nested + public CodeNarcReports getReports() { + return reports; + } + + /** + * Whether the build should break when the verifications performed by this task fail. + */ + @Override + public boolean getIgnoreFailures() { + return ignoreFailures; + } + + /** + * Whether the build should break when the verifications performed by this task fail. + */ + @Override + public void setIgnoreFailures(boolean ignoreFailures) { + this.ignoreFailures = ignoreFailures; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/code-quality/org/gradle/api/plugins/quality/internal/AbstractCodeQualityPlugin.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/code-quality/org/gradle/api/plugins/quality/internal/AbstractCodeQualityPlugin.java new file mode 100644 index 0000000..53568ce --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/code-quality/org/gradle/api/plugins/quality/internal/AbstractCodeQualityPlugin.java @@ -0,0 +1,221 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.plugins.quality.internal; + +import com.google.common.base.Function; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.Iterables; +import com.google.common.util.concurrent.Callables; +import org.gradle.api.Action; +import org.gradle.api.Plugin; +import org.gradle.api.Task; +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.internal.ConventionMapping; +import org.gradle.api.internal.IConventionAware; +import org.gradle.api.internal.project.ProjectInternal; +import org.gradle.api.plugins.JavaBasePlugin; +import org.gradle.api.plugins.JavaPluginConvention; +import org.gradle.api.plugins.ReportingBasePlugin; +import org.gradle.api.plugins.quality.CodeQualityExtension; +import org.gradle.api.reporting.ReportingExtension; +import org.gradle.api.tasks.SourceSet; +import org.gradle.api.tasks.SourceSetContainer; + +import java.io.File; +import java.util.ArrayList; +import java.util.Map; +import java.util.concurrent.Callable; + +public abstract class AbstractCodeQualityPlugin implements Plugin { + + protected static ConventionMapping conventionMappingOf(Object object) { + return ((IConventionAware) object).getConventionMapping(); + } + + protected ProjectInternal project; + protected CodeQualityExtension extension; + + @Override + public final void apply(ProjectInternal project) { + this.project = project; + + beforeApply(); + project.getPluginManager().apply(ReportingBasePlugin.class); + createConfigurations(); + extension = createExtension(); + configureExtensionRule(); + configureTaskRule(); + configureSourceSetRule(); + configureCheckTask(); + } + + protected abstract String getToolName(); + + protected abstract Class getTaskType(); + + private Class getCastedTaskType() { + return (Class) getTaskType(); + } + + protected String getTaskBaseName() { + return getToolName().toLowerCase(); + } + + protected String getConfigurationName() { + return getToolName().toLowerCase(); + } + + protected String getReportName() { + return getToolName().toLowerCase(); + } + + protected Class getBasePlugin() { + return JavaBasePlugin.class; + } + + protected void beforeApply() { + } + + protected void createConfigurations() { + Configuration configuration = project.getConfigurations().create(getConfigurationName()); + configuration.setVisible(false); + configuration.setTransitive(true); + configuration.setDescription("The " + getToolName() + " libraries to be used for this project."); + // Don't need these things, they're provided by the runtime + configuration.exclude(excludeProperties("ant", "ant")); + configuration.exclude(excludeProperties("org.apache.ant", "ant")); + configuration.exclude(excludeProperties("org.apache.ant", "ant-launcher")); + configuration.exclude(excludeProperties("org.slf4j", "slf4j-api")); + configuration.exclude(excludeProperties("org.slf4j", "jcl-over-slf4j")); + configuration.exclude(excludeProperties("org.slf4j", "log4j-over-slf4j")); + configuration.exclude(excludeProperties("commons-logging", "commons-logging")); + configuration.exclude(excludeProperties("log4j", "log4j")); + configureConfiguration(configuration); + } + + protected abstract void configureConfiguration(Configuration configuration); + + private Map excludeProperties(String group, String module) { + return ImmutableMap.builder() + .put("group", group) + .put("module", module) + .build(); + } + + protected abstract CodeQualityExtension createExtension(); + + private void configureExtensionRule() { + final ConventionMapping extensionMapping = conventionMappingOf(extension); + extensionMapping.map("sourceSets", Callables.returning(new ArrayList())); + extensionMapping.map("reportsDir", new Callable() { + @Override + public File call() { + return project.getExtensions().getByType(ReportingExtension.class).file(getReportName()); + } + }); + withBasePlugin(new Action() { + @Override + public void execute(Plugin plugin) { + extensionMapping.map("sourceSets", new Callable() { + @Override + public SourceSetContainer call() { + return getJavaPluginConvention().getSourceSets(); + } + }); + } + }); + } + + private void configureTaskRule() { + project.getTasks().withType(getCastedTaskType()).configureEach(new Action() { + @Override + public void execute(Task task) { + String prunedName = task.getName().replaceFirst(getTaskBaseName(), ""); + if (prunedName.isEmpty()) { + prunedName = task.getName(); + } + prunedName = ("" + prunedName.charAt(0)).toLowerCase() + prunedName.substring(1); + configureTaskDefaults((T) task, prunedName); + } + }); + } + + protected void configureTaskDefaults(T task, String baseName) { + } + + private void configureSourceSetRule() { + withBasePlugin(new Action() { + @Override + public void execute(Plugin plugin) { + configureForSourceSets(getJavaPluginConvention().getSourceSets()); + } + }); + } + + private void configureForSourceSets(SourceSetContainer sourceSets) { + sourceSets.all(new Action() { + @Override + public void execute(final SourceSet sourceSet) { + project.getTasks().register(sourceSet.getTaskName(getTaskBaseName(), null), getCastedTaskType(), new Action() { + @Override + public void execute(Task task) { + configureForSourceSet(sourceSet, (T)task); + } + }); + } + }); + } + + protected void configureForSourceSet(SourceSet sourceSet, T task) { + } + + private void configureCheckTask() { + withBasePlugin(new Action() { + @Override + public void execute(Plugin plugin) { + configureCheckTaskDependents(); + } + }); + } + + private void configureCheckTaskDependents() { + final String taskBaseName = getTaskBaseName(); + project.getTasks().named(JavaBasePlugin.CHECK_TASK_NAME, new Action() { + @Override + public void execute(Task task) { + task.dependsOn(new Callable() { + @Override + public Object call() { + return Iterables.transform(extension.getSourceSets(), new Function() { + @Override + public String apply(SourceSet sourceSet) { + return sourceSet.getTaskName(taskBaseName, null); + } + }); + } + }); + } + }); + } + + protected void withBasePlugin(Action action) { + project.getPlugins().withType(getBasePlugin(), action); + } + + protected JavaPluginConvention getJavaPluginConvention() { + return project.getConvention().getPlugin(JavaPluginConvention.class); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/composite-builds/org/gradle/composite/internal/DefaultIncludedBuildController.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/composite-builds/org/gradle/composite/internal/DefaultIncludedBuildController.java new file mode 100644 index 0000000..5d371be --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/composite-builds/org/gradle/composite/internal/DefaultIncludedBuildController.java @@ -0,0 +1,319 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.composite.internal; + +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import org.gradle.BuildResult; +import org.gradle.api.GradleException; +import org.gradle.api.execution.TaskExecutionGraph; +import org.gradle.api.execution.TaskExecutionGraphListener; +import org.gradle.api.internal.project.taskfactory.TaskIdentity; +import org.gradle.execution.MultipleBuildFailures; +import org.gradle.execution.taskgraph.TaskListenerInternal; +import org.gradle.internal.UncheckedException; +import org.gradle.internal.build.IncludedBuildState; +import org.gradle.internal.concurrent.Stoppable; +import org.gradle.internal.resources.ResourceLockCoordinationService; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.locks.Condition; +import java.util.concurrent.locks.Lock; +import java.util.concurrent.locks.ReentrantLock; + +import static org.gradle.composite.internal.IncludedBuildTaskResource.State.FAILED; +import static org.gradle.composite.internal.IncludedBuildTaskResource.State.SUCCESS; +import static org.gradle.composite.internal.IncludedBuildTaskResource.State.WAITING; + +class DefaultIncludedBuildController implements Runnable, Stoppable, IncludedBuildController { + private static final Logger LOGGER = LoggerFactory.getLogger(DefaultIncludedBuildController.class); + private final IncludedBuildState includedBuild; + private final ResourceLockCoordinationService coordinationService; + + private enum State { + CollectingTasks, RunningTasks + } + + // Fields guarded by lock + private final Lock lock = new ReentrantLock(); + private final Condition stateChange = lock.newCondition(); + private final Map tasks = Maps.newLinkedHashMap(); + private final Set tasksAdded = Sets.newHashSet(); + private final List taskFailures = new ArrayList(); + private State state = State.CollectingTasks; + private boolean stopRequested; + + public DefaultIncludedBuildController(IncludedBuildState includedBuild, ResourceLockCoordinationService coordinationService) { + this.includedBuild = includedBuild; + this.coordinationService = coordinationService; + } + + @Override + public boolean populateTaskGraph() { + Set tasksToExecute = Sets.newLinkedHashSet(); + lock.lock(); + try { + if (state != State.CollectingTasks) { + throw new IllegalStateException(); + } + for (Map.Entry taskEntry : tasks.entrySet()) { + if (taskEntry.getValue().status == TaskStatus.QUEUED) { + String taskName = taskEntry.getKey(); + if (tasksAdded.add(taskName)) { + tasksToExecute.add(taskName); + } + } + } + } finally { + lock.unlock(); + } + if (tasksToExecute.isEmpty()) { + return false; + } + includedBuild.addTasks(tasksToExecute); + return true; + } + + @Override + public void run() { + while (true) { + Set tasksToExecute = getQueuedTasks(); + if (tasksToExecute == null) { + return; + } + try { + doBuild(tasksToExecute); + } finally { + setState(State.CollectingTasks); + } + } + } + + private void setState(State state) { + lock.lock(); + try { + this.state = state; + stateChange.signalAll(); + } finally { + lock.unlock(); + } + } + + @Override + public void startTaskExecution() { + setState(State.RunningTasks); + } + + @Override + public void awaitTaskCompletion(Collection taskFailures) { + lock.lock(); + try { + while (state == State.RunningTasks) { + try { + stateChange.await(); + } catch (InterruptedException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + taskFailures.addAll(this.taskFailures); + this.taskFailures.clear(); + } finally { + lock.unlock(); + } + } + + @Override + public void stop() { + ArrayList failures = new ArrayList(); + awaitTaskCompletion(failures); + if (!failures.isEmpty()) { + throw new MultipleBuildFailures(failures); + } + lock.lock(); + try { + stopRequested = true; + stateChange.signalAll(); + } finally { + lock.unlock(); + } + } + + @Nullable + private Set getQueuedTasks() { + lock.lock(); + try { + while (state == State.CollectingTasks && !stopRequested) { + try { + stateChange.await(); + } catch (InterruptedException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + if (stopRequested) { + return null; + } + Set tasksToExecute = Sets.newLinkedHashSet(); + for (Map.Entry taskEntry : tasks.entrySet()) { + if (taskEntry.getValue().status == TaskStatus.QUEUED) { + tasksToExecute.add(taskEntry.getKey()); + taskEntry.getValue().status = TaskStatus.EXECUTING; + } + } + return tasksToExecute; + } finally { + lock.unlock(); + } + } + + private void doBuild(final Collection tasksToExecute) { + if (tasksToExecute.isEmpty()) { + return; + } + LOGGER.info("Executing " + includedBuild.getName() + " tasks " + tasksToExecute); + IncludedBuildExecutionListener listener = new IncludedBuildExecutionListener(tasksToExecute); + try { + includedBuild.execute(tasksToExecute, listener); + tasksDone(tasksToExecute, null); + } catch (RuntimeException failure) { + tasksDone(tasksToExecute, failure); + } + } + + private void taskCompleted(String task, Throwable failure) { + lock.lock(); + try { + TaskState taskState = tasks.get(task); + if (taskState == null) { + taskState = new TaskState(); + tasks.put(task, taskState); + } + taskState.status = failure == null ? TaskStatus.SUCCESS : TaskStatus.FAILED; + } finally { + lock.unlock(); + } + // Notify threads that may be waiting on this task to complete. + // This is required because although all builds may share the same coordination service, the 'something may have changed' event that is fired when a task in this build completes + // happens before the state tracked here is updated, and so the worker threads in the consuming build may think the task has not completed and go back to sleep waiting for some + // other event to happen, which may not. Signalling again here means that all worker threads in all builds will be woken up which can be expensive. + // It would be much better to avoid duplicating the task state here and instead have the task executors communicate directly with each other, possibly via some abstraction + // that represents the task outcome + coordinationService.notifyStateChange(); + } + + private void tasksDone(Collection tasksExecuted, @Nullable RuntimeException failure) { + boolean someTasksNotCompleted = false; + lock.lock(); + try { + for (String task : tasksExecuted) { + TaskState taskState = tasks.get(task); + if (taskState.status == TaskStatus.EXECUTING) { + taskState.status = TaskStatus.FAILED; + someTasksNotCompleted = true; + } + } + if (failure != null) { + if (failure instanceof MultipleBuildFailures) { + taskFailures.addAll(((MultipleBuildFailures) failure).getCauses()); + } else { + taskFailures.add(failure); + } + } + } finally { + lock.unlock(); + } + if (someTasksNotCompleted) { + // See the comment in #taskCompleted, above, for why this is here and why this is a problem + coordinationService.notifyStateChange(); + } + } + + @Override + public void queueForExecution(String taskPath) { + lock.lock(); + try { + if (state != State.CollectingTasks) { + throw new IllegalStateException(); + } + if (!tasks.containsKey(taskPath)) { + tasks.put(taskPath, new TaskState()); + } + } finally { + lock.unlock(); + } + } + + @Override + public IncludedBuildTaskResource.State getTaskState(String taskPath) { + lock.lock(); + try { + TaskState state = tasks.get(taskPath); + if (state == null) { + throw new IllegalStateException("Included build task '" + taskPath + "' was never scheduled for execution."); + } + if (state.status == TaskStatus.FAILED) { + return FAILED; + } + if (state.status == TaskStatus.SUCCESS) { + return SUCCESS; + } + return WAITING; + } finally { + lock.unlock(); + } + } + + private enum TaskStatus {QUEUED, EXECUTING, FAILED, SUCCESS} + + private static class TaskState { + public BuildResult result; + public TaskStatus status = TaskStatus.QUEUED; + } + + private class IncludedBuildExecutionListener implements TaskExecutionGraphListener, TaskListenerInternal { + private final Collection tasksToExecute; + + IncludedBuildExecutionListener(Collection tasksToExecute) { + this.tasksToExecute = tasksToExecute; + } + + @Override + public void graphPopulated(TaskExecutionGraph taskExecutionGraph) { + for (String task : tasksToExecute) { + if (!taskExecutionGraph.hasTask(task)) { + throw new GradleException("Task '" + task + "' not found in build '" + includedBuild.getName() + "'."); + } + } + } + + @Override + public void beforeExecute(TaskIdentity taskIdentity) { + } + + @Override + public void afterExecute(TaskIdentity taskIdentity, org.gradle.api.tasks.TaskState state) { + Throwable failure = state.getFailure(); + taskCompleted(taskIdentity.getTaskPath(), failure); + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/configuration-cache/org/gradle/configurationcache/serialization/Logging.kt b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/configuration-cache/org/gradle/configurationcache/serialization/Logging.kt new file mode 100644 index 0000000..79852aa --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/configuration-cache/org/gradle/configurationcache/serialization/Logging.kt @@ -0,0 +1,126 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.configurationcache.serialization + +import org.gradle.api.internal.GeneratedSubclasses +import org.gradle.configurationcache.problems.DocumentationSection +import org.gradle.configurationcache.problems.DocumentationSection.NotYetImplemented +import org.gradle.configurationcache.problems.DocumentationSection.RequirementsDisallowedTypes + +import org.gradle.configurationcache.problems.PropertyProblem +import org.gradle.configurationcache.problems.StructuredMessage +import org.gradle.configurationcache.problems.StructuredMessage.Companion.build +import org.gradle.configurationcache.problems.propertyDescriptionFor + +import kotlin.reflect.KClass + + +typealias StructuredMessageBuilder = StructuredMessage.Builder.() -> Unit + + +fun IsolateContext.logPropertyProblem( + action: String, + exception: Throwable? = null, + documentationSection: DocumentationSection? = null, + message: StructuredMessageBuilder +) { + logPropertyProblem(action, PropertyProblem(trace, build(message), exception, documentationSection)) +} + + +internal +fun IsolateContext.logUnsupported( + action: String, + baseType: KClass<*>, + actualType: Class<*>, + documentationSection: DocumentationSection = RequirementsDisallowedTypes +) { + logPropertyProblem(action, PropertyProblem(trace, + build { + text("cannot ") + text(action) + text(" object of type ") + reference(GeneratedSubclasses.unpack(actualType)) + text(", a subtype of ") + reference(baseType) + text(", as these are not supported with the configuration cache.") + }, null, documentationSection)) +} + + +internal +fun IsolateContext.logUnsupported( + action: String, + baseType: KClass<*>, + documentationSection: DocumentationSection = RequirementsDisallowedTypes +) { + logPropertyProblem(action, PropertyProblem(trace, + build { + text("cannot ") + text(action) + text(" object of type ") + reference(baseType) + text(" as these are not supported with the configuration cache.") + }, null, documentationSection)) +} + + +fun IsolateContext.logNotImplemented(baseType: Class<*>) { + logPropertyProblem { + text("objects of type ") + reference(baseType) + text(" are not yet supported with the configuration cache.") + } +} + + +internal +fun IsolateContext.logNotImplemented(feature: String, documentationSection: DocumentationSection = NotYetImplemented) { + onProblem(PropertyProblem(trace, build { + text("support for $feature is not yet implemented with the configuration cache.") + }, null, documentationSection)) +} + + +private +fun IsolateContext.logPropertyProblem(documentationSection: DocumentationSection? = null, message: StructuredMessageBuilder) { + val problem = PropertyProblem(trace, build(message), null, documentationSection) + logPropertyProblem("serialize", problem) +} + + +private +fun IsolateContext.logPropertyProblem(action: String, problem: PropertyProblem) { + logger.debug("configuration-cache > failed to {} {} because {}", action, propertyDescriptionFor(problem.trace), problem.message) + onProblem(problem) +} + + +internal +inline fun T.withDebugFrame(name: () -> String, writeAction: T.() -> R): R { + val frameName: String? = if (tracer != null) name() else null + try { + frameName?.let { + tracer!!.open(it) + } + return writeAction() + } finally { + frameName?.let { + tracer!!.close(it) + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/NamedDomainObjectCollection.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/NamedDomainObjectCollection.java new file mode 100644 index 0000000..358b228 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/NamedDomainObjectCollection.java @@ -0,0 +1,278 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api; + +import groovy.lang.Closure; +import org.gradle.api.provider.Provider; +import org.gradle.api.specs.Spec; +import org.gradle.api.tasks.Internal; + +import javax.annotation.Nullable; +import java.util.Collection; +import java.util.List; +import java.util.SortedMap; +import java.util.SortedSet; + +/** + *

A {@code NamedDomainObjectCollection} represents a collection of objects that have an inherent, constant, name.

+ * + *

Objects to be added to a named domain object collection must implement {@code equals()} in such a way that no two objects + * with different names are considered equal. That is, all equality tests must consider the name as an + * equality key. Behavior is undefined if two objects with different names are considered equal by their {@code equals()} implementation.

+ * + *

All implementations must guarantee that all elements in the collection are uniquely named. That is, + * an attempt to add an object with a name equal to the name of any existing object in the collection will fail. + * Implementations may choose to simply return false from {@code add(T)} or to throw an exception.

+ * + *

Objects in the collection are accessible as read-only properties, using the name of the object + * as the property name. For example (assuming the 'name' property provides the object name):

+ * + *
+ * books.add(new Book(name: "gradle", title: null))
+ * books.gradle.title = "Gradle in Action"
+ * 
+ * + *

A dynamic method is added for each object which takes a configuration closure. This is equivalent to calling + * {@link #getByName(String, groovy.lang.Closure)}. For example:

+ * + *
+ * books.add(new Book(name: "gradle", title: null))
+ * books.gradle {
+ *   title = "Gradle in Action"
+ * }
+ * 
+ * + *

You can also use the {@code []} operator to access the objects of a collection by name. For example:

+ * + *
+ * books.add(new Book(name: "gradle", title: null))
+ * books['gradle'].title = "Gradle in Action"
+ * 
+ * + *

{@link Rule} objects can be attached to the collection in order to respond to requests for objects by name + * where no object with name exists in the collection. This mechanism can be used to create objects on demand. + * For example:

+ * + *
+ * books.addRule('create any') { books.add(new Book(name: "gradle", title: null)) }
+ * books.gradle.name == "gradle"
+ * 
+ * + * @param The type of objects in this collection. + */ +public interface NamedDomainObjectCollection extends DomainObjectCollection { + + /** + * Adds an object to the collection, if there is no existing object in the collection with the same name. + * + * @param e the item to add to the collection + * @return {@code true} if the item was added, or {@code} false if an item with the same name already exists. + */ + @Override + boolean add(T e); + + /** + * Adds any of the given objects to the collection that do not have the same name as any existing element. + * + * @param c the items to add to the collection + * @return {@code true} if any item was added, or {@code} false if all items have non unique names within this collection. + */ + @Override + boolean addAll(Collection c); + + /** + * An object that represents the naming strategy used to name objects of this collection. + * + * @return Object representing the naming strategy. + */ + Namer getNamer(); + + /** + *

Returns the objects in this collection, as a map from object name to object instance.

+ * + *

The map is ordered by the natural ordering of the object names (i.e. keys).

+ * + * @return The objects. Returns an empty map if this collection is empty. + */ + SortedMap getAsMap(); + + /** + *

Returns the names of the objects in this collection as a Set of Strings.

+ * + *

The set of names is in natural ordering.

+ * + * @return The names. Returns an empty set if this collection is empty. + */ + SortedSet getNames(); + + /** + * Locates an object by name, returning null if there is no such object. + * + * @param name The object name + * @return The object with the given name, or null if there is no such object in this collection. + */ + @Nullable + T findByName(String name); + + /** + * Locates an object by name, failing if there is no such object. + * + * @param name The object name + * @return The object with the given name. Never returns null. + * @throws UnknownDomainObjectException when there is no such object in this collection. + */ + T getByName(String name) throws UnknownDomainObjectException; + + /** + * Locates an object by name, failing if there is no such object. The given configure closure is executed against + * the object before it is returned from this method. The object is passed to the closure as its delegate. + * + * @param name The object name + * @param configureClosure The closure to use to configure the object. + * @return The object with the given name, after the configure closure has been applied to it. Never returns null. + * @throws UnknownDomainObjectException when there is no such object in this collection. + */ + T getByName(String name, Closure configureClosure) throws UnknownDomainObjectException; + + /** + * Locates an object by name, failing if there is no such object. The given configure action is executed against + * the object before it is returned from this method. + * + * @param name The object name + * @param configureAction The action to use to configure the object. + * @return The object with the given name, after the configure action has been applied to it. Never returns null. + * @throws UnknownDomainObjectException when there is no such object in this collection. + * @since 3.1 + */ + T getByName(String name, Action configureAction) throws UnknownDomainObjectException; + + /** + * Locates an object by name, failing if there is no such task. This method is identical to {@link + * #getByName(String)}. You can call this method in your build script by using the groovy {@code []} operator. + * + * @param name The object name + * @return The object with the given name. Never returns null. + * @throws UnknownDomainObjectException when there is no such object in this collection. + */ + T getAt(String name) throws UnknownDomainObjectException; + + /** + * Adds a rule to this collection. The given rule is invoked when an unknown object is requested by name. + * + * @param rule The rule to add. + * @return The added rule. + */ + Rule addRule(Rule rule); + + /** + * Adds a rule to this collection. The given closure is executed when an unknown object is requested by name. The + * requested name is passed to the closure as a parameter. + * + * @param description The description of the rule. + * @param ruleAction The closure to execute to apply the rule. + * @return The added rule. + */ + Rule addRule(String description, Closure ruleAction); + + /** + * Adds a rule to this collection. The given action is executed when an unknown object is requested by name. The + * requested name is passed to the action. + * + * @param description The description of the rule. + * @param ruleAction The action to execute to apply the rule. + * @return The added rule. + * @since 3.3 + */ + Rule addRule(String description, Action ruleAction); + + /** + * Returns the rules used by this collection. + * + * @return The rules, in the order they will be applied. + */ + List getRules(); + + /** + * {@inheritDoc} + */ + @Override + NamedDomainObjectCollection withType(Class type); + + /** + * {@inheritDoc} + */ + @Override + NamedDomainObjectCollection matching(Spec spec); + + /** + * {@inheritDoc} + */ + @Override + NamedDomainObjectCollection matching(Closure spec); + + /** + * Locates a object by name, without triggering its creation or configuration, failing if there is no such object. + * + * @param name The object's name + * @return A {@link Provider} that will return the object when queried. The object may be created and configured at this point, if not already. + * @throws UnknownDomainObjectException If a object with the given name is not defined. + * @since 4.10 + */ + NamedDomainObjectProvider named(String name) throws UnknownDomainObjectException; + + /** + * Locates a object by name, without triggering its creation or configuration, failing if there is no such object. + * The given configure action is executed against the object before it is returned from the provider. + * + * @param name The object's name + * @return A {@link Provider} that will return the object when queried. The object may be created and configured at this point, if not already. + * @throws UnknownDomainObjectException If a object with the given name is not defined. + * @since 5.0 + */ + NamedDomainObjectProvider named(String name, Action configurationAction) throws UnknownDomainObjectException; + + /** + * Locates a object by name and type, without triggering its creation or configuration, failing if there is no such object. + * + * @param name The object's name + * @param type The object's type + * @return A {@link Provider} that will return the object when queried. The object may be created and configured at this point, if not already. + * @throws UnknownDomainObjectException If a object with the given name is not defined. + * @since 5.0 + */ + NamedDomainObjectProvider named(String name, Class type) throws UnknownDomainObjectException; + + /** + * Locates a object by name and type, without triggering its creation or configuration, failing if there is no such object. + * The given configure action is executed against the object before it is returned from the provider. + * + * @param name The object's name + * @param type The object's type + * @param configurationAction The action to use to configure the object. + * @return A {@link Provider} that will return the object when queried. The object may be created and configured at this point, if not already. + * @throws UnknownDomainObjectException If a object with the given name is not defined. + * @since 5.0 + */ + NamedDomainObjectProvider named(String name, Class type, Action configurationAction) throws UnknownDomainObjectException; + + /** + * Provides access to the schema of all created or registered named domain objects in this collection. + * + * @since 4.10 + */ + @Internal + NamedDomainObjectCollectionSchema getCollectionSchema(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/UnknownTaskException.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/UnknownTaskException.java new file mode 100644 index 0000000..2a87031 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/UnknownTaskException.java @@ -0,0 +1,30 @@ +/* + * Copyright 2007 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api; + +/** + *

An UnknownTaskException is thrown when a task referenced by path cannot be found.

+ */ +public class UnknownTaskException extends UnknownDomainObjectException { + public UnknownTaskException(String message) { + super(message); + } + + public UnknownTaskException(String message, Throwable cause) { + super(message, cause); + } +} \ No newline at end of file diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/artifacts/ComponentMetadataSupplierDetails.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/artifacts/ComponentMetadataSupplierDetails.java new file mode 100644 index 0000000..c1e6a51 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/artifacts/ComponentMetadataSupplierDetails.java @@ -0,0 +1,39 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.artifacts; + +import org.gradle.api.artifacts.component.ModuleComponentIdentifier; + +/** + * A component metadata rule details, giving access to the identifier of the component being + * resolved, the metadata builder, and the repository resource accessor for this. + * + * @since 4.0 + */ +public interface ComponentMetadataSupplierDetails { + /** + * Returns the identifier of the component being resolved + * @return the identifier + */ + ModuleComponentIdentifier getId(); + + /** + * Returns the metadata builder, that users can use to feed metadata for the component. + * @return the metadata builder + */ + ComponentMetadataBuilder getResult(); + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/artifacts/component/LibraryBinaryIdentifier.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/artifacts/component/LibraryBinaryIdentifier.java new file mode 100644 index 0000000..fd26def --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/artifacts/component/LibraryBinaryIdentifier.java @@ -0,0 +1,40 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.artifacts.component; + +/** + * An identifier for a library instance that is built as part of the current build. + */ +public interface LibraryBinaryIdentifier extends ComponentIdentifier { + + /** + * The project path of the library. + * @return The project path of the library. + */ + String getProjectPath(); + + /** + * The name of the library + * @return the name of the library + */ + String getLibraryName(); + + /** + * The variant of the library. + * @return the variant identifier of the library. + */ + String getVariant(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/component/SoftwareComponent.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/component/SoftwareComponent.java new file mode 100644 index 0000000..54e8dd3 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/component/SoftwareComponent.java @@ -0,0 +1,35 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.component; + +import org.gradle.api.Named; +import org.gradle.internal.HasInternalProtocol; + +/** + * A software component produced by a Gradle software project. + * + *

An implementation of this interface may also implement:

+ * + *
    + * + *
  • {@link ComponentWithVariants} to provide information about the variants that the component provides.
  • + * + *
+ */ +@HasInternalProtocol +public interface SoftwareComponent extends Named { +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/internal/artifacts/PublishArtifactInternal.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/internal/artifacts/PublishArtifactInternal.java new file mode 100644 index 0000000..4432b7b --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/internal/artifacts/PublishArtifactInternal.java @@ -0,0 +1,22 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts; + +import org.gradle.api.artifacts.PublishArtifact; + +public interface PublishArtifactInternal extends PublishArtifact { + boolean shouldBePublished(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/invocation/Gradle.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/invocation/Gradle.java new file mode 100644 index 0000000..f27cdbd --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/invocation/Gradle.java @@ -0,0 +1,389 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.invocation; + +import groovy.lang.Closure; +import org.gradle.BuildListener; +import org.gradle.BuildResult; +import org.gradle.StartParameter; +import org.gradle.api.Action; +import org.gradle.api.Incubating; +import org.gradle.api.Project; +import org.gradle.api.ProjectEvaluationListener; +import org.gradle.api.UnknownDomainObjectException; +import org.gradle.api.execution.TaskExecutionGraph; +import org.gradle.api.initialization.IncludedBuild; +import org.gradle.api.initialization.Settings; +import org.gradle.api.plugins.PluginAware; +import org.gradle.api.services.BuildServiceRegistry; +import org.gradle.internal.HasInternalProtocol; + +import javax.annotation.Nullable; +import java.io.File; +import java.util.Collection; + +/** + * Represents an invocation of Gradle. + * + *

You can obtain a {@code Gradle} instance by calling {@link Project#getGradle()}.

+ */ +@HasInternalProtocol +public interface Gradle extends PluginAware { + /** + * Returns the current Gradle version. + * + * @return The Gradle version. Never returns null. + */ + String getGradleVersion(); + + /** + * Returns the Gradle user home directory. + * + * This directory is used to cache downloaded resources, compiled build scripts and so on. + * + * @return The user home directory. Never returns null. + */ + File getGradleUserHomeDir(); + + /** + * Returns the Gradle home directory, if any. + * + * This directory is the directory containing the Gradle distribution executing this build. + *

+ * When using the “Gradle Daemon”, this may not be the same Gradle distribution that the build was started with. + * If an existing daemon process is running that is deemed compatible (e.g. has the desired JVM characteristics) + * then this daemon may be used instead of starting a new process and it may have been started from a different “gradle home”. + * However, it is guaranteed to be the same version of Gradle. For more information on the Gradle Daemon, please consult the + * User Manual. + * + * @return The home directory. May return null. + */ + @Nullable + File getGradleHomeDir(); + + /** + * Returns the parent build of this build, if any. + * + * @return The parent build. May return null. + */ + @Nullable + Gradle getParent(); + + /** + * Returns the root project of this build. + * + * @return The root project. Never returns null. + * @throws IllegalStateException When called before the root project is available. + */ + Project getRootProject() throws IllegalStateException; + + /** + * Adds an action to execute against the root project of this build. + * + * If the root project is already available, the action + * is executed immediately. Otherwise, the action is executed when the root project becomes available. + * + * @param action The action to execute. + */ + void rootProject(Action action); + + /** + * Adds an action to execute against all projects of this build. + * + * The action is executed immediately against all projects which are + * already available. It is also executed as subsequent projects are added to this build. + * + * @param action The action to execute. + */ + void allprojects(Action action); + + /** + * Returns the {@link TaskExecutionGraph} for this build. + * + * @return The task graph. Never returns null. + */ + TaskExecutionGraph getTaskGraph(); + + /** + * Returns the {@link StartParameter} used to start this build. + * + * @return The start parameter. Never returns null. + */ + StartParameter getStartParameter(); + + /** + * Adds a listener to this build, to receive notifications as projects are evaluated. + * + * @param listener The listener to add. Does nothing if this listener has already been added. + * @return The added listener. + */ + ProjectEvaluationListener addProjectEvaluationListener(ProjectEvaluationListener listener); + + /** + * Removes the given listener from this build. + * + * @param listener The listener to remove. Does nothing if this listener has not been added. + */ + void removeProjectEvaluationListener(ProjectEvaluationListener listener); + + /** + * Adds a closure to be called immediately before a project is evaluated. The project is passed to the closure as a + * parameter. + * + * @param closure The closure to execute. + */ + void beforeProject(Closure closure); + + /** + * Adds an action to be called immediately before a project is evaluated. + * + * @param action The action to execute. + * @since 3.4 + */ + void beforeProject(Action action); + + /** + * Adds a closure to be called immediately after a project is evaluated. + * + * The project is passed to the closure as the first parameter. The project evaluation failure, if any, + * is passed as the second parameter. Both parameters are optional. + * + * @param closure The closure to execute. + */ + void afterProject(Closure closure); + + /** + * Adds an action to be called immediately after a project is evaluated. + * + * @param action The action to execute. + * @since 3.4 + */ + void afterProject(Action action); + + /** + * Adds a closure to be called when the build is started. + * + * This {@code Gradle} instance is passed to the closure as the first parameter. + * + * @param closure The closure to execute. + */ + void buildStarted(Closure closure); + + /** + * Adds an action to be called when the build is started. + * + * @param action The action to execute. + * @since 3.4 + */ + void buildStarted(Action action); + + /** + * Adds an action to be called before the build settings have been loaded and evaluated. + * + * @param closure The action to execute. + * @since 6.0 + */ + @Incubating + void beforeSettings(Closure closure); + + /** + * Adds an action to be called before the build settings have been loaded and evaluated. + * + * @param action The action to execute. + * @since 6.0 + */ + @Incubating + void beforeSettings(Action action); + + /** + * Adds a closure to be called when the build settings have been loaded and evaluated. + * + * The settings object is fully configured and is ready to use to load the build projects. The + * {@link org.gradle.api.initialization.Settings} object is passed to the closure as a parameter. + * + * @param closure The closure to execute. + */ + void settingsEvaluated(Closure closure); + + /** + * Adds an action to be called when the build settings have been loaded and evaluated. + * + * The settings object is fully configured and is ready to use to load the build projects. + * + * @param action The action to execute. + * @since 3.4 + */ + void settingsEvaluated(Action action); + + /** + * Adds a closure to be called when the projects for the build have been created from the settings. + * + * None of the projects have been evaluated. This {@code Gradle} instance is passed to the closure as a parameter. + *

+ * An example of hooking into the projectsLoaded to configure buildscript classpath from the init script. + *

+     * //init.gradle
+     * gradle.projectsLoaded {
+     *   rootProject.buildscript {
+     *     repositories {
+     *       //...
+     *     }
+     *     dependencies {
+     *       //...
+     *     }
+     *   }
+     * }
+     * 
+ * + * @param closure The closure to execute. + */ + void projectsLoaded(Closure closure); + + /** + * Adds an action to be called when the projects for the build have been created from the settings. + * + * None of the projects have been evaluated. + * + * @param action The action to execute. + * @since 3.4 + */ + void projectsLoaded(Action action); + + /** + * Adds a closure to be called when all projects for the build have been evaluated. + * + * The project objects are fully configured and are ready to use to populate the task graph. + * This {@code Gradle} instance is passed to the closure as a parameter. + * + * @param closure The closure to execute. + */ + void projectsEvaluated(Closure closure); + + /** + * Adds an action to be called when all projects for the build have been evaluated. + * + * The project objects are fully configured and are ready to use to populate the task graph. + * + * @param action The action to execute. + * @since 3.4 + */ + void projectsEvaluated(Action action); + + /** + * Adds a closure to be called when the build is completed. + * + * All selected tasks have been executed. + * A {@link BuildResult} instance is passed to the closure as a parameter. + * + * @param closure The closure to execute. + */ + void buildFinished(Closure closure); + + /** + * Adds an action to be called when the build is completed. + * + * All selected tasks have been executed. + * + * @param action The action to execute. + * @since 3.4 + */ + void buildFinished(Action action); + + /** + * Adds a {@link BuildListener} to this Build instance. + * + * The listener is notified of events which occur during the execution of the build. + * + * @param buildListener The listener to add. + */ + void addBuildListener(BuildListener buildListener); + + /** + * Adds the given listener to this build. The listener may implement any of the given listener interfaces: + * + *
    + *
  • {@link org.gradle.BuildListener} + *
  • {@link org.gradle.api.execution.TaskExecutionGraphListener} + *
  • {@link org.gradle.api.ProjectEvaluationListener} + *
  • {@link org.gradle.api.execution.TaskExecutionListener} + *
  • {@link org.gradle.api.execution.TaskActionListener} + *
  • {@link org.gradle.api.logging.StandardOutputListener} + *
  • {@link org.gradle.api.tasks.testing.TestListener} + *
  • {@link org.gradle.api.tasks.testing.TestOutputListener} + *
  • {@link org.gradle.api.artifacts.DependencyResolutionListener} + *
+ * + * @param listener The listener to add. Does nothing if this listener has already been added. + */ + void addListener(Object listener); + + /** + * Removes the given listener from this build. + * + * @param listener The listener to remove. Does nothing if this listener has not been added. + */ + void removeListener(Object listener); + + /** + * Uses the given object as a logger. + * + * The logger object may implement any of the listener interfaces supported by + * {@link #addListener(Object)}. + *

+ * Each listener interface has exactly one associated logger. When you call this + * method with a logger of a given listener type, the new logger will replace whichever logger is currently + * associated with the listener type. This allows you to selectively replace the standard logging which Gradle + * provides with your own implementation, for certain types of events. + * + * @param logger The logger to use. + */ + void useLogger(Object logger); + + /** + * Returns this {@code Gradle} instance. + * + * This method is useful in init scripts to explicitly access Gradle + * properties and methods. For example, using gradle.parent can express your intent better than using + * parent. This property also allows you to access Gradle properties from a scope where the property + * may be hidden, such as, for example, from a method or closure. + * + * @return this. Never returns null. + */ + Gradle getGradle(); + + /** + * Returns the build services that are shared by all projects of this build. + * + * @since 6.1 + */ + @Incubating + BuildServiceRegistry getSharedServices(); + + /** + * Returns the included builds for this build. + * + * @since 3.1 + */ + Collection getIncludedBuilds(); + + /** + * Returns the included build with the specified name for this build. + * + * @throws UnknownDomainObjectException when there is no build with the given name + * @since 3.1 + */ + IncludedBuild includedBuild(String name) throws UnknownDomainObjectException; +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/plugins/ObjectConfigurationAction.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/plugins/ObjectConfigurationAction.java new file mode 100644 index 0000000..bf8470e --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/plugins/ObjectConfigurationAction.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.plugins; + +import org.gradle.api.Plugin; + +/** + *

An {@code ObjectConfigurationAction} allows you to apply {@link org.gradle.api.Plugin}s and scripts to an object + * or objects.

+ */ +public interface ObjectConfigurationAction { + /** + *

Specifies some target objects to be configured. Any collections or arrays in the given parameters will be + * flattened, and the script applied to each object in the result, in the order given. Each call to this method adds + * some additional target objects.

+ * + * @param targets The target objects. + * @return this + */ + ObjectConfigurationAction to(Object... targets); + + /** + * Adds a script to use to configure the target objects. You can call this method multiple times, to use multiple + * scripts. Scripts and plugins are applied in the order that they are added. + * + * @param script The script. Evaluated as per {@link org.gradle.api.Project#file(Object)}. However, note that + * a URL can also be used, allowing the script to be fetched using HTTP, for example. + * @return this + */ + ObjectConfigurationAction from(Object script); + + /** + * Adds a {@link org.gradle.api.Plugin} to use to configure the target objects. You can call this method multiple + * times, to use multiple plugins. Scripts and plugins are applied in the order that they are added. + * + * @param pluginClass The plugin to apply. + * @return this + */ + ObjectConfigurationAction plugin(Class pluginClass); + + /** + * Adds the plugin implemented by the given class to the target. + *

+ * The class is expected to either implement {@link Plugin}, or extend {@link org.gradle.model.RuleSource}. + * An exception will be thrown if the class is not a valid plugin implementation. + * + * @param pluginClass the plugin to apply + * @return this + */ + ObjectConfigurationAction type(Class pluginClass); + + /** + * Adds a {@link org.gradle.api.Plugin} to use to configure the target objects. You can call this method multiple + * times, to use multiple plugins. Scripts and plugins are applied in the order that they are added. + * + * @param pluginId The id of the plugin to apply. + * @return this + */ + ObjectConfigurationAction plugin(String pluginId); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/tasks/VerificationTask.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/tasks/VerificationTask.java new file mode 100644 index 0000000..a2f6cce --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/api/tasks/VerificationTask.java @@ -0,0 +1,36 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.tasks; + +/** + * A {@code VerificationTask} is a task which performs some verification of the artifacts produced by a build. + */ +public interface VerificationTask { + /** + * Specifies whether the build should break when the verifications performed by this task fail. + * + * @param ignoreFailures false to break the build on failure, true to ignore the failures. The default is false. + */ + void setIgnoreFailures(boolean ignoreFailures); + + /** + * Specifies whether the build should break when the verifications performed by this task fail. + * + * @return false, when the build should break on failure, true when the failures should be ignored. + */ + @Input + boolean getIgnoreFailures(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/caching/configuration/BuildCache.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/caching/configuration/BuildCache.java new file mode 100644 index 0000000..6594175 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/caching/configuration/BuildCache.java @@ -0,0 +1,45 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.caching.configuration; + +/** + * Configuration object for a build cache. + * + * @since 3.5 + */ +public interface BuildCache { + + /** + * Returns whether the build cache is enabled. + */ + boolean isEnabled(); + + /** + * Sets whether the build cache is enabled. + */ + void setEnabled(boolean enabled); + + /** + * Returns whether a given build can store outputs in the build cache. + */ + boolean isPush(); + + /** + * Sets whether a given build can store outputs in the build cache. + */ + void setPush(boolean enabled); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/internal/typeconversion/NotationConvertResult.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/internal/typeconversion/NotationConvertResult.java new file mode 100644 index 0000000..305bde9 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/internal/typeconversion/NotationConvertResult.java @@ -0,0 +1,26 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.typeconversion; + +public interface NotationConvertResult { + boolean hasResult(); + + /** + * Invoked when a {@link NotationConverter} is able to convert a notation to a result. + */ + void converted(T result); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/vcs/VersionControlRepository.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/vcs/VersionControlRepository.java new file mode 100644 index 0000000..398ad85 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core-api/org/gradle/vcs/VersionControlRepository.java @@ -0,0 +1,62 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.vcs; + +import org.gradle.api.Action; +import org.gradle.api.initialization.definition.InjectedPluginDependencies; + +/** + * Represents the details about a particular VCS repository that contains a build that produces zero or more components that can be used during dependency resolution. + * + *

To make a repository definition useful, call the {@link #producesModule(String)} method for each group and module name that is produced by the build in the repository. When resolving a dependency that matches the group and module name, Gradle will look for a matching version in the repository and if present will check out the source and build the binaries from that source.

+ * + * @since 4.10 + */ +public interface VersionControlRepository { + /** + * Declares that this repository produces (or may produce) component with the given group and module names. + * + * @param module The module identity, in "group:module" format. + */ + void producesModule(String module); + + /** + * Returns the relative path to the root of the build within the repository. + * + *

Defaults to an empty relative path, meaning the root of the repository. + * + * @return the root directory of the build, relative to the root of this repository. + */ + String getRootDir(); + + /** + * Sets the relative path to the root of the build within the repository. Use an empty string to refer to the root of the repository. + * + * @param rootDir The root directory of the build, relative to the root of this repository. + */ + void setRootDir(String rootDir); + + /** + * Defines the plugins to be injected into the build. + * + *

Currently, plugins must be located in the calling build's `buildSrc` project.

+ * + * @param configuration the configuration action for adding injected plugins + * @since 4.6 + */ + void plugins(Action configuration); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/AbstractPolymorphicDomainObjectContainer.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/AbstractPolymorphicDomainObjectContainer.java new file mode 100644 index 0000000..12b1ed6 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/AbstractPolymorphicDomainObjectContainer.java @@ -0,0 +1,170 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal; + +import groovy.lang.Closure; +import org.gradle.api.Action; +import org.gradle.api.NamedDomainObjectProvider; +import org.gradle.api.InvalidUserDataException; +import org.gradle.api.NamedDomainObjectContainer; +import org.gradle.api.Namer; +import org.gradle.internal.Cast; +import org.gradle.internal.Transformers; +import org.gradle.internal.metaobject.AbstractDynamicObject; +import org.gradle.internal.metaobject.ConfigureDelegate; +import org.gradle.internal.metaobject.DynamicInvokeResult; +import org.gradle.internal.metaobject.DynamicObject; +import org.gradle.internal.reflect.Instantiator; +import org.gradle.util.ConfigureUtil; + +import javax.annotation.Nullable; +import java.util.Map; + +public abstract class AbstractPolymorphicDomainObjectContainer + extends AbstractNamedDomainObjectContainer implements PolymorphicDomainObjectContainerInternal { + + private final ContainerElementsDynamicObject elementsDynamicObject = new ContainerElementsDynamicObject(); + + protected AbstractPolymorphicDomainObjectContainer(Class type, Instantiator instantiator, Namer namer, CollectionCallbackActionDecorator callbackDecorator) { + super(type, instantiator, namer, callbackDecorator); + } + + protected abstract U doCreate(String name, Class type); + + @Override + public U create(String name, Class type) { + assertMutable("create(String, Class)"); + return create(name, type, null); + } + + @Override + public U maybeCreate(String name, Class type) throws InvalidUserDataException { + T item = findByName(name); + if (item != null) { + return Transformers.cast(type).transform(item); + } + return create(name, type); + } + + @Override + public U create(String name, Class type, Action configuration) { + assertMutable("create(String, Class, Action)"); + assertCanAdd(name); + U object = doCreate(name, type); + add(object); + if (configuration != null) { + configuration.execute(object); + } + return object; + } + + @Override + public NamedDomainObjectProvider register(String name, Class type) throws InvalidUserDataException { + assertMutable("register(String, Class)"); + return createDomainObjectProvider(name, type, null); + } + + @Override + public NamedDomainObjectProvider register(String name, Class type, Action configurationAction) throws InvalidUserDataException { + assertMutable("register(String, Class, Action)"); + return createDomainObjectProvider(name, type, configurationAction); + } + + protected NamedDomainObjectProvider createDomainObjectProvider(String name, Class type, @Nullable Action configurationAction) { + assertCanAdd(name); + NamedDomainObjectProvider provider = Cast.uncheckedCast( + getInstantiator().newInstance(NamedDomainObjectCreatingProvider.class, AbstractPolymorphicDomainObjectContainer.this, name, type, configurationAction) + ); + addLater(provider); + return provider; + } + + // Cannot be private due to reflective instantiation + public class NamedDomainObjectCreatingProvider extends AbstractDomainObjectCreatingProvider { + public NamedDomainObjectCreatingProvider(String name, Class type, @Nullable Action configureAction) { + super(name, type, configureAction); + } + + @Override + protected I createDomainObject() { + return doCreate(getName(), getType()); + } + } + + @Override + protected DynamicObject getElementsAsDynamicObject() { + return elementsDynamicObject; + } + + @Override + protected ConfigureDelegate createConfigureDelegate(Closure configureClosure) { + return new PolymorphicDomainObjectContainerConfigureDelegate<>(configureClosure, this); + } + + private class ContainerElementsDynamicObject extends AbstractDynamicObject { + @Override + public String getDisplayName() { + return AbstractPolymorphicDomainObjectContainer.this.getDisplayName(); + } + + @Override + public boolean hasProperty(String name) { + return findByName(name) != null; + } + + @Override + public DynamicInvokeResult tryGetProperty(String name) { + Object object = findByName(name); + return object == null ? DynamicInvokeResult.notFound() : DynamicInvokeResult.found(object); + } + + @Override + public Map getProperties() { + return getAsMap(); + } + + @Override + public boolean hasMethod(String name, Object... arguments) { + return isConfigureMethod(name, arguments); + } + + @Override + public DynamicInvokeResult tryInvokeMethod(String name, Object... arguments) { + if (isConfigureMethod(name, arguments)) { + T element = getByName(name); + Object lastArgument = arguments[arguments.length - 1]; + if (lastArgument instanceof Closure) { + ConfigureUtil.configure((Closure) lastArgument, element); + } + return DynamicInvokeResult.found(element); + } + return DynamicInvokeResult.notFound(); + } + + private boolean isConfigureMethod(String name, Object... arguments) { + return (arguments.length == 1 && arguments[0] instanceof Closure + || arguments.length == 1 && arguments[0] instanceof Class + || arguments.length == 2 && arguments[0] instanceof Class && arguments[1] instanceof Closure) + && hasProperty(name); + } + } + + @Override + public NamedDomainObjectContainer containerWithType(Class type) { + return Cast.uncheckedNonnullCast(getInstantiator().newInstance(TypedDomainObjectContainerWrapper.class, type, this)); + } + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/artifacts/dependencies/SelfResolvingDependencyInternal.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/artifacts/dependencies/SelfResolvingDependencyInternal.java new file mode 100644 index 0000000..f891ae3 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/artifacts/dependencies/SelfResolvingDependencyInternal.java @@ -0,0 +1,30 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.dependencies; + +import org.gradle.api.artifacts.SelfResolvingDependency; +import org.gradle.api.artifacts.component.ComponentIdentifier; + +import javax.annotation.Nullable; + +public interface SelfResolvingDependencyInternal extends SelfResolvingDependency { + /** + * Returns the id of the target component of this dependency, if known. If unknown, an arbitrary identifier is assigned to the files referenced by this dependency. + */ + @Nullable + ComponentIdentifier getTargetComponentId(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/attributes/AttributeMergingException.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/attributes/AttributeMergingException.java new file mode 100644 index 0000000..7c49ae6 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/attributes/AttributeMergingException.java @@ -0,0 +1,42 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.attributes; + +import org.gradle.api.attributes.Attribute; + +public class AttributeMergingException extends Exception { + private final Attribute attribute; + private final Object leftValue; + private final Object rightValue; + + public AttributeMergingException(Attribute attribute, Object leftValue, Object rightValue) { + this.attribute = attribute; + this.leftValue = leftValue; + this.rightValue = rightValue; + } + + public Attribute getAttribute() { + return attribute; + } + + public Object getLeftValue() { + return leftValue; + } + + public Object getRightValue() { + return rightValue; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/attributes/DefaultImmutableAttributes.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/attributes/DefaultImmutableAttributes.java new file mode 100644 index 0000000..f071d39 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/attributes/DefaultImmutableAttributes.java @@ -0,0 +1,267 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.attributes; + +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Maps; +import org.gradle.api.Named; +import org.gradle.api.attributes.Attribute; +import org.gradle.api.attributes.AttributeContainer; +import org.gradle.internal.Cast; +import org.gradle.internal.isolation.Isolatable; + +import javax.annotation.Nullable; +import java.util.Comparator; +import java.util.Map; +import java.util.TreeMap; + +final class DefaultImmutableAttributes implements ImmutableAttributes, AttributeValue { + private static final Comparator> ATTRIBUTE_NAME_COMPARATOR = Comparator.comparing(Attribute::getName); + // Coercion is an expensive process, so we cache the result of coercing to other attribute types. + // We can afford using a hashmap here because attributes are interned, and their lifetime doesn't + // exceed a build + private final Map, Object> coercionCache = Maps.newConcurrentMap(); + + final Attribute attribute; + final Isolatable value; + private final ImmutableMap, DefaultImmutableAttributes> hierarchy; + private final ImmutableMap hierarchyByName; + private final int hashCode; + + // Optimize for the single entry case, makes findEntry faster + private final String singleEntryName; + private final DefaultImmutableAttributes singleEntryValue; + + DefaultImmutableAttributes() { + this.attribute = null; + this.value = null; + this.hashCode = 0; + this.hierarchy = ImmutableMap.of(); + this.hierarchyByName = ImmutableMap.of(); + this.singleEntryName = null; + this.singleEntryValue = null; + } + + DefaultImmutableAttributes(DefaultImmutableAttributes parent, Attribute key, Isolatable value) { + this.attribute = key; + this.value = value; + Map, DefaultImmutableAttributes> hierarchy = Maps.newLinkedHashMap(); + hierarchy.putAll(parent.hierarchy); + hierarchy.put(attribute, this); + this.hierarchy = ImmutableMap.copyOf(hierarchy); + Map hierarchyByName = Maps.newLinkedHashMap(); + hierarchyByName.putAll(parent.hierarchyByName); + hierarchyByName.put(attribute.getName(), this); + this.hierarchyByName = ImmutableMap.copyOf(hierarchyByName); + int hashCode = parent.hashCode(); + hashCode = 31 * hashCode + attribute.hashCode(); + hashCode = 31 * hashCode + value.hashCode(); + this.hashCode = hashCode; + if (hierarchyByName.size() == 1) { + Map.Entry entry = hierarchyByName.entrySet().iterator().next(); + singleEntryName = entry.getKey(); + singleEntryValue = entry.getValue(); + } else { + singleEntryName = null; + singleEntryValue = null; + } + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + DefaultImmutableAttributes that = (DefaultImmutableAttributes) o; + + if (hierarchy.size() != that.hierarchy.size()) { + return false; + } + + for (Map.Entry, DefaultImmutableAttributes> entry : hierarchy.entrySet()) { + if (!entry.getValue().value.isolate().equals(that.getAttribute(entry.getKey()))) { + return false; + } + } + return true; + } + + @Override + public int hashCode() { + return hashCode; + } + + @Override + public ImmutableSet> keySet() { + return hierarchy.keySet(); + } + + @Override + public AttributeContainer attribute(Attribute key, T value) { + throw new UnsupportedOperationException("Mutation of attributes is not allowed"); + } + + @Override + public T getAttribute(Attribute key) { + Isolatable isolatable = getIsolatableAttribute(key); + return isolatable == null ? null : isolatable.isolate(); + } + + @Nullable + protected Isolatable getIsolatableAttribute(Attribute key) { + DefaultImmutableAttributes attributes = hierarchy.get(key); + return Cast.uncheckedCast(attributes == null ? null : attributes.value); + } + + /** + * Locates the entry for the given attribute. Returns a 'missing' value when not present. + */ + @Override + public AttributeValue findEntry(Attribute key) { + DefaultImmutableAttributes attributes = hierarchy.get(key); + return Cast.uncheckedNonnullCast(attributes == null ? MISSING : attributes); + } + + /** + * Locates the entry for the attribute with the given name. Returns a 'missing' value when not present. + */ + @Override + public AttributeValue findEntry(String key) { + //noinspection StringEquality + if (singleEntryName == key) { + // The identity check is intentional here, do not replace with .equals() + return singleEntryValue; + } + DefaultImmutableAttributes attributes = hierarchyByName.get(key); + return attributes == null ? MISSING : attributes; + } + + @Override + public Object get() { + return value.isolate(); + } + + @Nullable + private String desugar() { + // We support desugaring for all non-primitive types supported in GradleModuleMetadataWriter.writeAttributes(), which are: + // - Named + // - Enum + if (Named.class.isAssignableFrom(attribute.getType())) { + return ((Named) get()).getName(); + } + if (Enum.class.isAssignableFrom(attribute.getType())) { + return ((Enum) get()).name(); + } + return null; + } + + @Nullable + private S coerce(Class type) { + if (value != null) { + return value.coerce(type); + } + return null; + } + + @Override + public S coerce(Attribute otherAttribute) { + S s = Cast.uncheckedCast(coercionCache.get(otherAttribute)); + if (s == null) { + s = uncachedCoerce(otherAttribute); + coercionCache.put(otherAttribute, s); + } + return s; + } + + private S uncachedCoerce(Attribute otherAttribute) { + Class otherAttributeType = otherAttribute.getType(); + // If attribute types are already compatible, go with it. There are two cases covered here: + // 1) Both attributes are strongly typed and match, usually the case if both are sourced from the local build + // 2) Both attributes are desugared, usually the case if both are sourced from published metadata + if (otherAttributeType.isAssignableFrom(attribute.getType())) { + return Cast.uncheckedCast(get()); + } + + // Attempt to coerce myself into the other attribute's type + // - I am desugared and the other attribute is strongly typed, usually the case if I am sourced from published metadata and the other from the local build + S converted = coerce(otherAttributeType); + if (converted != null) { + return converted; + } else if (otherAttributeType.isAssignableFrom(String.class)) { + // Attempt to desugar myself + // - I am strongly typed and the other is desugared, usually the case if I am sourced from the local build and the other is sourced from published metadata + converted = Cast.uncheckedCast(desugar()); + if (converted != null) { + return converted; + } + } + String foundType = get().getClass().getName(); + if (foundType.equals(otherAttributeType.getName())) { + foundType += " with a different ClassLoader"; + } + throw new IllegalArgumentException(String.format("Unexpected type for attribute '%s' provided. Expected a value of type %s but found a value of type %s.", attribute.getName(), otherAttributeType.getName(), foundType)); + } + + @Override + public boolean isPresent() { + return attribute != null; + } + + @Override + public boolean isEmpty() { + return attribute == null; + } + + @Override + public boolean contains(Attribute key) { + return hierarchy.containsKey(key); + } + + @Override + public ImmutableAttributes asImmutable() { + return this; + } + + @Override + public Map, ?> asMap() { + ImmutableMap.Builder, ?> builder = ImmutableMap.builder(); + for (Attribute attribute : keySet()) { + builder.put(attribute, Cast.uncheckedCast(getAttribute(attribute))); + } + return builder.build(); + } + + @Override + public AttributeContainer getAttributes() { + return this; + } + + @Override + public String toString() { + Map, Object> sorted = new TreeMap<>(ATTRIBUTE_NAME_COMPARATOR); + for (Map.Entry, DefaultImmutableAttributes> entry : hierarchy.entrySet()) { + sorted.put(entry.getKey(), entry.getValue().value.isolate()); + } + return sorted.toString(); + } + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/changedetection/TaskExecutionModeResolver.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/changedetection/TaskExecutionModeResolver.java new file mode 100644 index 0000000..f3b8136 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/changedetection/TaskExecutionModeResolver.java @@ -0,0 +1,23 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.changedetection; + +import org.gradle.api.internal.TaskInternal; +import org.gradle.api.internal.tasks.properties.TaskProperties; + +public interface TaskExecutionModeResolver { + TaskExecutionMode getExecutionMode(TaskInternal task, TaskProperties properties); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/changedetection/state/CrossBuildFileHashCache.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/changedetection/state/CrossBuildFileHashCache.java new file mode 100644 index 0000000..068a007 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/changedetection/state/CrossBuildFileHashCache.java @@ -0,0 +1,77 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.changedetection.state; + +import org.gradle.cache.CacheBuilder; +import org.gradle.cache.CacheRepository; +import org.gradle.cache.FileLockManager; +import org.gradle.cache.PersistentCache; +import org.gradle.cache.PersistentIndexedCache; +import org.gradle.cache.PersistentIndexedCacheParameters; +import org.gradle.cache.internal.InMemoryCacheDecoratorFactory; + +import javax.annotation.Nullable; +import java.io.Closeable; +import java.io.File; + +import static org.gradle.cache.internal.filelock.LockOptionsBuilder.mode; + +public class CrossBuildFileHashCache implements Closeable { + + private final PersistentCache cache; + private final InMemoryCacheDecoratorFactory inMemoryCacheDecoratorFactory; + + public CrossBuildFileHashCache(@Nullable File cacheDir, CacheRepository repository, InMemoryCacheDecoratorFactory inMemoryCacheDecoratorFactory, Kind cacheKind) { + this.inMemoryCacheDecoratorFactory = inMemoryCacheDecoratorFactory; + CacheBuilder cacheBuilder = cacheDir != null ? repository.cache(cacheDir) : repository.cache(cacheKind.cacheId); + cache = cacheBuilder + .withDisplayName(cacheKind.description) + .withLockOptions(mode(FileLockManager.LockMode.OnDemand)) // Lock on demand + .open(); + } + + public PersistentIndexedCache createCache(PersistentIndexedCacheParameters parameters, int maxEntriesToKeepInMemory, boolean cacheInMemoryForShortLivedProcesses) { + return cache.createCache(parameters + .withCacheDecorator(inMemoryCacheDecoratorFactory.decorator(maxEntriesToKeepInMemory, cacheInMemoryForShortLivedProcesses)) + ); + } + + @Override + public void close() { + cache.close(); + } + + public enum Kind { + FILE_HASHES("fileHashes", "file hash cache"), + CHECKSUMS("checksums", "checksums cache"); + private final String cacheId; + private final String description; + + Kind(String cacheId, String description) { + this.cacheId = cacheId; + this.description = description; + } + + public String getCacheId() { + return cacheId; + } + + public String getDescription() { + return description; + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/component/IvyPublishingAwareContext.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/component/IvyPublishingAwareContext.java new file mode 100644 index 0000000..02d4bfa --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/component/IvyPublishingAwareContext.java @@ -0,0 +1,22 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.component; + +public interface IvyPublishingAwareContext extends UsageContext { + + boolean isOptional(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/file/copy/CopyAction.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/file/copy/CopyAction.java new file mode 100644 index 0000000..cea0342 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/file/copy/CopyAction.java @@ -0,0 +1,24 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.file.copy; + +import org.gradle.api.tasks.WorkResult; + +public interface CopyAction { + + WorkResult execute(CopyActionProcessingStream stream); + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/file/copy/CopySpecWrapper.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/file/copy/CopySpecWrapper.java new file mode 100644 index 0000000..302ab3b --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/file/copy/CopySpecWrapper.java @@ -0,0 +1,318 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.file.copy; + +import com.google.common.annotations.VisibleForTesting; +import groovy.lang.Closure; +import org.gradle.api.Action; +import org.gradle.api.NonExtensible; +import org.gradle.api.Transformer; +import org.gradle.api.file.CopyProcessingSpec; +import org.gradle.api.file.CopySpec; +import org.gradle.api.file.DuplicatesStrategy; +import org.gradle.api.file.FileCopyDetails; +import org.gradle.api.file.FileTreeElement; +import org.gradle.api.specs.Spec; +import org.gradle.util.ClosureBackedAction; + +import javax.annotation.Nullable; +import javax.inject.Inject; +import java.io.FilterReader; +import java.util.Map; +import java.util.Set; +import java.util.regex.Pattern; + +/** + * Wraps another CopySpec impl, only exposing the CopySpec API. + * + * Prevents users from accessing "internal" methods on implementations. + */ +@NonExtensible +public class CopySpecWrapper implements CopySpec { + + @VisibleForTesting + final CopySpec delegate; + + @Inject + public CopySpecWrapper(CopySpec delegate) { + this.delegate = delegate; + } + + @Override + public boolean isCaseSensitive() { + return delegate.isCaseSensitive(); + } + + @Override + public void setCaseSensitive(boolean caseSensitive) { + delegate.setCaseSensitive(caseSensitive); + } + + @Override + public boolean getIncludeEmptyDirs() { + return delegate.getIncludeEmptyDirs(); + } + + @Override + public void setIncludeEmptyDirs(boolean includeEmptyDirs) { + delegate.setIncludeEmptyDirs(includeEmptyDirs); + } + + @Override + public DuplicatesStrategy getDuplicatesStrategy() { + return delegate.getDuplicatesStrategy(); + } + + @Override + public void setDuplicatesStrategy(DuplicatesStrategy strategy) { + delegate.setDuplicatesStrategy(strategy); + } + + @Override + public CopySpec filesMatching(String pattern, Action action) { + delegate.filesMatching(pattern, action); + return this; + } + + @Override + public CopySpec filesMatching(Iterable patterns, Action action) { + delegate.filesMatching(patterns, action); + return this; + } + + @Override + public CopySpec filesNotMatching(String pattern, Action action) { + delegate.filesNotMatching(pattern, action); + return this; + } + + @Override + public CopySpec filesNotMatching(Iterable patterns, Action action) { + delegate.filesNotMatching(patterns, action); + return this; + } + + @Override + public CopySpec with(CopySpec... sourceSpecs) { + delegate.with(sourceSpecs); + return this; + } + + @Override + public CopySpec from(Object... sourcePaths) { + delegate.from(sourcePaths); + return this; + } + + @Override + public CopySpec from(Object sourcePath, final Closure c) { + return delegate.from(sourcePath, new ClosureBackedAction<>(c)); + } + + @Override + public CopySpec from(Object sourcePath, Action configureAction) { + return delegate.from(sourcePath, configureAction); + } + + @Override + public CopySpec setIncludes(Iterable includes) { + delegate.setIncludes(includes); + return this; + } + + @Override + public CopySpec setExcludes(Iterable excludes) { + delegate.setExcludes(excludes); + return this; + } + + @Override + public CopySpec include(String... includes) { + delegate.include(includes); + return this; + } + + @Override + public CopySpec include(Iterable includes) { + delegate.include(includes); + return this; + } + + @Override + public CopySpec include(Spec includeSpec) { + delegate.include(includeSpec); + return this; + } + + @Override + public CopySpec include(Closure includeSpec) { + delegate.include(includeSpec); + return this; + } + + @Override + public CopySpec exclude(String... excludes) { + delegate.exclude(excludes); + return this; + } + + @Override + public CopySpec exclude(Iterable excludes) { + delegate.exclude(excludes); + return this; + } + + @Override + public CopySpec exclude(Spec excludeSpec) { + delegate.exclude(excludeSpec); + return this; + } + + @Override + public CopySpec exclude(Closure excludeSpec) { + delegate.exclude(excludeSpec); + return this; + } + + @Override + public CopySpec into(Object destPath) { + delegate.into(destPath); + return this; + } + + @Override + public CopySpec into(Object destPath, Closure configureClosure) { + return delegate.into(destPath, configureClosure); + } + + @Override + public CopySpec into(Object destPath, Action copySpec) { + return delegate.into(destPath, copySpec); + } + + @Override + public CopySpec rename(final Closure closure) { + delegate.rename(s -> { + Object res = closure.call(s); + //noinspection ConstantConditions + return res == null ? null : res.toString(); + }); + return this; + } + + @Override + public CopySpec rename(Transformer renamer) { + delegate.rename(renamer); + return this; + } + + @Override + public CopySpec rename(String sourceRegEx, String replaceWith) { + delegate.rename(sourceRegEx, replaceWith); + return this; + } + + @Override + public CopyProcessingSpec rename(Pattern sourceRegEx, String replaceWith) { + delegate.rename(sourceRegEx, replaceWith); + return this; + } + + @Override + public CopySpec filter(Map properties, Class filterType) { + delegate.filter(properties, filterType); + return this; + } + + @Override + public CopySpec filter(Class filterType) { + delegate.filter(filterType); + return this; + } + + @Override + public CopySpec filter(Closure closure) { + delegate.filter(closure); + return this; + } + + @Override + public CopySpec filter(Transformer transformer) { + delegate.filter(transformer); + return this; + } + + @Override + public CopySpec expand(Map properties) { + delegate.expand(properties); + return this; + } + + @Override + public CopySpec eachFile(Action action) { + delegate.eachFile(action); + return this; + } + + @Override + public CopySpec eachFile(Closure closure) { + delegate.eachFile(closure); + return this; + } + + @Override + public Integer getFileMode() { + return delegate.getFileMode(); + } + + @Override + public CopyProcessingSpec setFileMode(@Nullable Integer mode) { + delegate.setFileMode(mode); + return this; + } + + @Override + public Integer getDirMode() { + return delegate.getDirMode(); + } + + @Override + public CopyProcessingSpec setDirMode(@Nullable Integer mode) { + delegate.setDirMode(mode); + return this; + } + + @Override + public Set getIncludes() { + return delegate.getIncludes(); + } + + @Override + public Set getExcludes() { + return delegate.getExcludes(); + } + + @Override + public String getFilteringCharset() { + return delegate.getFilteringCharset(); + } + + @Override + public void setFilteringCharset(String charset) { + delegate.setFilteringCharset(charset); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/plugins/DefaultPluginCollection.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/plugins/DefaultPluginCollection.java new file mode 100644 index 0000000..8ed960d --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/plugins/DefaultPluginCollection.java @@ -0,0 +1,90 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.plugins; + +import groovy.lang.Closure; +import org.gradle.api.Action; +import org.gradle.api.Plugin; +import org.gradle.api.internal.CollectionCallbackActionDecorator; +import org.gradle.api.internal.DefaultDomainObjectSet; +import org.gradle.api.internal.collections.CollectionFilter; +import org.gradle.api.plugins.PluginCollection; +import org.gradle.api.specs.Spec; +import org.gradle.api.specs.Specs; + +import java.util.Collection; + +@SuppressWarnings("deprecation") // Something is weird with the hierarchy of 'add(T)', the implementation inherited from DefaultDomainObjectSet is used internally in DefaultPluginContainer.pluginAdded() but at the same time PluginCollection.add(T) is deprecated +class DefaultPluginCollection extends DefaultDomainObjectSet implements PluginCollection { + DefaultPluginCollection(Class type, CollectionCallbackActionDecorator decorator) { + super(type, decorator); + } + + private DefaultPluginCollection(DefaultPluginCollection collection, CollectionFilter filter) { + super(collection, filter); + } + + @Override + protected DefaultPluginCollection filtered(CollectionFilter filter) { + return new DefaultPluginCollection(this, filter); + } + + @Override + public boolean addAll(Collection c) { + throw new UnsupportedOperationException(); + } + + @Override + public boolean remove(Object o) { + throw new UnsupportedOperationException(); + } + + @Override + public boolean removeAll(Collection c) { + throw new UnsupportedOperationException(); + } + + @Override + public void clear() { + throw new UnsupportedOperationException(); + } + + @Override + public PluginCollection withType(Class type) { + return filtered(createFilter(type)); + } + + @Override + public PluginCollection matching(Spec spec) { + return filtered(createFilter(spec)); + } + + @Override + public PluginCollection matching(Closure spec) { + return matching(Specs.convertClosureToSpec(spec)); + } + + @Override + public Action whenPluginAdded(Action action) { + return whenObjectAdded(action); + } + + @Override + public void whenPluginAdded(Closure closure) { + whenObjectAdded(closure); + } + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/project/DefaultProjectStateRegistry.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/project/DefaultProjectStateRegistry.java new file mode 100644 index 0000000..bfba2b4 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/project/DefaultProjectStateRegistry.java @@ -0,0 +1,394 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.project; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import org.gradle.api.Project; +import org.gradle.api.artifacts.component.BuildIdentifier; +import org.gradle.api.artifacts.component.ProjectComponentIdentifier; +import org.gradle.initialization.DefaultProjectDescriptor; +import org.gradle.internal.Factories; +import org.gradle.internal.Factory; +import org.gradle.internal.Pair; +import org.gradle.internal.build.BuildState; +import org.gradle.internal.model.CalculatedModelValue; +import org.gradle.internal.model.ModelContainer; +import org.gradle.internal.resources.ResourceLock; +import org.gradle.internal.work.WorkerLeaseService; +import org.gradle.util.Path; + +import javax.annotation.Nullable; +import java.util.Collection; +import java.util.Collections; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.CopyOnWriteArraySet; +import java.util.concurrent.atomic.AtomicReference; +import java.util.concurrent.locks.ReentrantLock; +import java.util.function.Consumer; +import java.util.function.Function; + +public class DefaultProjectStateRegistry implements ProjectStateRegistry { + private final WorkerLeaseService workerLeaseService; + private final Object lock = new Object(); + private final Map projectsByPath = Maps.newLinkedHashMap(); + private final Map projectsById = Maps.newLinkedHashMap(); + private final Map, ProjectStateImpl> projectsByCompId = Maps.newLinkedHashMap(); + private final AtomicReference ownerOfAllProjects = new AtomicReference<>(); + private final Set canDoAnythingToAnyProject = new CopyOnWriteArraySet<>(); + + public DefaultProjectStateRegistry(WorkerLeaseService workerLeaseService) { + this.workerLeaseService = workerLeaseService; + } + + @Override + public void registerProjects(BuildState owner) { + Set allProjects = owner.getLoadedSettings().getProjectRegistry().getAllProjects(); + synchronized (lock) { + for (DefaultProjectDescriptor descriptor : allProjects) { + addProject(owner, descriptor); + } + } + } + + @Override + public void registerProject(BuildState owner, DefaultProjectDescriptor projectDescriptor) { + synchronized (lock) { + addProject(owner, projectDescriptor); + } + } + + private void addProject(BuildState owner, DefaultProjectDescriptor descriptor) { + Path projectPath = descriptor.path(); + Path identityPath = owner.getIdentityPathForProject(projectPath); + ProjectComponentIdentifier projectIdentifier = owner.getIdentifierForProject(projectPath); + ProjectStateImpl projectState = new ProjectStateImpl(owner, identityPath, projectPath, descriptor.getName(), projectIdentifier); + projectsByPath.put(identityPath, projectState); + projectsById.put(projectIdentifier, projectState); + projectsByCompId.put(Pair.of(owner.getBuildIdentifier(), projectPath), projectState); + } + + @Override + public Collection getAllProjects() { + synchronized (lock) { + return projectsByPath.values(); + } + } + + // TODO - can kill this method, as the caller can use ProjectInternal.getMutationState() instead + @Override + public ProjectState stateFor(Project project) { + synchronized (lock) { + ProjectStateImpl projectState = projectsByPath.get(((ProjectInternal) project).getIdentityPath()); + if (projectState == null) { + throw new IllegalArgumentException("Could not find state for " + project); + } + return projectState; + } + } + + @Override + public ProjectState stateFor(ProjectComponentIdentifier identifier) { + synchronized (lock) { + ProjectStateImpl projectState = projectsById.get(identifier); + if (projectState == null) { + throw new IllegalArgumentException(identifier.getDisplayName() + " not found."); + } + return projectState; + } + } + + @Override + public ProjectState stateFor(BuildIdentifier buildIdentifier, Path projectPath) { + synchronized (lock) { + ProjectStateImpl projectState = projectsByCompId.get(Pair.of(buildIdentifier, projectPath)); + if (projectState == null) { + throw new IllegalArgumentException(buildIdentifier + " project " + projectPath + " not found."); + } + return projectState; + } + } + + @Override + public void withMutableStateOfAllProjects(Runnable runnable) { + withMutableStateOfAllProjects(Factories.toFactory(runnable)); + } + + @Override + public T withMutableStateOfAllProjects(Factory factory) { + if (!ownerOfAllProjects.compareAndSet(null, Thread.currentThread())) { + // Already own all the projects + if (ownerOfAllProjects.get() == Thread.currentThread()) { + return factory.create(); + } + throw new IllegalStateException(String.format("Another thread (%s) currently holds the state lock for all projects.", ownerOfAllProjects)); + } + try { + return factory.create(); + } finally { + ownerOfAllProjects.set(null); + } + } + + @Override + public void allowUncontrolledAccessToAnyProject(Runnable runnable) { + allowUncontrolledAccessToAnyProject(Factories.toFactory(runnable)); + } + + @Override + public T allowUncontrolledAccessToAnyProject(Factory factory) { + Thread currentThread = Thread.currentThread(); + boolean added = canDoAnythingToAnyProject.add(currentThread); + try { + return factory.create(); + } finally { + if (added) { + canDoAnythingToAnyProject.remove(currentThread); + } + } + } + + private class ProjectStateImpl implements ProjectState { + private final Path projectPath; + private final String projectName; + private final ProjectComponentIdentifier identifier; + private final BuildState owner; + private final Path identityPath; + private final ResourceLock projectLock; + private final Set canDoAnythingToThisProject = new CopyOnWriteArraySet<>(); + private ProjectInternal project; + + ProjectStateImpl(BuildState owner, Path identityPath, Path projectPath, String projectName, ProjectComponentIdentifier identifier) { + this.owner = owner; + this.identityPath = identityPath; + this.projectPath = projectPath; + this.projectName = projectName; + this.identifier = identifier; + this.projectLock = workerLeaseService.getProjectLock(owner.getIdentityPath(), identityPath); + } + + @Override + public String toString() { + return identifier.getDisplayName(); + } + + @Override + public BuildState getOwner() { + return owner; + } + + @Nullable + @Override + public ProjectState getParent() { + return identityPath.getParent() == null ? null : projectsByPath.get(identityPath.getParent()); + } + + @Override + public String getName() { + return projectName; + } + + @Override + public Path getIdentityPath() { + return identityPath; + } + + @Override + public Path getProjectPath() { + return projectPath; + } + + @Override + public void attachMutableModel(ProjectInternal project) { + synchronized (this) { + if (this.project != null) { + throw new IllegalStateException(String.format("The project object for project %s has already been attached.", getIdentityPath())); + } + this.project = project; + } + } + + @Override + public ProjectInternal getMutableModel() { + synchronized (this) { + if (project == null) { + throw new IllegalStateException(String.format("The project object for project %s has not been attached yet.", getIdentityPath())); + } + return project; + } + } + + @Override + public ProjectComponentIdentifier getComponentIdentifier() { + return identifier; + } + + @Override + public ResourceLock getAccessLock() { + return projectLock; + } + + @Override + public void applyToMutableState(Consumer action) { + fromMutableState(p -> { + action.accept(p); + return null; + }); + } + + @Override + public S fromMutableState(Function function) { + Thread currentThread = Thread.currentThread(); + if (canDoAnythingToAnyProject.contains(currentThread) || canDoAnythingToThisProject.contains(currentThread)) { + // Current thread is allowed to access anything at any time, so run the function + return function.apply(getMutableModel()); + } + + Thread currentOwner = ownerOfAllProjects.get(); + if (currentOwner != null) { + if (currentOwner == currentThread) { + // we hold the lock for all projects, can run the function + return function.apply(getMutableModel()); + } + throw new IllegalStateException(String.format("Cannot acquire state lock for %s as another thread (%s) currently holds the state lock for all projects.", project, currentOwner)); + } + + Collection currentLocks = workerLeaseService.getCurrentProjectLocks(); + if (currentLocks.contains(projectLock)) { + // if we already hold the project lock for this project + if (currentLocks.size() == 1) { + // the lock for this project is the only lock we hold, can run the function + return function.apply(getMutableModel()); + } else { + currentLocks = Lists.newArrayList(currentLocks); + currentLocks.remove(projectLock); + // release any other project locks we might happen to hold + return workerLeaseService.withoutLocks(currentLocks, () -> function.apply(getMutableModel())); + } + } else { + // we don't currently hold the project lock + if (!currentLocks.isEmpty()) { + // we hold other project locks that we should release first + return workerLeaseService.withoutLocks(currentLocks, () -> withProjectLock(projectLock, function)); + } else { + // we just need to get the lock for this project + return withProjectLock(projectLock, function); + } + } + } + + @Override + public void forceAccessToMutableState(Consumer action) { + Thread currentThread = Thread.currentThread(); + boolean added = canDoAnythingToThisProject.add(currentThread); + try { + action.accept(getMutableModel()); + } finally { + if (added) { + canDoAnythingToThisProject.remove(currentThread); + } + } + } + + private S withProjectLock(ResourceLock projectLock, final Function function) { + return workerLeaseService.withLocks(Collections.singleton(projectLock), () -> function.apply(getMutableModel())); + } + + @Override + public boolean hasMutableState() { + Thread currentThread = Thread.currentThread(); + return canDoAnythingToThisProject.contains(currentThread) || canDoAnythingToAnyProject.contains(currentThread) || ownerOfAllProjects.get() == currentThread || workerLeaseService.getCurrentProjectLocks().contains(projectLock); + } + + @Override + public CalculatedModelValue newCalculatedValue(@Nullable T initialValue) { + return new CalculatedModelValueImpl<>(this, workerLeaseService, initialValue); + } + } + + private static class CalculatedModelValueImpl implements CalculatedModelValue { + private final WorkerLeaseService workerLeaseService; + private final ModelContainer owner; + private final ReentrantLock lock = new ReentrantLock(); + private volatile T value; + + public CalculatedModelValueImpl(ProjectStateImpl owner, WorkerLeaseService workerLeaseService, @Nullable T initialValue) { + this.workerLeaseService = workerLeaseService; + this.value = initialValue; + this.owner = owner; + } + + @Override + public T get() throws IllegalStateException { + T currentValue = getOrNull(); + if (currentValue == null) { + throw new IllegalStateException("No calculated value is available for " + owner); + } + return currentValue; + } + + @Override + public T getOrNull() { + // Grab the current value, ignore updates that may be happening + return value; + } + + @Override + public void set(T newValue) { + assertCanMutate(); + value = newValue; + } + + @Override + public T update(Function updateFunction) { + acquireUpdateLock(); + try { + // Do not hold any locks while applying the update + T newValue = updateFunction.apply(value); + value = newValue; + return newValue; + } finally { + releaseUpdateLock(); + } + } + + private void acquireUpdateLock() { + // It's important that we do not block waiting for the lock while holding the project mutation lock. + // Doing so can lead to deadlocks. + + assertCanMutate(); + + if (lock.tryLock()) { + // Update lock was not contended, can keep holding the project locks + return; + } + + // Another thread holds the update lock, release the project locks and wait for the other thread to finish the update + workerLeaseService.withoutProjectLock(lock::lock); + } + + private void assertCanMutate() { + if (!owner.hasMutableState()) { + throw new IllegalStateException("Current thread does not hold the state lock for " + owner); + } + } + + private void releaseUpdateLock() { + lock.unlock(); + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/project/ant/DefaultAntLoggingAdapterFactory.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/project/ant/DefaultAntLoggingAdapterFactory.java new file mode 100644 index 0000000..9da4a0e --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/project/ant/DefaultAntLoggingAdapterFactory.java @@ -0,0 +1,24 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.project.ant; + +public class DefaultAntLoggingAdapterFactory implements AntLoggingAdapterFactory { + @Override + public AntLoggingAdapter create() { + return new AntLoggingAdapter(); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/project/taskfactory/DefaultTaskClassInfoStore.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/project/taskfactory/DefaultTaskClassInfoStore.java new file mode 100644 index 0000000..baba54b --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/project/taskfactory/DefaultTaskClassInfoStore.java @@ -0,0 +1,283 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.project.taskfactory; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterables; +import com.google.common.collect.Maps; +import org.gradle.api.Action; +import org.gradle.api.GradleException; +import org.gradle.api.NonNullApi; +import org.gradle.api.Task; +import org.gradle.api.Transformer; +import org.gradle.api.tasks.CacheableTask; +import org.gradle.api.tasks.TaskAction; +import org.gradle.cache.internal.CrossBuildInMemoryCache; +import org.gradle.cache.internal.CrossBuildInMemoryCacheFactory; +import org.gradle.internal.reflect.Instantiator; +import org.gradle.work.InputChanges; + +import javax.annotation.Nullable; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +@NonNullApi +public class DefaultTaskClassInfoStore implements TaskClassInfoStore { + private final CrossBuildInMemoryCache, TaskClassInfo> classInfos; + private final Transformer> taskClassInfoFactory = new Transformer>() { + @Override + public TaskClassInfo transform(Class aClass) { + return createTaskClassInfo(aClass.asSubclass(Task.class)); + } + }; + + public DefaultTaskClassInfoStore(CrossBuildInMemoryCacheFactory cacheFactory) { + this.classInfos = cacheFactory.newClassCache(); + } + + @Override + public TaskClassInfo getTaskClassInfo(Class type) { + return classInfos.get(type, taskClassInfoFactory); + } + + private TaskClassInfo createTaskClassInfo(Class type) { + boolean cacheable = type.isAnnotationPresent(CacheableTask.class); + Map> processedMethods = Maps.newHashMap(); + ImmutableList.Builder taskActionFactoriesBuilder = ImmutableList.builder(); + AbstractIncrementalTaskActionFactory foundIncrementalTaskActionFactory = null; + for (Class current = type; current != null; current = current.getSuperclass()) { + for (Method method : current.getDeclaredMethods()) { + TaskActionFactory taskActionFactory = createTaskAction(type, method); + if (taskActionFactory == null) { + continue; + } + Class declaringClass = method.getDeclaringClass(); + Class previousDeclaringClass = processedMethods.put(method.getName(), declaringClass); + if (taskActionFactory instanceof AbstractIncrementalTaskActionFactory + && foundIncrementalTaskActionFactory != null + && method.getName().equals(foundIncrementalTaskActionFactory.getMethod().getName()) + ) { + // Let's try if we can decide on one + AbstractIncrementalTaskActionFactory selectedTaskAction = selectIncrementalTaskAction(type, foundIncrementalTaskActionFactory, taskActionFactory, current, method); + if (selectedTaskAction != null) { + foundIncrementalTaskActionFactory = selectedTaskAction; + continue; + } + } + if (previousDeclaringClass == declaringClass) { + throw new GradleException(String.format( + "Cannot use @TaskAction annotation on multiple overloads of method %s.%s()", + declaringClass.getSimpleName(), method.getName() + )); + } else if (previousDeclaringClass != null) { + continue; + } + if (taskActionFactory instanceof AbstractIncrementalTaskActionFactory) { + if (foundIncrementalTaskActionFactory != null) { + @SuppressWarnings("deprecation") + Class incrementalTaskInputsClass = org.gradle.api.tasks.incremental.IncrementalTaskInputs.class; + throw new GradleException(String.format("Cannot have multiple @TaskAction methods accepting an %s or %s parameter.", InputChanges.class.getSimpleName(), incrementalTaskInputsClass.getSimpleName())); + } + foundIncrementalTaskActionFactory = (AbstractIncrementalTaskActionFactory) taskActionFactory; + continue; + } + taskActionFactoriesBuilder.add(taskActionFactory); + } + } + if (foundIncrementalTaskActionFactory != null) { + taskActionFactoriesBuilder.add(foundIncrementalTaskActionFactory); + } + + return new TaskClassInfo(taskActionFactoriesBuilder.build(), cacheable); + } + + /** + * Select between two incremental task action factories. + * + * The selection works like this: + * - If both task actions are of the same type (InputChanges or IncrementalTaskInputs), we select the one we already found. + * This happens when a subclass overrides the task action method in the subclass, while both have TaskAction annotations. + * - If the InputChanges is not deprecated and the IncrementalTaskInputs method is, then we try to select one: + * - If a subclass overrides the IncrementalTaskInputs method, we create a {@link BridgingIncrementalInputsTaskActionFactory} which passes the {@link InputChanges} object into the IncrementalTaskInputs method + * - If no subclass overrides the IncrementalTaskInputs method, we use the InputChanges method directly. + * + * All this is only required to support the Android Gradle plugin < 3.6. + * As soon as 3.6 is out we should drop the support for 3.5 and simplify the code here again. + */ + @Nullable + private AbstractIncrementalTaskActionFactory selectIncrementalTaskAction(Class taskClass, AbstractIncrementalTaskActionFactory foundTaskActionFactory, TaskActionFactory currentTaskActionFactory, Class currentClass, Method currentMethod) { + if (currentTaskActionFactory.getClass() == foundTaskActionFactory.getClass()) { + return foundTaskActionFactory; + } + AbstractIncrementalTaskActionFactory currentIncrementalTaskActionFactory = (AbstractIncrementalTaskActionFactory) currentTaskActionFactory; + Map> partitionedActions = Stream.of(foundTaskActionFactory, currentIncrementalTaskActionFactory) + .collect(Collectors.partitioningBy(IncrementalInputsTaskActionFactory.class::isInstance)); + List incrementalInputsFactories = partitionedActions.get(true); + List incrementalTaskInputFactories = partitionedActions.get(false); + + if (incrementalInputsFactories.size() == 1 && incrementalTaskInputFactories.size() == 1) { + IncrementalInputsTaskActionFactory incrementalInputsTaskActionFactory = (IncrementalInputsTaskActionFactory) Iterables.getOnlyElement(incrementalInputsFactories); + IncrementalTaskInputsTaskActionFactory incrementalTaskInputsTaskActionFactory = (IncrementalTaskInputsTaskActionFactory) Iterables.getOnlyElement(incrementalTaskInputFactories); + + if (isDeprecated(incrementalTaskInputsTaskActionFactory) && !isDeprecated(incrementalInputsTaskActionFactory)) { + Class declaringClassForIncrementalTaskInputsMethod = getDeclaringClassForIncrementalTaskInputsMethod(taskClass, currentMethod.getName()); + if (declaringClassForIncrementalTaskInputsMethod != currentClass) { + return new BridgingIncrementalInputsTaskActionFactory(taskClass, currentMethod); + } else { + return incrementalInputsTaskActionFactory; + } + } + } + return null; + } + + private Class getDeclaringClassForIncrementalTaskInputsMethod(Class type, String methodName) { + Method incrementalTaskInputsMethod = null; + Class current = type; + while (incrementalTaskInputsMethod == null) { + incrementalTaskInputsMethod = getIncrementalTaskInputsMethod(current, methodName); + current = current.getSuperclass(); + } + return incrementalTaskInputsMethod.getDeclaringClass(); + } + + @Nullable + @SuppressWarnings("deprecation") + private Method getIncrementalTaskInputsMethod(Class type, String methodName) { + try { + return type.getDeclaredMethod(methodName, org.gradle.api.tasks.incremental.IncrementalTaskInputs.class); + } catch (NoSuchMethodException e) { + return null; + } + } + + private boolean isDeprecated(AbstractIncrementalTaskActionFactory foundIncrementalTaskActionFactory) { + return foundIncrementalTaskActionFactory.getMethod().getAnnotation(Deprecated.class) != null; + } + + @Nullable + private static TaskActionFactory createTaskAction(Class taskType, final Method method) { + if (method.getAnnotation(TaskAction.class) == null) { + return null; + } + Class declaringClass = method.getDeclaringClass(); + if (Modifier.isStatic(method.getModifiers())) { + throw new GradleException(String.format("Cannot use @TaskAction annotation on static method %s.%s().", + declaringClass.getSimpleName(), method.getName())); + } + final Class[] parameterTypes = method.getParameterTypes(); + if (parameterTypes.length > 1) { + throw new GradleException(String.format( + "Cannot use @TaskAction annotation on method %s.%s() as this method takes multiple parameters.", + declaringClass.getSimpleName(), method.getName())); + } + + TaskActionFactory taskActionFactory; + if (parameterTypes.length == 1) { + Class parameterType = parameterTypes[0]; + @SuppressWarnings("deprecation") + Class incrementalTaskInputsClass = org.gradle.api.tasks.incremental.IncrementalTaskInputs.class; + if (parameterType.equals(incrementalTaskInputsClass)) { + taskActionFactory = new IncrementalTaskInputsTaskActionFactory(taskType, method); + } else if (parameterType.equals(InputChanges.class)) { + taskActionFactory = new IncrementalInputsTaskActionFactory(taskType, method); + } else { + throw new GradleException(String.format( + "Cannot use @TaskAction annotation on method %s.%s() because %s is not a valid parameter to an action method.", + declaringClass.getSimpleName(), method.getName(), parameterType)); + } + } else { + taskActionFactory = new StandardTaskActionFactory(taskType, method); + } + + return taskActionFactory; + } + + private static class StandardTaskActionFactory implements TaskActionFactory { + private final Class taskType; + private final Method method; + + public StandardTaskActionFactory(Class taskType, Method method) { + this.taskType = taskType; + this.method = method; + } + + @Override + public Action create(Instantiator instantiator) { + return new StandardTaskAction(taskType, method); + } + } + + private static class IncrementalInputsTaskActionFactory extends AbstractIncrementalTaskActionFactory { + public IncrementalInputsTaskActionFactory(Class taskType, Method method) { + super(taskType, method); + } + + @Override + protected Action doCreate(Instantiator instantiator, Class taskType, Method method) { + return new IncrementalInputsTaskAction(taskType, method); + } + } + + private static class IncrementalTaskInputsTaskActionFactory extends AbstractIncrementalTaskActionFactory { + public IncrementalTaskInputsTaskActionFactory(Class taskType, Method method) { + super(taskType, method); + } + + @Override + protected Action doCreate(Instantiator instantiator, Class taskType, Method method) { + return new IncrementalTaskInputsTaskAction(instantiator, taskType, method); + } + } + + private static class BridgingIncrementalInputsTaskActionFactory extends AbstractIncrementalTaskActionFactory { + + public BridgingIncrementalInputsTaskActionFactory(Class taskType, Method method) { + super(taskType, method); + } + + @Override + protected Action doCreate(Instantiator instantiator, Class taskType, Method method) { + return new BridgingIncrementalInputsTaskAction(taskType, method); + } + } + + private static abstract class AbstractIncrementalTaskActionFactory implements TaskActionFactory { + private final Class taskType; + private final Method method; + + public AbstractIncrementalTaskActionFactory(Class taskType, Method method) { + this.taskType = taskType; + this.method = method; + } + + public Method getMethod() { + return method; + } + + protected abstract Action doCreate(Instantiator instantiator, Class taskType, Method method); + + @Override + public Action create(Instantiator instantiator) { + return doCreate(instantiator, taskType, method); + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/tasks/DefaultTaskContainer.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/tasks/DefaultTaskContainer.java new file mode 100644 index 0000000..1c5a441 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/tasks/DefaultTaskContainer.java @@ -0,0 +1,862 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.tasks; + +import com.google.common.base.Strings; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Maps; +import groovy.lang.Closure; +import org.apache.commons.lang.StringUtils; +import org.gradle.api.Action; +import org.gradle.api.DefaultTask; +import org.gradle.api.GradleException; +import org.gradle.api.InvalidUserDataException; +import org.gradle.api.NamedDomainObjectContainer; +import org.gradle.api.NonNullApi; +import org.gradle.api.Project; +import org.gradle.api.Task; +import org.gradle.api.UnknownTaskException; +import org.gradle.api.internal.CollectionCallbackActionDecorator; +import org.gradle.api.internal.MutationGuards; +import org.gradle.api.internal.NamedDomainObjectContainerConfigureDelegate; +import org.gradle.api.internal.TaskInternal; +import org.gradle.api.internal.project.CrossProjectConfigurator; +import org.gradle.api.internal.project.ProjectInternal; +import org.gradle.api.internal.project.taskfactory.ITaskFactory; +import org.gradle.api.internal.project.taskfactory.TaskIdentity; +import org.gradle.api.internal.project.taskfactory.TaskInstantiator; +import org.gradle.api.provider.Provider; +import org.gradle.api.tasks.TaskCollection; +import org.gradle.api.tasks.TaskProvider; +import org.gradle.initialization.ProjectAccessListener; +import org.gradle.internal.Actions; +import org.gradle.internal.Cast; +import org.gradle.internal.ImmutableActionSet; +import org.gradle.internal.Transformers; +import org.gradle.internal.exceptions.Contextual; +import org.gradle.internal.metaobject.DynamicObject; +import org.gradle.internal.operations.BuildOperationContext; +import org.gradle.internal.operations.BuildOperationDescriptor; +import org.gradle.internal.operations.BuildOperationExecutor; +import org.gradle.internal.operations.CallableBuildOperation; +import org.gradle.internal.operations.RunnableBuildOperation; +import org.gradle.internal.reflect.Instantiator; +import org.gradle.model.internal.core.ModelNode; +import org.gradle.model.internal.core.ModelPath; +import org.gradle.model.internal.core.MutableModelNode; +import org.gradle.model.internal.core.NamedEntityInstantiator; +import org.gradle.model.internal.type.ModelType; +import org.gradle.util.ConfigureUtil; +import org.gradle.util.GUtil; + +import javax.annotation.Nullable; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.SortedSet; +import java.util.TreeSet; + +@NonNullApi +public class DefaultTaskContainer extends DefaultTaskCollection implements TaskContainerInternal { + private static final Object[] NO_ARGS = new Object[0]; + public final static String EAGERLY_CREATE_LAZY_TASKS_PROPERTY = "org.gradle.internal.tasks.eager"; + + private static final Set VALID_TASK_ARGUMENTS = ImmutableSet.of( + Task.TASK_ACTION, Task.TASK_DEPENDS_ON, Task.TASK_DESCRIPTION, Task.TASK_GROUP, Task.TASK_NAME, Task.TASK_OVERWRITE, Task.TASK_TYPE, Task.TASK_CONSTRUCTOR_ARGS + ); + private static final Set MANDATORY_TASK_ARGUMENTS = ImmutableSet.of( + Task.TASK_NAME, Task.TASK_TYPE + ); + + private final ITaskFactory taskFactory; + private final NamedEntityInstantiator taskInstantiator; + private final ProjectAccessListener projectAccessListener; + private final BuildOperationExecutor buildOperationExecutor; + + private final TaskStatistics statistics; + private final boolean eagerlyCreateLazyTasks; + + private MutableModelNode modelNode; + + public DefaultTaskContainer(final ProjectInternal project, + Instantiator instantiator, + final ITaskFactory taskFactory, + ProjectAccessListener projectAccessListener, + TaskStatistics statistics, + BuildOperationExecutor buildOperationExecutor, + CrossProjectConfigurator crossProjectConfigurator, + CollectionCallbackActionDecorator callbackDecorator) { + super(Task.class, instantiator, project, MutationGuards.of(crossProjectConfigurator), callbackDecorator); + this.taskFactory = taskFactory; + taskInstantiator = new TaskInstantiator(taskFactory, project); + this.projectAccessListener = projectAccessListener; + this.statistics = statistics; + this.eagerlyCreateLazyTasks = Boolean.getBoolean(EAGERLY_CREATE_LAZY_TASKS_PROPERTY); + this.buildOperationExecutor = buildOperationExecutor; + } + + @Override + public Task create(Map options) { + assertMutable("create(Map)"); + return doCreate(options, Actions.doNothing()); + } + + private Task doCreate(Map options, final Action configureAction) { + Map factoryOptions = options; + final boolean replace; + if (options.containsKey(Task.TASK_OVERWRITE)) { + factoryOptions = new HashMap(options); + Object replaceStr = factoryOptions.remove(Task.TASK_OVERWRITE); + replace = "true".equals(replaceStr.toString()); + } else { + replace = false; + } + + final Map actualArgs = checkTaskArgsAndCreateDefaultValues(factoryOptions); + + final String name = actualArgs.get(Task.TASK_NAME).toString(); + if (!GUtil.isTrue(name)) { + throw new InvalidUserDataException("The task name must be provided."); + } + + final Class type = Cast.uncheckedCast(actualArgs.get(Task.TASK_TYPE)); + + final TaskIdentity identity = TaskIdentity.create(name, type, project); + return buildOperationExecutor.call(new CallableBuildOperation() { + @Override + public BuildOperationDescriptor.Builder description() { + return realizeDescriptor(identity, replace, true); + } + + @Override + public Task call(BuildOperationContext context) { + try { + Object[] constructorArgs = getConstructorArgs(actualArgs); + TaskInternal task = createTask(identity, constructorArgs); + statistics.eagerTask(type); + + Object dependsOnTasks = actualArgs.get(Task.TASK_DEPENDS_ON); + if (dependsOnTasks != null) { + task.dependsOn(dependsOnTasks); + } + Object description = actualArgs.get(Task.TASK_DESCRIPTION); + if (description != null) { + task.setDescription(description.toString()); + } + Object group = actualArgs.get(Task.TASK_GROUP); + if (group != null) { + task.setGroup(group.toString()); + } + Object action = actualArgs.get(Task.TASK_ACTION); + if (action instanceof Action) { + Action taskAction = Cast.uncheckedCast(action); + task.doFirst(taskAction); + } else if (action != null) { + Closure closure = (Closure) action; + task.doFirst(closure); + } + + addTask(task, replace); + configureAction.execute(task); + context.setResult(REALIZE_RESULT); + return task; + } catch (Throwable t) { + throw taskCreationException(name, t); + } + } + }); + } + + private static Object[] getConstructorArgs(Map args) { + Object constructorArgs = args.get(Task.TASK_CONSTRUCTOR_ARGS); + if (constructorArgs instanceof List) { + List asList = (List) constructorArgs; + return asList.toArray(new Object[asList.size()]); + } + if (constructorArgs instanceof Object[]) { + return (Object[]) constructorArgs; + } + if (constructorArgs != null) { + throw new IllegalArgumentException(String.format("%s must be a List or Object[]. Received %s", Task.TASK_CONSTRUCTOR_ARGS, constructorArgs.getClass())); + } + return NO_ARGS; + } + + private static Map checkTaskArgsAndCreateDefaultValues(Map args) { + validateArgs(args); + if (!args.keySet().containsAll(MANDATORY_TASK_ARGUMENTS)) { + Map argsWithDefaults = Maps.newHashMap(args); + setIfNull(argsWithDefaults, Task.TASK_NAME, ""); + setIfNull(argsWithDefaults, Task.TASK_TYPE, DefaultTask.class); + return argsWithDefaults; + } + return args; + } + + private static void validateArgs(Map args) { + if (!VALID_TASK_ARGUMENTS.containsAll(args.keySet())) { + Map unknownArguments = new HashMap(args); + unknownArguments.keySet().removeAll(VALID_TASK_ARGUMENTS); + throw new InvalidUserDataException(String.format("Could not create task '%s': Unknown argument(s) in task definition: %s", + args.get(Task.TASK_NAME), unknownArguments.keySet())); + } + } + + private static void setIfNull(Map map, String key, Object defaultValue) { + if (map.get(key) == null) { + map.put(key, defaultValue); + } + } + + private void addTask(T task, boolean replaceExisting) { + String name = task.getName(); + + if (replaceExisting) { + Task existing = findByNameWithoutRules(name); + if (existing != null) { + throw new IllegalStateException("Replacing an existing task that may have already been used by other plugins is not supported. Use a different name for this task ('" + name + "')."); + } else { + TaskCreatingProvider taskProvider = Cast.uncheckedCast(findByNameLaterWithoutRules(name)); + if (taskProvider != null) { + removeInternal(taskProvider); + + final Action onCreate; + if (!taskProvider.getType().isAssignableFrom(task.getClass())) { + throw new IllegalStateException("Replacing an existing task with an incompatible type is not supported. Use a different name for this task ('" + name + "') or use a compatible type (" + ((TaskInternal) task).getTaskIdentity().type.getName() + ")"); + } else { + onCreate = Cast.uncheckedCast(taskProvider.getOnCreateActions().mergeFrom(getEventRegister().getAddActions())); + } + + add(task, onCreate); + return; // Exit early as we are reusing the create actions from the provider + } else { + throw new IllegalStateException("Unnecessarily replacing a task that does not exist is not supported. Use create() or register() directly instead. You attempted to replace a task named '" + name + "', but there is no existing task with that name."); + } + } + } else if (hasWithName(name)) { + failOnDuplicateTask(name); + } + + addInternal(task); + } + + private void failOnDuplicateTask(String task) { + throw new DuplicateTaskException(String.format("Cannot add task '%s' as a task with that name already exists.", task)); + } + + @Override + public U maybeCreate(String name, Class type) throws InvalidUserDataException { + Task existing = findByName(name); + if (existing != null) { + return Transformers.cast(type).transform(existing); + } + return create(name, type); + } + + @Override + public Task create(Map options, Closure configureClosure) throws InvalidUserDataException { + assertMutable("create(Map, Closure)"); + return doCreate(options, ConfigureUtil.configureUsing(configureClosure)); + } + + @Override + public T create(String name, Class type) { + assertMutable("create(String, Class)"); + return doCreate(name, type, NO_ARGS, Actions.doNothing()); + } + + @Override + public T create(final String name, final Class type, final Object... constructorArgs) throws InvalidUserDataException { + assertMutable("create(String, Class, Object...)"); + return doCreate(name, type, constructorArgs, Actions.doNothing()); + } + + /** + * @param constructorArgs null == do not invoke constructor, empty == invoke constructor with no args, non-empty = invoke constructor with args + */ + private T doCreate(final String name, final Class type, @Nullable final Object[] constructorArgs, final Action configureAction) throws InvalidUserDataException { + final TaskIdentity identity = TaskIdentity.create(name, type, project); + return buildOperationExecutor.call(new CallableBuildOperation() { + @Override + public T call(BuildOperationContext context) { + try { + T task = createTask(identity, constructorArgs); + statistics.eagerTask(type); + addTask(task, false); + configureAction.execute(task); + context.setResult(REALIZE_RESULT); + return task; + } catch (Throwable t) { + throw taskCreationException(name, t); + } + } + + @Override + public BuildOperationDescriptor.Builder description() { + return realizeDescriptor(identity, false, true); + } + }); + } + + private T createTask(TaskIdentity identity, @Nullable Object[] constructorArgs) throws InvalidUserDataException { + if (constructorArgs != null) { + for (int i = 0; i < constructorArgs.length; i++) { + if (constructorArgs[i] == null) { + throw new NullPointerException(String.format("Received null for %s constructor argument #%s", identity.type.getName(), i + 1)); + } + } + } + return taskFactory.create(identity, constructorArgs); + } + + @Override + public Task create(String name) { + assertMutable("create(String)"); + return doCreate(name, DefaultTask.class, NO_ARGS, Actions.doNothing()); + } + + @Override + public Task create(String name, Action configureAction) throws InvalidUserDataException { + assertMutable("create(String, Action)"); + return doCreate(name, DefaultTask.class, NO_ARGS, configureAction); + } + + @Override + public Task maybeCreate(String name) { + Task task = findByName(name); + if (task != null) { + return task; + } + return create(name); + } + + @Override + public Task replace(String name) { + assertMutable("replace(String)"); + return replace(name, DefaultTask.class); + } + + @Override + public Task create(String name, Closure configureClosure) { + assertMutable("create(String, Closure)"); + return doCreate(name, DefaultTask.class, NO_ARGS, ConfigureUtil.configureUsing(configureClosure)); + } + + @Override + public T create(String name, Class type, Action configuration) throws InvalidUserDataException { + assertMutable("create(String, Class, Action)"); + T task = create(name, type); + configuration.execute(task); + return task; + } + + @Override + public TaskProvider register(String name, Action configurationAction) throws InvalidUserDataException { + assertMutable("register(String, Action)"); + return Cast.uncheckedCast(register(name, DefaultTask.class, configurationAction)); + } + + @Override + public TaskProvider register(String name, Class type, Action configurationAction) throws InvalidUserDataException { + assertMutable("register(String, Class, Action)"); + return registerTask(name, type, configurationAction, NO_ARGS); + } + + @Override + public TaskProvider register(String name, Class type) throws InvalidUserDataException { + assertMutable("register(String, Class)"); + return register(name, type, NO_ARGS); + } + + @Override + public TaskProvider register(String name) throws InvalidUserDataException { + assertMutable("register(String)"); + return Cast.uncheckedCast(register(name, DefaultTask.class)); + } + + @Override + public TaskProvider register(String name, Class type, Object... constructorArgs) { + assertMutable("register(String, Class, Object...)"); + return registerTask(name, type, null, constructorArgs); + } + + private TaskProvider registerTask(final String name, final Class type, @Nullable final Action configurationAction, final Object... constructorArgs) { + if (hasWithName(name)) { + failOnDuplicateTask(name); + } + + final TaskIdentity identity = TaskIdentity.create(name, type, project); + + TaskProvider provider = buildOperationExecutor.call(new CallableBuildOperation>() { + @Override + public BuildOperationDescriptor.Builder description() { + return registerDescriptor(identity); + } + + @Override + public TaskProvider call(BuildOperationContext context) { + TaskProvider provider = Cast.uncheckedNonnullCast( + getInstantiator().newInstance( + TaskCreatingProvider.class, DefaultTaskContainer.this, identity, configurationAction, constructorArgs + ) + ); + addLaterInternal(provider); + context.setResult(REGISTER_RESULT); + return provider; + } + }); + + if (eagerlyCreateLazyTasks) { + provider.get(); + } + + return provider; + } + + @Override + public T replace(final String name, final Class type) { + assertMutable("replace(String, Class)"); + final TaskIdentity identity = TaskIdentity.create(name, type, project); + return buildOperationExecutor.call(new CallableBuildOperation() { + @Override + public T call(BuildOperationContext context) { + try { + T task = taskFactory.create(identity, NO_ARGS); + addTask(task, true); + context.setResult(REALIZE_RESULT); + return task; + } catch (Throwable t) { + throw taskCreationException(name, t); + } + } + + @Override + public BuildOperationDescriptor.Builder description() { + return realizeDescriptor(identity, true, true); + } + }); + } + + @Override + public T createWithoutConstructor(String name, Class type) { + assertMutable("createWithoutConstructor(String, Class, Object...)"); + return doCreate(name, type, null, Actions.doNothing()); + } + + @Override + public Task findByPath(String path) { + if (Strings.isNullOrEmpty(path)) { + throw new InvalidUserDataException("A path must be specified!"); + } + if (!path.contains(Project.PATH_SEPARATOR)) { + return findByName(path); + } + + String projectPath = StringUtils.substringBeforeLast(path, Project.PATH_SEPARATOR); + ProjectInternal project = this.project.findProject(Strings.isNullOrEmpty(projectPath) ? Project.PATH_SEPARATOR : projectPath); + if (project == null) { + return null; + } + projectAccessListener.beforeRequestingTaskByPath(project); + + return project.getTasks().findByName(StringUtils.substringAfterLast(path, Project.PATH_SEPARATOR)); + } + + @Override + public Task resolveTask(String path) { + if (Strings.isNullOrEmpty(path)) { + throw new InvalidUserDataException("A path must be specified!"); + } + return getByPath(path); + } + + @Override + public Task getByPath(String path) throws UnknownTaskException { + Task task = findByPath(path); + if (task == null) { + throw new UnknownTaskException(String.format("Task with path '%s' not found in %s.", path, project)); + } + return task; + } + + @Override + public TaskContainerInternal configure(Closure configureClosure) { + return ConfigureUtil.configureSelf(configureClosure, this, new NamedDomainObjectContainerConfigureDelegate(configureClosure, this)); + } + + @Override + public NamedEntityInstantiator getEntityInstantiator() { + return taskInstantiator; + } + + @Override + public DynamicObject getTasksAsDynamicObject() { + return getElementsAsDynamicObject(); + } + + @Override + public SortedSet getNames() { + SortedSet names = super.getNames(); + if (modelNode == null) { + return names; + } else { + TreeSet allNames = new TreeSet(names); + allNames.addAll(modelNode.getLinkNames()); + return allNames; + } + } + + @Override + public void realize() { + if (modelNode != null) { + project.getModelRegistry().realizeNode(modelNode.getPath()); + } + } + + @Override + public void discoverTasks() { + project.fireDeferredConfiguration(); + if (modelNode != null) { + project.getModelRegistry().atStateOrLater(modelNode.getPath(), ModelNode.State.SelfClosed); + } + } + + @Override + public void prepareForExecution(Task task) { + assert task.getProject() == project; + if (modelNode != null && modelNode.hasLink(task.getName())) { + realizeTask(MODEL_PATH.child(task.getName()), ModelNode.State.GraphClosed); + } + } + + /** + * @return true if this method _may_ have done some work. + */ + private boolean maybeCreateTasks(String name) { + if (modelNode != null && modelNode.hasLink(name)) { + realizeTask(MODEL_PATH.child(name), ModelNode.State.Initialized); + return true; + } + return false; + } + + @Override + public Task findByName(String name) { + Task task = super.findByName(name); + if (task != null) { + return task; + } + if (!maybeCreateTasks(name)) { + return null; + } + return super.findByNameWithoutRules(name); + } + + private Task realizeTask(ModelPath taskPath, ModelNode.State minState) { + return project.getModelRegistry().atStateOrLater(taskPath, ModelType.of(Task.class), minState); + } + + @Override + public NamedDomainObjectContainer containerWithType(Class type) { + throw new UnsupportedOperationException(); + } + + @Override + public Set> getCreateableTypes() { + return Collections.singleton(getType()); + } + + public void setModelNode(MutableModelNode modelNode) { + this.modelNode = modelNode; + } + + @Override + public TaskCollection withType(Class type) { + Instantiator instantiator = getInstantiator(); + return Cast.uncheckedCast(instantiator.newInstance(DefaultRealizableTaskCollection.class, type, super.withType(type), modelNode, instantiator)); + } + + @Deprecated + @Override + public boolean remove(Object o) { + throw unsupportedTaskRemovalException(); + } + + private boolean removeInternal(Object o) { + return super.remove(o); + } + + @Deprecated + @Override + public boolean removeAll(Collection c) { + throw unsupportedTaskRemovalException(); + } + + @Override + public void clear() { + throw unsupportedTaskRemovalException(); + } + + @Override + public boolean retainAll(Collection target) { + throw unsupportedTaskRemovalException(); + } + + @Override + public Iterator iterator() { + final Iterator delegate = super.iterator(); + return new Iterator() { + @Override + public boolean hasNext() { + return delegate.hasNext(); + } + + @Override + public Task next() { + return delegate.next(); + } + + @Override + public void remove() { + throw unsupportedTaskRemovalException(); + } + }; + } + + private static RuntimeException unsupportedTaskRemovalException() { + return new UnsupportedOperationException("Removing tasks from the task container is not supported. Disable the tasks or use replace() instead."); + } + + @Override + public Action whenObjectRemoved(Action action) { + throw new UnsupportedOperationException("Registering actions on task removal is not supported."); + } + + @Override + public void whenObjectRemoved(Closure action) { + throw new UnsupportedOperationException("Registering actions on task removal is not supported."); + } + + // Cannot be private due to reflective instantiation + public class TaskCreatingProvider extends AbstractDomainObjectCreatingProvider implements TaskProvider { + private final TaskIdentity identity; + private Object[] constructorArgs; + + public TaskCreatingProvider(TaskIdentity identity, @Nullable Action configureAction, Object... constructorArgs) { + super(identity.name, identity.type, configureAction); + this.identity = identity; + this.constructorArgs = constructorArgs; + statistics.lazyTask(); + } + + public ImmutableActionSet getOnCreateActions() { + return onCreate; + } + + @Override + public ValueProducer getProducer() { + return ValueProducer.taskState(get()); + } + + @Override + protected void tryCreate() { + buildOperationExecutor.run(new RunnableBuildOperation() { + @Override + public void run(BuildOperationContext context) { + try { + TaskCreatingProvider.super.tryCreate(); + // TODO removing this stuff from the store should be handled through some sort of decoration + context.setResult(REALIZE_RESULT); + } finally { + constructorArgs = null; + } + } + + @Override + public BuildOperationDescriptor.Builder description() { + return realizeDescriptor(identity, false, false); + } + }); + } + + @Override + protected I createDomainObject() { + return createTask(identity, constructorArgs); + } + + @Override + protected void onLazyDomainObjectRealized() { + statistics.lazyTaskRealized(getType()); + } + + @Override + protected RuntimeException domainObjectCreationException(Throwable cause) { + return taskCreationException(getName(), cause); + } + } + + private RuntimeException taskCreationException(String name, Throwable cause) { + if (cause instanceof DuplicateTaskException) { + return (RuntimeException) cause; + } + return new TaskCreationException(String.format("Could not create task '%s'.", project.identityPath(name)), cause); + } + + private static BuildOperationDescriptor.Builder realizeDescriptor(TaskIdentity identity, boolean replacement, boolean eager) { + return BuildOperationDescriptor.displayName("Realize task " + identity.identityPath) + .details(new RealizeDetails(identity, replacement, eager)); + } + + private static BuildOperationDescriptor.Builder registerDescriptor(TaskIdentity identity) { + return BuildOperationDescriptor.displayName("Register task " + identity.identityPath) + .details(new RegisterDetails(identity)); + } + + @Deprecated + @Override + public boolean add(Task o) { + throw new UnsupportedOperationException("Adding a task directly to the task container is not supported. Use register() instead."); + } + + @Deprecated + @Override + public boolean addAll(Collection c) { + throw new UnsupportedOperationException("Adding a collection of tasks directly to the task container is not supported. Use register() instead."); + } + + @Override + public void addLater(Provider provider) { + throw new UnsupportedOperationException("Adding a task provider directly to the task container is not supported. Use the register() method instead."); + } + + @Override + public void addAllLater(Provider> provider) { + throw new UnsupportedOperationException("Adding a task provider directly to the task container is not supported. Use the register() method instead."); + } + + @Override + public boolean addInternal(Task task) { + return super.add(task); + } + + @Override + public boolean addAllInternal(Collection task) { + return super.addAll(task); + } + + private void addLaterInternal(Provider provider) { + super.addLater(provider); + } + + private static final RegisterTaskBuildOperationType.Result REGISTER_RESULT = new RegisterTaskBuildOperationType.Result() { + }; + private static final RealizeTaskBuildOperationType.Result REALIZE_RESULT = new RealizeTaskBuildOperationType.Result() { + }; + + @Contextual + private static class TaskCreationException extends GradleException { + TaskCreationException(String message, Throwable cause) { + super(message, cause); + } + } + + private static class DuplicateTaskException extends InvalidUserDataException { + public DuplicateTaskException(String message) { + super(message); + } + } + + @Contextual + private static class IncompatibleTaskTypeException extends InvalidUserDataException { + public IncompatibleTaskTypeException(String message) { + super(message); + } + } + + private static final class RealizeDetails implements RealizeTaskBuildOperationType.Details { + + private final TaskIdentity identity; + private final boolean replacement; + private final boolean eager; + + RealizeDetails(TaskIdentity identity, boolean replacement, boolean eager) { + this.identity = identity; + this.replacement = replacement; + this.eager = eager; + } + + @Override + public String getBuildPath() { + return identity.buildPath.toString(); + } + + @Override + public String getTaskPath() { + return identity.projectPath.toString(); + } + + @Override + public long getTaskId() { + return identity.uniqueId; + } + + @Override + public boolean isReplacement() { + return replacement; + } + + @Override + public boolean isEager() { + return eager; + } + + } + + private static final class RegisterDetails implements RegisterTaskBuildOperationType.Details { + + private final TaskIdentity identity; + + RegisterDetails(TaskIdentity identity) { + this.identity = identity; + } + + @Override + public String getBuildPath() { + return identity.buildPath.toString(); + } + + @Override + public String getTaskPath() { + return identity.projectPath.toString(); + } + + @Override + public long getTaskId() { + return identity.uniqueId; + } + + @Override + public boolean isReplacement() { + return false; + } + + } + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/tasks/properties/TaskScheme.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/tasks/properties/TaskScheme.java new file mode 100644 index 0000000..fb5f6b2 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/api/internal/tasks/properties/TaskScheme.java @@ -0,0 +1,48 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.properties; + +import org.gradle.api.Task; +import org.gradle.internal.instantiation.InstantiationScheme; + +public class TaskScheme implements TypeScheme { + private final InstantiationScheme instantiationScheme; + private final InspectionScheme inspectionScheme; + + public TaskScheme(InstantiationScheme instantiationScheme, InspectionScheme inspectionScheme) { + this.instantiationScheme = instantiationScheme; + this.inspectionScheme = inspectionScheme; + } + + @Override + public TypeMetadataStore getMetadataStore() { + return inspectionScheme.getMetadataStore(); + } + + @Override + public boolean appliesTo(Class type) { + return Task.class.isAssignableFrom(type); + } + + public InstantiationScheme getInstantiationScheme() { + return instantiationScheme; + } + + public InspectionScheme getInspectionScheme() { + return inspectionScheme; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/caching/internal/services/package-info.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/caching/internal/services/package-info.java new file mode 100644 index 0000000..b1cda2f --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/caching/internal/services/package-info.java @@ -0,0 +1,19 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@NonNullApi +package org.gradle.caching.internal.services; + +import org.gradle.api.NonNullApi; diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/configuration/BuildOperationFiringProjectsPreparer.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/configuration/BuildOperationFiringProjectsPreparer.java new file mode 100644 index 0000000..1c99823 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/configuration/BuildOperationFiringProjectsPreparer.java @@ -0,0 +1,73 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.configuration; + +import org.gradle.api.internal.GradleInternal; +import org.gradle.initialization.ConfigureBuildBuildOperationType; +import org.gradle.internal.operations.BuildOperationCategory; +import org.gradle.internal.operations.BuildOperationContext; +import org.gradle.internal.operations.BuildOperationDescriptor; +import org.gradle.internal.operations.BuildOperationExecutor; +import org.gradle.internal.operations.RunnableBuildOperation; + +public class BuildOperationFiringProjectsPreparer implements ProjectsPreparer { + private static final ConfigureBuildBuildOperationType.Result CONFIGURE_BUILD_RESULT = new ConfigureBuildBuildOperationType.Result() { + }; + private final ProjectsPreparer delegate; + private final BuildOperationExecutor buildOperationExecutor; + + public BuildOperationFiringProjectsPreparer(ProjectsPreparer delegate, BuildOperationExecutor buildOperationExecutor) { + this.delegate = delegate; + this.buildOperationExecutor = buildOperationExecutor; + } + + @Override + public void prepareProjects(GradleInternal gradle) { + buildOperationExecutor.run(new ConfigureBuild(gradle)); + } + + private class ConfigureBuild implements RunnableBuildOperation { + private final GradleInternal gradle; + + public ConfigureBuild(GradleInternal gradle) { + this.gradle = gradle; + } + + @Override + public void run(BuildOperationContext context) { + delegate.prepareProjects(gradle); + context.setResult(CONFIGURE_BUILD_RESULT); + } + + @Override + public BuildOperationDescriptor.Builder description() { + BuildOperationDescriptor.Builder builder = BuildOperationDescriptor.displayName(gradle.contextualize("Configure build")); + if (gradle.isRootBuild()) { + builder.metadata(BuildOperationCategory.CONFIGURE_ROOT_BUILD); + } else { + builder.metadata(BuildOperationCategory.CONFIGURE_BUILD); + } + builder.totalProgress(gradle.getSettings().getProjectRegistry().size()); + return builder.details(new ConfigureBuildBuildOperationType.Details() { + @Override + public String getBuildPath() { + return gradle.getIdentityPath().toString(); + } + }); + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/configuration/BuildOperationScriptPlugin.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/configuration/BuildOperationScriptPlugin.java new file mode 100644 index 0000000..ad7e068 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/configuration/BuildOperationScriptPlugin.java @@ -0,0 +1,141 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.configuration; + +import org.gradle.configuration.internal.UserCodeApplicationContext; +import org.gradle.configuration.internal.UserCodeApplicationId; +import org.gradle.groovy.scripts.ScriptSource; +import org.gradle.internal.operations.BuildOperationContext; +import org.gradle.internal.operations.BuildOperationDescriptor; +import org.gradle.internal.operations.BuildOperationExecutor; +import org.gradle.internal.operations.RunnableBuildOperation; +import org.gradle.internal.resource.ResourceLocation; +import org.gradle.internal.resource.TextResource; + +import javax.annotation.Nullable; +import java.io.File; +import java.net.URI; + +/** + * A decorating {@link ScriptPlugin} implementation that delegates to a given + * delegatee implementation, but wraps the apply() execution in a + * {@link org.gradle.internal.operations.BuildOperation}. + */ +public class BuildOperationScriptPlugin implements ScriptPlugin { + + private final ScriptPlugin decorated; + private final BuildOperationExecutor buildOperationExecutor; + private final UserCodeApplicationContext userCodeApplicationContext; + + public BuildOperationScriptPlugin(ScriptPlugin decorated, BuildOperationExecutor buildOperationExecutor, UserCodeApplicationContext userCodeApplicationContext) { + this.decorated = decorated; + this.buildOperationExecutor = buildOperationExecutor; + this.userCodeApplicationContext = userCodeApplicationContext; + } + + @Override + public ScriptSource getSource() { + return decorated.getSource(); + } + + @Override + public void apply(final Object target) { + TextResource resource = getSource().getResource(); + if (resource.isContentCached() && resource.getHasEmptyContent()) { + //no operation, if there is no script code provided + decorated.apply(target); + } else { + userCodeApplicationContext.apply(getSource().getShortDisplayName(), userCodeApplicationId -> buildOperationExecutor.run(new RunnableBuildOperation() { + @Override + public void run(BuildOperationContext context) { + decorated.apply(target); + context.setResult(OPERATION_RESULT); + } + + @Override + public BuildOperationDescriptor.Builder description() { + final ScriptSource source = getSource(); + final ResourceLocation resourceLocation = source.getResource().getLocation(); + final File file = resourceLocation.getFile(); + String name = "Apply " + source.getShortDisplayName(); + final String displayName = name + " to " + target; + + return BuildOperationDescriptor.displayName(displayName) + .name(name) + .details(new OperationDetails(file, resourceLocation, ConfigurationTargetIdentifier.of(target), userCodeApplicationId)); + } + })); + } + } + + private static class OperationDetails implements ApplyScriptPluginBuildOperationType.Details { + + private final File file; + private final ResourceLocation resourceLocation; + private final ConfigurationTargetIdentifier identifier; + private final UserCodeApplicationId applicationId; + + private OperationDetails(File file, ResourceLocation resourceLocation, @Nullable ConfigurationTargetIdentifier identifier, UserCodeApplicationId applicationId) { + this.file = file; + this.resourceLocation = resourceLocation; + this.identifier = identifier; + this.applicationId = applicationId; + } + + @Override + @Nullable + public String getFile() { + return file == null ? null : file.getAbsolutePath(); + } + + @Nullable + @Override + public String getUri() { + if (file == null) { + URI uri = resourceLocation.getURI(); + return uri == null ? null : uri.toASCIIString(); + } else { + return null; + } + } + + @Override + public String getTargetType() { + return identifier == null ? null : identifier.getTargetType().label; + } + + @Nullable + @Override + public String getTargetPath() { + return identifier == null ? null : identifier.getTargetPath(); + } + + @Override + public String getBuildPath() { + return identifier == null ? null : identifier.getBuildPath(); + } + + @Override + public long getApplicationId() { + return applicationId.longValue(); + } + } + + + private static final ApplyScriptPluginBuildOperationType.Result OPERATION_RESULT = new ApplyScriptPluginBuildOperationType.Result() { + }; +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/configuration/ScriptTarget.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/configuration/ScriptTarget.java new file mode 100644 index 0000000..74e7d85 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/configuration/ScriptTarget.java @@ -0,0 +1,56 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.configuration; + +import groovy.lang.Script; +import org.gradle.api.internal.plugins.PluginManagerInternal; +import org.gradle.groovy.scripts.BasicScript; + +/** + * A view over the target of a script. Represents the DSL that will be applied to the target. + */ +public interface ScriptTarget { + /** + * Returns a unique id for the DSL, used in paths and such. + */ + String getId(); + + /** + * Attaches the target's main script to the target, if it needs it + */ + void attachScript(Script script); + + String getClasspathBlockName(); + + Class getScriptClass(); + + boolean getSupportsPluginsBlock(); + + boolean getSupportsPluginManagementBlock(); + + boolean getSupportsMethodInheritance(); + + PluginManagerInternal getPluginManager(); + + /** + * Add a configuration action to be applied to the target. + * + * @param runnable The action. Should be run in the order provided. + * @param deferrable true when the action can be deferred + */ + void addConfiguration(Runnable runnable, boolean deferrable); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/execution/BuildConfigurationActionExecuter.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/execution/BuildConfigurationActionExecuter.java new file mode 100644 index 0000000..7a069d2 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/execution/BuildConfigurationActionExecuter.java @@ -0,0 +1,37 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.execution; + +import org.gradle.api.internal.GradleInternal; + +import java.util.List; + + +/** + * Selects the tasks requested for a build. + */ +public interface BuildConfigurationActionExecuter { + /** + * Selects the tasks to execute, if any. This method is called before any other methods on this executer. + */ + void select(GradleInternal gradle); + + /** + * registers actions allowing late customization of handled BuildConfigurationActions, if any. This method is called before any other methods on this executer. + */ + void setTaskSelectors(List taskSelectors); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/execution/SelectedTaskExecutionAction.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/execution/SelectedTaskExecutionAction.java new file mode 100644 index 0000000..5e86783 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/execution/SelectedTaskExecutionAction.java @@ -0,0 +1,51 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.execution; + +import com.google.common.collect.Sets; +import org.gradle.api.Project; +import org.gradle.api.Task; +import org.gradle.api.execution.TaskExecutionGraph; +import org.gradle.api.internal.GradleInternal; +import org.gradle.api.internal.project.ProjectInternal; +import org.gradle.execution.taskgraph.TaskExecutionGraphInternal; + +import java.util.Collection; +import java.util.Set; + +public class SelectedTaskExecutionAction implements BuildExecutionAction { + @Override + public void execute(BuildExecutionContext context, Collection taskFailures) { + GradleInternal gradle = context.getGradle(); + TaskExecutionGraphInternal taskGraph = gradle.getTaskGraph(); + if (gradle.getStartParameter().isContinueOnFailure()) { + taskGraph.setContinueOnFailure(true); + } + + bindAllReferencesOfProject(taskGraph); + taskGraph.execute(taskFailures); + } + + private void bindAllReferencesOfProject(TaskExecutionGraph graph) { + Set seen = Sets.newHashSet(); + for (Task task : graph.getAllTasks()) { + if (seen.add(task.getProject())) { + ProjectInternal projectInternal = (ProjectInternal) task.getProject(); + projectInternal.bindAllModelRules(); + } + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/execution/plan/TaskDependencyResolver.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/execution/plan/TaskDependencyResolver.java new file mode 100644 index 0000000..377b0f1 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/execution/plan/TaskDependencyResolver.java @@ -0,0 +1,48 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.execution.plan; + +import org.gradle.api.NonNullApi; +import org.gradle.api.internal.TaskInternal; +import org.gradle.api.internal.tasks.CachingTaskDependencyResolveContext; + +import javax.annotation.Nullable; +import java.util.List; +import java.util.Set; + +@NonNullApi +public class TaskDependencyResolver { + private final List dependencyResolvers; + private CachingTaskDependencyResolveContext context; + + public TaskDependencyResolver(List dependencyResolvers) { + this.dependencyResolvers = dependencyResolvers; + this.context = createTaskDependencyResolverContext(dependencyResolvers); + } + + public void clear() { + context = createTaskDependencyResolverContext(dependencyResolvers); + } + + private static CachingTaskDependencyResolveContext createTaskDependencyResolverContext(List workResolvers) { + return new CachingTaskDependencyResolveContext(workResolvers); + } + + public Set resolveDependenciesFor(@Nullable TaskInternal task, Object dependencies) { + return context.getDependencies(task, dependencies); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/groovy/scripts/DefaultScript.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/groovy/scripts/DefaultScript.java new file mode 100644 index 0000000..f1ec8f1 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/groovy/scripts/DefaultScript.java @@ -0,0 +1,277 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.groovy.scripts; + +import groovy.lang.Closure; +import org.gradle.api.Action; +import org.gradle.api.PathValidation; +import org.gradle.api.Script; +import org.gradle.api.file.ConfigurableFileCollection; +import org.gradle.api.file.ConfigurableFileTree; +import org.gradle.api.file.CopySpec; +import org.gradle.api.file.DeleteSpec; +import org.gradle.api.file.FileTree; +import org.gradle.api.initialization.dsl.ScriptHandler; +import org.gradle.api.internal.ProcessOperations; +import org.gradle.api.internal.file.DefaultFileOperations; +import org.gradle.api.internal.file.FileCollectionFactory; +import org.gradle.api.internal.file.FileLookup; +import org.gradle.api.internal.file.FileOperations; +import org.gradle.api.internal.file.FileResolver; +import org.gradle.api.internal.file.HasScriptServices; +import org.gradle.api.internal.initialization.ClassLoaderScope; +import org.gradle.api.internal.initialization.ScriptHandlerFactory; +import org.gradle.api.internal.model.InstantiatorBackedObjectFactory; +import org.gradle.api.internal.plugins.DefaultObjectConfigurationAction; +import org.gradle.api.logging.Logger; +import org.gradle.api.logging.Logging; +import org.gradle.api.logging.LoggingManager; +import org.gradle.api.provider.Provider; +import org.gradle.api.provider.ProviderFactory; +import org.gradle.api.resources.ResourceHandler; +import org.gradle.api.tasks.WorkResult; +import org.gradle.configuration.ScriptPluginFactory; +import org.gradle.internal.Actions; +import org.gradle.internal.reflect.Instantiator; +import org.gradle.internal.resource.TextUriResourceLoader; +import org.gradle.internal.service.ServiceRegistry; +import org.gradle.process.ExecResult; +import org.gradle.process.ExecSpec; +import org.gradle.process.JavaExecSpec; +import org.gradle.process.internal.ExecFactory; +import org.gradle.util.ConfigureUtil; + +import java.io.File; +import java.net.URI; +import java.util.Map; +import java.util.concurrent.Callable; + +public abstract class DefaultScript extends BasicScript { + private static final Logger LOGGER = Logging.getLogger(Script.class); + + private FileOperations fileOperations; + private ProcessOperations processOperations; + private ProviderFactory providerFactory; + private LoggingManager loggingManager; + + public ServiceRegistry __scriptServices; + + @Override + public void init(final Object target, ServiceRegistry services) { + super.init(target, services); + this.__scriptServices = services; + loggingManager = services.get(LoggingManager.class); + if (target instanceof HasScriptServices) { + HasScriptServices scriptServices = (HasScriptServices) target; + fileOperations = scriptServices.getFileOperations(); + processOperations = scriptServices.getProcessOperations(); + } else { + Instantiator instantiator = services.get(Instantiator.class); + FileLookup fileLookup = services.get(FileLookup.class); + FileCollectionFactory fileCollectionFactory = services.get(FileCollectionFactory.class); + File sourceFile = getScriptSource().getResource().getLocation().getFile(); + if (sourceFile != null) { + FileResolver resolver = fileLookup.getFileResolver(sourceFile.getParentFile()); + FileCollectionFactory fileCollectionFactoryWithBase = fileCollectionFactory.withResolver(resolver); + fileOperations = DefaultFileOperations.createSimple(resolver, fileCollectionFactoryWithBase, services); + processOperations = services.get(ExecFactory.class).forContext(resolver, fileCollectionFactoryWithBase, instantiator, new InstantiatorBackedObjectFactory(instantiator)); + } else { + fileOperations = DefaultFileOperations.createSimple(fileLookup.getFileResolver(), fileCollectionFactory, services); + processOperations = services.get(ExecFactory.class); + } + } + + providerFactory = services.get(ProviderFactory.class); + } + + public FileResolver getFileResolver() { + return fileOperations.getFileResolver(); + } + + private DefaultObjectConfigurationAction createObjectConfigurationAction() { + ClassLoaderScope classLoaderScope = __scriptServices.get(ClassLoaderScope.class); + return new DefaultObjectConfigurationAction( + getFileResolver(), + __scriptServices.get(ScriptPluginFactory.class), + __scriptServices.get(ScriptHandlerFactory.class), + classLoaderScope, + __scriptServices.get(TextUriResourceLoader.Factory.class), + getScriptTarget() + ); + } + + @Override + public void apply(Closure closure) { + DefaultObjectConfigurationAction action = createObjectConfigurationAction(); + ConfigureUtil.configure(closure, action); + action.execute(); + } + + @Override + public void apply(Map options) { + DefaultObjectConfigurationAction action = createObjectConfigurationAction(); + ConfigureUtil.configureByMap(options, action); + action.execute(); + } + + @Override + public ScriptHandler getBuildscript() { + return __scriptServices.get(ScriptHandler.class); + } + + @Override + public void buildscript(Closure configureClosure) { + ConfigureUtil.configure(configureClosure, getBuildscript()); + } + + @Override + public File file(Object path) { + return fileOperations.file(path); + } + + @Override + public File file(Object path, PathValidation validation) { + return fileOperations.file(path, validation); + } + + @Override + public URI uri(Object path) { + return fileOperations.uri(path); + } + + @Override + public ConfigurableFileCollection files(Object... paths) { + return fileOperations.configurableFiles(paths); + } + + @Override + public ConfigurableFileCollection files(Object paths, Closure configureClosure) { + return ConfigureUtil.configure(configureClosure, files(paths)); + } + + @Override + public String relativePath(Object path) { + return fileOperations.relativePath(path); + } + + @Override + public ConfigurableFileTree fileTree(Object baseDir) { + return fileOperations.fileTree(baseDir); + } + + @Override + public ConfigurableFileTree fileTree(Map args) { + return fileOperations.fileTree(args); + } + + @Override + public ConfigurableFileTree fileTree(Object baseDir, Closure configureClosure) { + return ConfigureUtil.configure(configureClosure, fileOperations.fileTree(baseDir)); + } + + @Override + public FileTree zipTree(Object zipPath) { + return fileOperations.zipTree(zipPath); + } + + @Override + public FileTree tarTree(Object tarPath) { + return fileOperations.tarTree(tarPath); + } + + @Override + public ResourceHandler getResources() { + return fileOperations.getResources(); + } + + @Override + public WorkResult copy(Closure closure) { + return copy(ConfigureUtil.configureUsing(closure)); + } + + public WorkResult copy(Action action) { + return fileOperations.copy(action); + } + + public WorkResult sync(Action action) { + return fileOperations.sync(action); + } + + @Override + public CopySpec copySpec(Closure closure) { + return Actions.with(copySpec(), ConfigureUtil.configureUsing(closure)); + } + + public CopySpec copySpec() { + return fileOperations.copySpec(); + } + + @Override + public File mkdir(Object path) { + return fileOperations.mkdir(path); + } + + @Override + public boolean delete(Object... paths) { + return fileOperations.delete(paths); + } + + public WorkResult delete(Action action) { + return fileOperations.delete(action); + } + + @Override + public ExecResult javaexec(Closure closure) { + return processOperations.javaexec(ConfigureUtil.configureUsing(closure)); + } + + @Override + public ExecResult javaexec(Action action) { + return processOperations.javaexec(action); + } + + @Override + public ExecResult exec(Closure closure) { + return processOperations.exec(ConfigureUtil.configureUsing(closure)); + } + + @Override + public ExecResult exec(Action action) { + return processOperations.exec(action); + } + + @Override + public Provider provider(Callable value) { + return providerFactory.provider(value); + } + + @Override + public LoggingManager getLogging() { + return loggingManager; + } + + @Override + public Logger getLogger() { + return LOGGER; + } + + public String toString() { + return "script"; + } + + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/groovy/scripts/internal/ScriptCacheKey.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/groovy/scripts/internal/ScriptCacheKey.java new file mode 100644 index 0000000..70dc9d1 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/groovy/scripts/internal/ScriptCacheKey.java @@ -0,0 +1,56 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.groovy.scripts.internal; + +import java.lang.ref.WeakReference; + +public class ScriptCacheKey { + private final String className; + private final WeakReference classLoader; + private final String dslId; + + ScriptCacheKey(String className, ClassLoader classLoader, String dslId) { + this.className = className; + this.classLoader = new WeakReference(classLoader); + this.dslId = dslId; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + ScriptCacheKey key = (ScriptCacheKey) o; + + return classLoader.get() != null && key.classLoader.get() != null + && classLoader.get().equals(key.classLoader.get()) + && className.equals(key.className) + && dslId.equals(key.dslId); + } + + @Override + public int hashCode() { + ClassLoader loader = this.classLoader.get(); + int result = className.hashCode(); + result = 31 * result + (loader != null ? loader.hashCode() : 1); + result = 31 * result + dslId.hashCode(); + return result; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/initialization/ClassLoaderScopeListeners.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/initialization/ClassLoaderScopeListeners.java new file mode 100644 index 0000000..b02fed1 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/initialization/ClassLoaderScopeListeners.java @@ -0,0 +1,41 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.initialization; + +import org.gradle.internal.event.AnonymousListenerBroadcast; +import org.gradle.internal.event.ListenerBroadcast; + +/** + * This is a work around for event scoping. It would be simpler to fire these events at the global scope and subscribe to them in child scopes. + * However, currently events only travel up scopes and cannot be observed from child scopes. This class simulates being able to receive events + * from child scopes. + */ +public class ClassLoaderScopeListeners { + private ListenerBroadcast broadcast = new AnonymousListenerBroadcast<>(ClassLoaderScopeRegistryListener.class); + + public ClassLoaderScopeRegistryListener getBroadcast() { + return broadcast.getSource(); + } + + public void addListener(ClassLoaderScopeRegistryListener listener) { + broadcast.add(listener); + } + + public void removeListener(ClassLoaderScopeRegistryListener listener) { + broadcast.remove(listener); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/initialization/buildsrc/package-info.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/initialization/buildsrc/package-info.java new file mode 100644 index 0000000..567cc2a --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/initialization/buildsrc/package-info.java @@ -0,0 +1,19 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@NonNullApi +package org.gradle.initialization.buildsrc; + +import org.gradle.api.NonNullApi; diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/internal/exceptions/LocationAwareException.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/internal/exceptions/LocationAwareException.java new file mode 100644 index 0000000..6d85f9a --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/internal/exceptions/LocationAwareException.java @@ -0,0 +1,113 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.internal.exceptions; + +import org.apache.commons.lang.StringUtils; +import org.gradle.groovy.scripts.ScriptSource; +import org.gradle.initialization.BuildClientMetaData; +import org.gradle.internal.logging.text.StyledTextOutput; +import org.gradle.internal.scan.UsedByScanPlugin; + +/** + * A {@code LocationAwareException} is an exception which can be annotated with a location in a script. + */ +@UsedByScanPlugin +public class LocationAwareException extends ContextAwareException implements FailureResolutionAware { + private final String sourceDisplayName; + private final Integer lineNumber; + + public LocationAwareException(Throwable cause, ScriptSource source, Integer lineNumber) { + this(cause, source != null ? source.getDisplayName() : null, lineNumber); + } + + public LocationAwareException(Throwable cause, String sourceDisplayName, Integer lineNumber) { + super(cause); + this.sourceDisplayName = sourceDisplayName; + this.lineNumber = lineNumber; + } + + /** + *

Returns the display name of the script where this exception occurred.

+ * + * @return The source display name. May return null. + */ + public String getSourceDisplayName() { + return sourceDisplayName; + } + + /** + *

Returns a description of the location of where this exception occurred.

+ * + * @return The location description. May return null. + */ + public String getLocation() { + if (sourceDisplayName == null) { + return null; + } + String sourceMsg = StringUtils.capitalize(sourceDisplayName); + if (lineNumber == null) { + return sourceMsg; + } + return String.format("%s line: %d", sourceMsg, lineNumber); + } + + /** + * Returns the line in the script where this exception occurred, if known. + * + * @return The line number, or null if not known. + */ + public Integer getLineNumber() { + return lineNumber; + } + + /** + * Returns the fully formatted error message, including the location. + * + * @return the message. May return null. + */ + @Override + public String getMessage() { + String location = getLocation(); + String message = getCause().getMessage(); + if (location == null && message == null) { + return null; + } + if (location == null) { + return message; + } + if (message == null) { + return location; + } + return String.format("%s%n%s", location, message); + } + + @Override + public void appendResolution(StyledTextOutput output, BuildClientMetaData clientMetaData) { + if (getCause() instanceof FailureResolutionAware) { + FailureResolutionAware resolutionAware = (FailureResolutionAware) getCause(); + resolutionAware.appendResolution(output, clientMetaData); + } + } + + @Override + public void accept(ExceptionContextVisitor contextVisitor) { + super.accept(contextVisitor); + String location = getLocation(); + if (location != null) { + contextVisitor.visitLocation(location); + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/internal/filewatch/PendingChangesManager.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/internal/filewatch/PendingChangesManager.java new file mode 100644 index 0000000..d4e2c20 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/internal/filewatch/PendingChangesManager.java @@ -0,0 +1,35 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.filewatch; + +import org.gradle.internal.event.ListenerManager; + +public class PendingChangesManager { + private final ListenerManager listenerManager; + + public PendingChangesManager(ListenerManager listenerManager) { + this.listenerManager = listenerManager; + } + + public void addListener(PendingChangesListener listener) { + listenerManager.addListener(listener); + } + + public void removeListener(PendingChangesListener listener) { + listenerManager.removeListener(listener); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/internal/fingerprint/RelativePathInputNormalizer.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/internal/fingerprint/RelativePathInputNormalizer.java new file mode 100644 index 0000000..77ad1a0 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/internal/fingerprint/RelativePathInputNormalizer.java @@ -0,0 +1,25 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.fingerprint; + +import org.gradle.api.tasks.FileNormalizer; + +/** + * {@link FileNormalizer} that uses the location of files in a hierarchy as normalized paths. + */ +public interface RelativePathInputNormalizer extends FileNormalizer { +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/plugin/use/internal/PluginRequestApplicator.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/plugin/use/internal/PluginRequestApplicator.java new file mode 100644 index 0000000..ecb1660 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/plugin/use/internal/PluginRequestApplicator.java @@ -0,0 +1,40 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.plugin.use.internal; + +import org.gradle.api.internal.initialization.ClassLoaderScope; +import org.gradle.api.internal.initialization.ScriptHandlerInternal; +import org.gradle.api.internal.plugins.PluginManagerInternal; +import org.gradle.internal.service.scopes.Scopes; +import org.gradle.internal.service.scopes.ServiceScope; +import org.gradle.plugin.management.internal.PluginRequests; + +import javax.annotation.Nullable; + +@ServiceScope(Scopes.Build.class) +public interface PluginRequestApplicator { + + /** + * Resolves the given {@link PluginRequests} into the given {@link ScriptHandlerInternal#getScriptClassPath()}, + * exports the resulting classpath into the given {@link ClassLoaderScope}, closes it and then applies + * the requested plugins. + * + * A null target indicates that no plugin requests should be resolved but only the setup of the given + * {@link ClassLoaderScope}. + */ + void applyPlugins(PluginRequests requests, ScriptHandlerInternal scriptHandler, @Nullable PluginManagerInternal target, ClassLoaderScope classLoaderScope); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/process/internal/BadExitCodeException.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/process/internal/BadExitCodeException.java new file mode 100644 index 0000000..edbf5d1 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/process/internal/BadExitCodeException.java @@ -0,0 +1,22 @@ +/* + * Copyright 2007-2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.process.internal; + +public class BadExitCodeException extends Exception { + public BadExitCodeException(String message) { + super(message); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/process/internal/worker/WorkerProcessException.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/process/internal/worker/WorkerProcessException.java new file mode 100644 index 0000000..8cde906 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/process/internal/worker/WorkerProcessException.java @@ -0,0 +1,31 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.process.internal.worker; + +import org.gradle.api.GradleException; +import org.gradle.internal.exceptions.Contextual; + +@Contextual +public class WorkerProcessException extends GradleException { + public WorkerProcessException(String message, Throwable cause) { + super(message, cause); + } + + public static WorkerProcessException runFailed(String workerDisplayName, Throwable failure) { + return new WorkerProcessException(String.format("Failed to run %s", workerDisplayName), failure); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/testfixtures/internal/TestGlobalScopeServices.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/testfixtures/internal/TestGlobalScopeServices.java new file mode 100644 index 0000000..10033ca --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/core/org/gradle/testfixtures/internal/TestGlobalScopeServices.java @@ -0,0 +1,39 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.testfixtures.internal; + +import org.gradle.cache.FileLockManager; +import org.gradle.cache.internal.CacheFactory; +import org.gradle.internal.Factory; +import org.gradle.internal.concurrent.ExecutorFactory; +import org.gradle.internal.logging.LoggingManagerInternal; +import org.gradle.internal.logging.progress.ProgressLoggerFactory; +import org.gradle.internal.service.scopes.GlobalScopeServices; + +public class TestGlobalScopeServices extends GlobalScopeServices { + public TestGlobalScopeServices() { + super(false); + } + + @Override + protected CacheFactory createCacheFactory(FileLockManager fileLockManager, ExecutorFactory executorFactory, ProgressLoggerFactory progressLoggerFactory) { + return new InMemoryCacheFactory(); + } + + LoggingManagerInternal createLoggingManager(Factory loggingManagerFactory) { + return loggingManagerFactory.create(); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/DefaultComponentSelectorConverter.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/DefaultComponentSelectorConverter.java new file mode 100644 index 0000000..fd86bfb --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/DefaultComponentSelectorConverter.java @@ -0,0 +1,72 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts; + +import org.gradle.api.artifacts.ModuleIdentifier; +import org.gradle.api.artifacts.ModuleVersionIdentifier; +import org.gradle.api.artifacts.ModuleVersionSelector; +import org.gradle.api.artifacts.component.ComponentSelector; +import org.gradle.api.artifacts.component.LibraryComponentSelector; +import org.gradle.api.artifacts.component.ModuleComponentSelector; +import org.gradle.api.artifacts.component.ProjectComponentIdentifier; +import org.gradle.api.artifacts.component.ProjectComponentSelector; +import org.gradle.api.internal.artifacts.component.ComponentIdentifierFactory; +import org.gradle.api.internal.artifacts.ivyservice.projectmodule.LocalComponentRegistry; +import org.gradle.internal.component.local.model.LocalComponentMetadata; +import org.gradle.util.GUtil; + +public class DefaultComponentSelectorConverter implements ComponentSelectorConverter { + private static final ModuleVersionSelector UNKNOWN_MODULE_VERSION_SELECTOR = DefaultModuleVersionSelector.newSelector(DefaultModuleIdentifier.newId("", "unknown"), ""); + private final ComponentIdentifierFactory componentIdentifierFactory; + private final LocalComponentRegistry localComponentRegistry; + + public DefaultComponentSelectorConverter(ComponentIdentifierFactory componentIdentifierFactory, LocalComponentRegistry localComponentRegistry) { + this.componentIdentifierFactory = componentIdentifierFactory; + this.localComponentRegistry = localComponentRegistry; + } + + @Override + public ModuleIdentifier getModule(ComponentSelector componentSelector) { + if (componentSelector instanceof ModuleComponentSelector) { + ModuleComponentSelector module = (ModuleComponentSelector) componentSelector; + return module.getModuleIdentifier(); + } + ModuleVersionSelector moduleVersionSelector = getSelector(componentSelector); + return moduleVersionSelector.getModule(); + } + + @Override + public ModuleVersionSelector getSelector(ComponentSelector selector) { + if (selector instanceof ModuleComponentSelector) { + return DefaultModuleVersionSelector.newSelector((ModuleComponentSelector) selector); + } + if (selector instanceof ProjectComponentSelector) { + ProjectComponentSelector projectSelector = (ProjectComponentSelector) selector; + ProjectComponentIdentifier projectId = componentIdentifierFactory.createProjectComponentIdentifier(projectSelector); + LocalComponentMetadata projectComponent = localComponentRegistry.getComponent(projectId); + if (projectComponent != null) { + ModuleVersionIdentifier moduleVersionId = projectComponent.getModuleVersionId(); + return DefaultModuleVersionSelector.newSelector(moduleVersionId.getModule(), moduleVersionId.getVersion()); + } + } + if (selector instanceof LibraryComponentSelector) { + LibraryComponentSelector libraryComponentSelector = (LibraryComponentSelector) selector; + String libraryName = GUtil.elvis(libraryComponentSelector.getLibraryName(), ""); + return DefaultModuleVersionSelector.newSelector(DefaultModuleIdentifier.newId(libraryComponentSelector.getProjectPath(), libraryName), "undefined"); + } + return UNKNOWN_MODULE_VERSION_SELECTOR; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/DefaultGlobalDependencyResolutionRules.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/DefaultGlobalDependencyResolutionRules.java new file mode 100644 index 0000000..031c37b --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/DefaultGlobalDependencyResolutionRules.java @@ -0,0 +1,77 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts; + +import org.gradle.api.Action; +import org.gradle.api.artifacts.DependencySubstitution; +import org.gradle.api.internal.artifacts.ivyservice.dependencysubstitution.DependencySubstitutionRules; +import org.gradle.internal.Actions; +import org.gradle.util.CollectionUtils; + +import java.util.List; + +public class DefaultGlobalDependencyResolutionRules implements GlobalDependencyResolutionRules { + private final ComponentMetadataProcessorFactory componentMetadataProcessorFactory; + private final ComponentModuleMetadataProcessor moduleMetadataProcessor; + private final DependencySubstitutionRules globalDependencySubstitutionRule; + + public DefaultGlobalDependencyResolutionRules(ComponentMetadataProcessorFactory componentMetadataProcessorFactory, + ComponentModuleMetadataProcessor moduleMetadataProcessor, + List ruleProviders) { + this.componentMetadataProcessorFactory = componentMetadataProcessorFactory; + this.moduleMetadataProcessor = moduleMetadataProcessor; + this.globalDependencySubstitutionRule = new CompositeDependencySubstitutionRules(ruleProviders); + } + + @Override + public ComponentMetadataProcessorFactory getComponentMetadataProcessorFactory() { + return componentMetadataProcessorFactory; + } + + @Override + public ComponentModuleMetadataProcessor getModuleMetadataProcessor() { + return moduleMetadataProcessor; + } + + @Override + public DependencySubstitutionRules getDependencySubstitutionRules() { + return globalDependencySubstitutionRule; + } + + private static class CompositeDependencySubstitutionRules implements DependencySubstitutionRules { + private final List ruleProviders; + + private CompositeDependencySubstitutionRules(List ruleProviders) { + this.ruleProviders = ruleProviders; + } + + @Override + public Action getRuleAction() { + return Actions.composite(CollectionUtils.collect(ruleProviders, DependencySubstitutionRules::getRuleAction)); + } + + @Override + public boolean hasRules() { + for (DependencySubstitutionRules ruleProvider : ruleProviders) { + if (ruleProvider.hasRules()) { + return true; + } + } + return false; + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/DownloadArtifactBuildOperationType.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/DownloadArtifactBuildOperationType.java new file mode 100644 index 0000000..2776599 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/DownloadArtifactBuildOperationType.java @@ -0,0 +1,61 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts; + +import org.gradle.internal.operations.BuildOperationType; +import org.gradle.internal.scan.UsedByScanPlugin; + +/** + * Details about an artifact being downloaded. + * + * @since 4.0 + */ +public final class DownloadArtifactBuildOperationType implements BuildOperationType { + + @UsedByScanPlugin + public interface Details { + + String getArtifactIdentifier(); + + } + + public interface Result { + + } + + public static class DetailsImpl implements Details { + + private final String artifactIdentifier; + + public DetailsImpl(String artifactIdentifier) { + this.artifactIdentifier = artifactIdentifier; + } + + @Override + public String getArtifactIdentifier() { + return artifactIdentifier; + } + + } + + public final static Result RESULT = new Result() { + }; + + private DownloadArtifactBuildOperationType() { + } + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/ivyresolve/parser/IvyModuleDescriptorConverter.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/ivyresolve/parser/IvyModuleDescriptorConverter.java new file mode 100644 index 0000000..c9e71d6 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/ivyresolve/parser/IvyModuleDescriptorConverter.java @@ -0,0 +1,175 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser; + +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.ListMultimap; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import org.apache.ivy.core.module.descriptor.DefaultDependencyDescriptor; +import org.apache.ivy.core.module.descriptor.DependencyArtifactDescriptor; +import org.apache.ivy.core.module.descriptor.DependencyDescriptor; +import org.apache.ivy.core.module.descriptor.ExcludeRule; +import org.apache.ivy.core.module.descriptor.ModuleDescriptor; +import org.apache.ivy.core.module.id.ArtifactId; +import org.apache.ivy.core.module.id.ModuleRevisionId; +import org.gradle.api.artifacts.component.ModuleComponentSelector; +import org.gradle.api.internal.artifacts.DefaultModuleIdentifier; +import org.gradle.api.internal.artifacts.ImmutableModuleIdentifierFactory; +import org.gradle.api.internal.artifacts.dependencies.DefaultImmutableVersionConstraint; +import org.gradle.api.internal.artifacts.ivyservice.NamespaceId; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.PatternMatchers; +import org.gradle.internal.Cast; +import org.gradle.internal.UncheckedException; +import org.gradle.internal.component.external.descriptor.Artifact; +import org.gradle.internal.component.external.descriptor.Configuration; +import org.gradle.internal.component.external.descriptor.DefaultExclude; +import org.gradle.internal.component.external.model.DefaultModuleComponentSelector; +import org.gradle.internal.component.external.model.ivy.IvyDependencyDescriptor; +import org.gradle.internal.component.model.DefaultIvyArtifactName; +import org.gradle.internal.component.model.Exclude; +import org.gradle.internal.component.model.IvyArtifactName; + +import java.lang.reflect.Field; +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +public class IvyModuleDescriptorConverter { + private static final IvyArtifactName WILDARD_ARTIFACT = new DefaultIvyArtifactName(PatternMatchers.ANY_EXPRESSION, PatternMatchers.ANY_EXPRESSION, PatternMatchers.ANY_EXPRESSION); + + private static final String CLASSIFIER = "classifier"; + private static final Field DEPENDENCY_CONFIG_FIELD; + static { + try { + DEPENDENCY_CONFIG_FIELD = DefaultDependencyDescriptor.class.getDeclaredField("confs"); + DEPENDENCY_CONFIG_FIELD.setAccessible(true); + } catch (NoSuchFieldException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + + private final ImmutableModuleIdentifierFactory moduleIdentifierFactory; + + public IvyModuleDescriptorConverter(ImmutableModuleIdentifierFactory moduleIdentifierFactory) { + this.moduleIdentifierFactory = moduleIdentifierFactory; + } + + public Map extractExtraAttributes(ModuleDescriptor ivyDescriptor) { + return Cast.uncheckedCast(ivyDescriptor.getExtraInfo()); + } + + public List extractExcludes(ModuleDescriptor ivyDescriptor) { + List result = Lists.newArrayListWithCapacity(ivyDescriptor.getAllExcludeRules().length); + for (ExcludeRule excludeRule : ivyDescriptor.getAllExcludeRules()) { + result.add(forIvyExclude(excludeRule)); + } + return result; + } + + public List extractDependencies(ModuleDescriptor ivyDescriptor) { + List result = Lists.newArrayListWithCapacity(ivyDescriptor.getDependencies().length); + for (DependencyDescriptor dependencyDescriptor : ivyDescriptor.getDependencies()) { + addDependency(result, dependencyDescriptor); + } + return result; + } + + public List extractConfigurations(ModuleDescriptor ivyDescriptor) { + List result = Lists.newArrayListWithCapacity(ivyDescriptor.getConfigurations().length); + for (org.apache.ivy.core.module.descriptor.Configuration ivyConfiguration : ivyDescriptor.getConfigurations()) { + addConfiguration(result, ivyConfiguration); + } + return result; + } + + private static void addConfiguration(List result, org.apache.ivy.core.module.descriptor.Configuration configuration) { + String name = configuration.getName(); + boolean transitive = configuration.isTransitive(); + boolean visible = configuration.getVisibility() == org.apache.ivy.core.module.descriptor.Configuration.Visibility.PUBLIC; + List extendsFrom = Lists.newArrayList(configuration.getExtends()); + result.add(new Configuration(name, transitive, visible, extendsFrom)); + } + + private void addDependency(List result, DependencyDescriptor dependencyDescriptor) { + ModuleRevisionId revisionId = dependencyDescriptor.getDependencyRevisionId(); + ModuleComponentSelector requested = DefaultModuleComponentSelector.newSelector(DefaultModuleIdentifier.newId(revisionId.getOrganisation(), revisionId.getName()), new DefaultImmutableVersionConstraint(revisionId.getRevision())); + + ListMultimap configMappings = ArrayListMultimap.create(); + for (Map.Entry> entry : readConfigMappings(dependencyDescriptor).entrySet()) { + configMappings.putAll(entry.getKey(), entry.getValue()); + } + + List artifacts = Lists.newArrayList(); + for (DependencyArtifactDescriptor ivyArtifact : dependencyDescriptor.getAllDependencyArtifacts()) { + IvyArtifactName ivyArtifactName = new DefaultIvyArtifactName(ivyArtifact.getName(), ivyArtifact.getType(), ivyArtifact.getExt(), (String) ivyArtifact.getExtraAttributes().get(CLASSIFIER)); + artifacts.add(new Artifact(ivyArtifactName, Sets.newHashSet(ivyArtifact.getConfigurations()))); + } + + List excludes = Lists.newArrayList(); + for (ExcludeRule excludeRule : dependencyDescriptor.getAllExcludeRules()) { + excludes.add(forIvyExclude(excludeRule)); + } + + result.add(new IvyDependencyDescriptor( + requested, + dependencyDescriptor.getDynamicConstraintDependencyRevisionId().getRevision(), + dependencyDescriptor.isChanging(), + dependencyDescriptor.isTransitive(), + false, + configMappings, + artifacts, + excludes)); + } + + private Exclude forIvyExclude(org.apache.ivy.core.module.descriptor.ExcludeRule excludeRule) { + ArtifactId id = excludeRule.getId(); + IvyArtifactName artifactExclusion = artifactForIvyExclude(id); + return new DefaultExclude( + moduleIdentifierFactory.module(id.getModuleId().getOrganisation(), id.getModuleId().getName()), artifactExclusion, excludeRule.getConfigurations(), excludeRule.getMatcher().getName()); + } + + private IvyArtifactName artifactForIvyExclude(ArtifactId id) { + if (PatternMatchers.ANY_EXPRESSION.equals(id.getName()) + && PatternMatchers.ANY_EXPRESSION.equals(id.getType()) + && PatternMatchers.ANY_EXPRESSION.equals(id.getExt())) { + return null; + } + return new DefaultIvyArtifactName(id.getName(), id.getType(), id.getExt()); + } + + // TODO We should get rid of this reflection (will need to reimplement the parser to act on the metadata directly) + @SuppressWarnings("unchecked") + private static Map> readConfigMappings(DependencyDescriptor dependencyDescriptor) { + if (dependencyDescriptor instanceof DefaultDependencyDescriptor) { + try { + return (Map>) DEPENDENCY_CONFIG_FIELD.get(dependencyDescriptor); + } catch (IllegalAccessException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + + String[] modConfs = dependencyDescriptor.getModuleConfigurations(); + Map> results = Maps.newLinkedHashMap(); + for (String modConf : modConfs) { + results.put(modConf, Arrays.asList(dependencyDescriptor.getDependencyConfigurations(modConfs))); + } + return results; + } + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/ivyresolve/parser/PomParent.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/ivyresolve/parser/PomParent.java new file mode 100644 index 0000000..8286b48 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/ivyresolve/parser/PomParent.java @@ -0,0 +1,54 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser; + +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.PomReader.PomDependencyData; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.data.MavenDependencyKey; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.data.PomDependencyMgt; + +import java.util.Map; + +public interface PomParent { + /** + * Gets POM, GAV and custom properties. + * + * @return Properties + */ + Map getProperties(); + + /** + * Gets declared dependencies. + * + * @return Dependencies + */ + Map getDependencies(); + + /** + * Gets declared dependency management. + * + * @return Dependency management + */ + Map getDependencyMgt(); + + /** + * Finds dependency management default coordinates for a dependency. Returns null if default cannot be found. + * + * @param dependencyKey Dependency key + * @return Dependency management element or null + */ + PomDependencyMgt findDependencyDefaults(MavenDependencyKey dependencyKey); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/moduleconverter/dependencies/IvyDependencyDescriptorFactory.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/moduleconverter/dependencies/IvyDependencyDescriptorFactory.java new file mode 100644 index 0000000..e5a3f8d --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/moduleconverter/dependencies/IvyDependencyDescriptorFactory.java @@ -0,0 +1,29 @@ +/* + * Copyright 2007-2008 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.ivyservice.moduleconverter.dependencies; + +import org.gradle.api.artifacts.ModuleDependency; +import org.gradle.api.artifacts.component.ComponentIdentifier; +import org.gradle.api.attributes.AttributeContainer; +import org.gradle.internal.component.model.LocalOriginDependencyMetadata; + +import javax.annotation.Nullable; + +public interface IvyDependencyDescriptorFactory { + LocalOriginDependencyMetadata createDependencyDescriptor(ComponentIdentifier componentId, @Nullable String clientConfiguration, @Nullable AttributeContainer attributes, ModuleDependency dependency); + + boolean canConvert(ModuleDependency dependency); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/projectmodule/LocalComponentProvider.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/projectmodule/LocalComponentProvider.java new file mode 100644 index 0000000..768a9c2 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/projectmodule/LocalComponentProvider.java @@ -0,0 +1,38 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.ivyservice.projectmodule; + +import org.gradle.api.artifacts.component.ProjectComponentIdentifier; +import org.gradle.internal.component.local.model.LocalComponentMetadata; + +import javax.annotation.Nullable; +import javax.annotation.concurrent.ThreadSafe; + +/** + * A provider of dependency resolution metadata for locally produced components. + * These components may be produced within the same project, another project in the same multi-project build, + * or in another build within a composite. + * + *

In general, you should be using {@link LocalComponentRegistry} instead of this type.

+ */ +@ThreadSafe +public interface LocalComponentProvider { + /** + * @return The component metadata for the supplied identifier. + */ + @Nullable + LocalComponentMetadata getComponent(ProjectComponentIdentifier projectIdentifier); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/projectmodule/ProjectArtifactSetResolver.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/projectmodule/ProjectArtifactSetResolver.java new file mode 100644 index 0000000..df0b108 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/projectmodule/ProjectArtifactSetResolver.java @@ -0,0 +1,82 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.ivyservice.projectmodule; + +import com.google.common.collect.ImmutableSet; +import org.gradle.api.artifacts.ModuleVersionIdentifier; +import org.gradle.api.artifacts.component.ComponentArtifactIdentifier; +import org.gradle.api.artifacts.component.ComponentIdentifier; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.ArtifactSet; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.DefaultArtifactSet; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.ResolvableArtifact; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.ResolvedVariant; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.specs.ExcludeSpec; +import org.gradle.api.internal.artifacts.type.ArtifactTypeRegistry; +import org.gradle.api.internal.attributes.AttributesSchemaInternal; +import org.gradle.api.internal.attributes.ImmutableAttributes; +import org.gradle.internal.component.model.ModuleSources; +import org.gradle.internal.component.model.VariantResolveMetadata; +import org.gradle.internal.component.model.VariantWithOverloadAttributes; +import org.gradle.internal.resolve.resolver.ArtifactResolver; +import org.gradle.internal.service.scopes.Scopes; +import org.gradle.internal.service.scopes.ServiceScope; + +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +@ServiceScope(Scopes.Build.class) +public class ProjectArtifactSetResolver { + private final ArtifactResolver artifactResolver; + // Move this state closer to the project metadata + private final Map allProjectArtifacts = new ConcurrentHashMap<>(); + private final Map allProjectVariants = new ConcurrentHashMap<>(); + + public ProjectArtifactSetResolver(ProjectArtifactResolver artifactResolver) { + this.artifactResolver = artifactResolver; + } + + /** + * Creates an {@link ArtifactSet} that represents the available artifacts for the given set of project variants. + */ + public ArtifactSet resolveArtifacts(ComponentIdentifier componentIdentifier, ModuleVersionIdentifier ownerId, ModuleSources moduleSources, ExcludeSpec exclusions, Set variants, AttributesSchemaInternal schema, ArtifactTypeRegistry artifactTypeRegistry, ImmutableAttributes selectionAttributes) { + ImmutableSet.Builder result = ImmutableSet.builderWithExpectedSize(variants.size()); + for (VariantResolveMetadata variant : variants) { + ResolvedVariant resolvedVariant = mapVariant(ownerId, moduleSources, exclusions, artifactTypeRegistry, variant); + result.add(resolvedVariant); + } + return DefaultArtifactSet.createFromVariants(componentIdentifier, result.build(), schema, selectionAttributes); + } + + private ResolvedVariant mapVariant(ModuleVersionIdentifier ownerId, ModuleSources moduleSources, ExcludeSpec exclusions, ArtifactTypeRegistry artifactTypeRegistry, VariantResolveMetadata variant) { + VariantResolveMetadata.Identifier identifier = variant.getIdentifier(); + if (identifier == null) { + throw new IllegalArgumentException(String.format("Project variant %s does not have an identifier.", variant.asDescribable())); + } + + // Apply any artifact type mappings to the attributes of the variant + ImmutableAttributes variantAttributes = artifactTypeRegistry.mapAttributesFor(variant.getAttributes().asImmutable(), variant.getArtifacts()); + + if (exclusions.mayExcludeArtifacts()) { + // Some artifact may be excluded, so do not reuse. It might be better to apply the exclusions and reuse if none of them apply + return DefaultArtifactSet.toResolvedVariant(variant, ownerId, moduleSources, exclusions, artifactResolver, allProjectArtifacts, variantAttributes); + } + + VariantWithOverloadAttributes key = new VariantWithOverloadAttributes(identifier, variantAttributes); + return allProjectVariants.computeIfAbsent(key, k -> DefaultArtifactSet.toResolvedVariant(variant, ownerId, moduleSources, exclusions, artifactResolver, allProjectArtifacts, variantAttributes)); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/projectmodule/ProjectPublication.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/projectmodule/ProjectPublication.java new file mode 100644 index 0000000..141431a --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/projectmodule/ProjectPublication.java @@ -0,0 +1,26 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.ivyservice.projectmodule; + +import org.gradle.internal.DisplayName; + +/** + * Provides information about a publication of a project. + */ +public interface ProjectPublication { + DisplayName getDisplayName(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/artifact/ResolvableArtifact.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/artifact/ResolvableArtifact.java new file mode 100644 index 0000000..efdc4a0 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/artifact/ResolvableArtifact.java @@ -0,0 +1,44 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact; + +import org.gradle.api.artifacts.ResolvedArtifact; +import org.gradle.api.artifacts.component.ComponentArtifactIdentifier; +import org.gradle.api.internal.tasks.TaskDependencyContainer; + +import java.io.File; + +/** + * Represents an artifact that can be resolved. Call {@link #getFile()} or {@link ResolvedArtifact#getFile()} to resolve. + */ +public interface ResolvableArtifact extends TaskDependencyContainer { + ComponentArtifactIdentifier getId(); + + /** + * Should this artifact be resolved synchronously? For example, is the result of {@link #getFile()} available in memory or can it be calculated quickly without IO calls? Or is the implementation of {@link #getFile()} not parallel safe? + */ + boolean isResolveSynchronously(); + + /** + * Resolves the file, if not already, blocking until complete. + */ + File getFile(); + + ResolvableArtifact transformedTo(File file); + + ResolvedArtifact toPublicView(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/excludes/factories/NormalizingExcludeFactory.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/excludes/factories/NormalizingExcludeFactory.java new file mode 100644 index 0000000..2b08f77 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/excludes/factories/NormalizingExcludeFactory.java @@ -0,0 +1,400 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.factories; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Sets; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.specs.CompositeExclude; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.specs.ExcludeAllOf; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.specs.ExcludeAnyOf; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.specs.ExcludeEverything; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.specs.ExcludeNothing; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.specs.ExcludeSpec; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.specs.GroupExclude; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.specs.GroupSetExclude; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.specs.ModuleExclude; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.specs.ModuleIdExclude; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.specs.ModuleIdSetExclude; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.specs.ModuleSetExclude; +import org.gradle.internal.Cast; + +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.function.BiFunction; +import java.util.function.Predicate; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static java.util.stream.Collectors.toSet; + +/** + * This factory performs normalization of exclude rules. This is the smartest + * of all factories and is responsible for doing some basic algebra computations. + * It shouldn't be too slow, or the whole chain will pay the price. + */ +public class NormalizingExcludeFactory extends DelegatingExcludeFactory { + private final Intersections intersections; + private final Unions unions; + + public NormalizingExcludeFactory(ExcludeFactory delegate) { + super(delegate); + this.intersections = new Intersections(this); + this.unions = new Unions(this); + } + + @Override + public ExcludeSpec anyOf(ExcludeSpec one, ExcludeSpec two) { + return simplify(ExcludeAllOf.class, one, two, (left, right) -> doUnion(ImmutableSet.of(left, right))); + } + + @Override + public ExcludeSpec allOf(ExcludeSpec one, ExcludeSpec two) { + return simplify(ExcludeAnyOf.class, one, two, (left, right) -> doIntersect(ImmutableSet.of(left, right))); + } + + // Simplifies (A ∪ ...) ∩ A = A + // and (A ∩ ...) ∪ A = A + private ExcludeSpec simplify(Class clazz, ExcludeSpec one, ExcludeSpec two, BiFunction orElse) { + if (clazz.isInstance(one)) { + if (componentsOf(one).contains(two)) { + return two; + } + } + if (clazz.isInstance(two)) { + if (componentsOf(two).contains(one)) { + return one; + } + } + return orElse.apply(one, two); + } + + // A ∩ (A ∪ B) ∩ (A ∪ C) -> A + // A ∪ (A ∩ B) ∪ (A ∩ C) -> A + private Set simplifySet(Class clazz, Set specs) { + if (specs.stream().noneMatch(clazz::isInstance)) { + return specs; + } + ExcludeSpec[] asArray = specs.toArray(new ExcludeSpec[0]); + boolean doDrop = false; + for (int i = 0; i < asArray.length; i++) { + ExcludeSpec excludeSpec = asArray[i]; + if (clazz.isInstance(excludeSpec)) { + Set components = componentsOf(excludeSpec); + for (int j = 0; j < asArray.length; j++) { + if (i != j && components.contains(asArray[j])) { + doDrop = true; + asArray[i] = null; + break; + } + } + } + } + if (doDrop) { + specs = Arrays.stream(asArray).filter(Objects::nonNull).collect(toSet()); + } + return specs; + } + + private Set componentsOf(ExcludeSpec spec) { + return ((CompositeExclude) spec).getComponents(); + } + + @Override + public ExcludeSpec anyOf(Set specs) { + return doUnion(specs); + } + + @Override + public ExcludeSpec allOf(Set specs) { + return doIntersect(specs); + } + + private ExcludeSpec doUnion(Set specs) { + specs = simplifySet(ExcludeAllOf.class, specs); + FlattenOperationResult flattened = flatten(ExcludeAnyOf.class, specs, ExcludeEverything.class::isInstance, ExcludeNothing.class::isInstance); + if (flattened.fastExit) { + return everything(); + } + if (flattened.result.isEmpty()) { + return nothing(); + } + Map> byType = flattened.result.stream().collect(Collectors.groupingBy(UnionOf::typeOf)); + List moduleIdExcludes = UnionOf.MODULEID.fromMap(byType); + List moduleIdSetsExcludes = UnionOf.MODULEID_SET.fromMap(byType); + List groupExcludes = UnionOf.GROUP.fromMap(byType); + List groupSetExcludes = UnionOf.GROUP_SET.fromMap(byType); + List moduleExcludes = UnionOf.MODULE.fromMap(byType); + List moduleSetExcludes = UnionOf.MODULE_SET.fromMap(byType); + List other = UnionOf.NOT_JOINABLE.fromMap(byType); + if (!moduleIdExcludes.isEmpty()) { + // If there's more than one module id, merge them into a module id set + if (moduleIdExcludes.size() > 1 || !moduleIdSetsExcludes.isEmpty()) { + ModuleIdSetExclude excludeSpec = delegate.moduleIdSet(moduleIdExcludes.stream().map(ModuleIdExclude::getModuleId).collect(toSet())); + if (moduleIdSetsExcludes.isEmpty()) { + moduleIdSetsExcludes = ImmutableList.of(excludeSpec); + } else { + moduleIdSetsExcludes.add(excludeSpec); + } + moduleIdExcludes = Collections.emptyList(); + } + } + if (!groupExcludes.isEmpty()) { + // If there's more than group, merge them into a group set + if (groupExcludes.size() > 1 || !groupSetExcludes.isEmpty()) { + GroupSetExclude excludeSpec = delegate.groupSet(groupExcludes.stream().map(GroupExclude::getGroup).collect(toSet())); + if (groupSetExcludes.isEmpty()) { + groupSetExcludes = ImmutableList.of(excludeSpec); + } else { + groupSetExcludes.add(excludeSpec); + } + groupExcludes = Collections.emptyList(); + } + } + if (!moduleExcludes.isEmpty()) { + // If there's more than one module, merge them into a module set + if (moduleExcludes.size() > 1 || !moduleSetExcludes.isEmpty()) { + ModuleSetExclude excludeSpec = delegate.moduleSet(moduleExcludes.stream().map(ModuleExclude::getModule).collect(toSet())); + if (moduleSetExcludes.isEmpty()) { + moduleSetExcludes = ImmutableList.of(excludeSpec); + } else { + moduleSetExcludes.add(excludeSpec); + } + moduleExcludes = Collections.emptyList(); + } + } + if (moduleIdSetsExcludes.size() > 1) { + moduleIdSetsExcludes = ImmutableList.of(delegate.moduleIdSet(moduleIdSetsExcludes.stream().flatMap(e -> e.getModuleIds().stream()).collect(toSet()))); + } + if (groupSetExcludes.size() > 1) { + groupSetExcludes = ImmutableList.of(delegate.groupSet(groupSetExcludes.stream().flatMap(e -> e.getGroups().stream()).collect(toSet()))); + } + if (moduleSetExcludes.size() > 1) { + moduleSetExcludes = ImmutableList.of(delegate.moduleSet(moduleSetExcludes.stream().flatMap(e -> e.getModules().stream()).collect(toSet()))); + } + ImmutableSet.Builder builder = ImmutableSet.builderWithExpectedSize( + moduleIdExcludes.size() + groupExcludes.size() + moduleExcludes.size() + + moduleIdSetsExcludes.size() + groupSetExcludes.size() + moduleSetExcludes.size() + other.size() + ); + builder.addAll(moduleIdExcludes); + builder.addAll(groupExcludes); + builder.addAll(moduleExcludes); + builder.addAll(moduleIdSetsExcludes); + builder.addAll(groupSetExcludes); + builder.addAll(moduleSetExcludes); + builder.addAll(other); + Set elements = builder.build(); + if (elements.size() > 1) { + // try simplify + ExcludeSpec[] asArray = elements.toArray(new ExcludeSpec[0]); + boolean simplified = false; + for (int i = 0; i < asArray.length; i++) { + ExcludeSpec left = asArray[i]; + if (left != null) { + for (int j = 0; j < asArray.length; j++) { + ExcludeSpec right = asArray[j]; + if (right != null && i != j) { + ExcludeSpec merged = unions.tryUnion(left, right); + if (merged != null) { + if (merged instanceof ExcludeEverything) { + return merged; + } + left = merged; + asArray[i] = merged; + asArray[j] = null; + simplified = true; + } + } + } + } + } + if (simplified) { + elements = Arrays.stream(asArray).filter(Objects::nonNull).collect(toSet()); + } + } + if (elements.size() == 2) { + // Corner case to handle one of the two elements being an anyOf + Iterator specIterator = elements.iterator(); + ExcludeSpec first = specIterator.next(); + ExcludeSpec second = specIterator.next(); + + if (first instanceof ExcludeAnyOf || second instanceof ExcludeAnyOf) { + ImmutableSet.Builder newBuilder = ImmutableSet.builder(); + if (first instanceof ExcludeAnyOf) { + newBuilder.addAll(((ExcludeAnyOf)first).getComponents()); + } else { + builder.add(first); + } + if (second instanceof ExcludeAnyOf) { + newBuilder.addAll(((ExcludeAnyOf)second).getComponents()); + } else { + builder.add(second); + } + elements = builder.build(); + } + } + return Optimizations.optimizeCollection(this, elements, delegate::anyOf); + } + + /** + * Flattens a collection of elements that are going to be joined or intersected. There + * are 3 possible outcomes: + * - null means that the fast exit condition was reached, meaning that the caller knows it's not worth computing more + * - empty list meaning that an easy simplification was reached and we directly know the result + * - flattened unions/intersections + */ + private FlattenOperationResult flatten(Class flattenType, Set specs, Predicate fastExit, Predicate ignoreSpec) { + boolean filtered = false; + boolean flatten = false; + int size = 0; + for (ExcludeSpec spec : specs) { + if (fastExit.test(spec)) { + return FlattenOperationResult.FAST_EXIT; + } + if (ignoreSpec.test(spec)) { + filtered = true; + } else if (flattenType.isInstance(spec)) { + flatten = true; + size += ((CompositeExclude) spec).size(); + } else { + size++; + } + } + if (!filtered && !flatten) { + return FlattenOperationResult.of(specs); + } + if (filtered && !flatten) { + return filterOnly(specs, ignoreSpec); + } + // slowest path + return expensiveFlatten(flattenType, maybeFilter(specs, ignoreSpec, filtered), size); + } + + private FlattenOperationResult filterOnly(Set specs, Predicate ignoreSpec) { + return FlattenOperationResult.of(specs.stream().filter(e -> !ignoreSpec.test(e)).collect(toSet())); + } + + private Stream maybeFilter(Set specs, Predicate ignoreSpec, boolean filtered) { + Stream stream = specs.stream(); + if (filtered) { + stream = stream.filter(e -> !ignoreSpec.test(e)); + } + return stream; + } + + private FlattenOperationResult expensiveFlatten(Class flattenType, Stream stream, int size) { + return FlattenOperationResult.of(stream + .flatMap(e -> { + if (flattenType.isInstance(e)) { + CompositeExclude compositeExclude = (CompositeExclude) e; + return compositeExclude.components(); + } + return Stream.of(e); + }) + .collect(Collectors.toCollection(() -> Sets.newHashSetWithExpectedSize(size))) + ); + } + + private ExcludeSpec doIntersect(Set specs) { + specs = simplifySet(ExcludeAnyOf.class, specs); + FlattenOperationResult flattened = flatten(ExcludeAllOf.class, specs, ExcludeNothing.class::isInstance, ExcludeEverything.class::isInstance); + if (flattened.fastExit) { + return nothing(); + } + Set result = flattened.result; + if (result.isEmpty()) { + return everything(); + } + if (result.size() > 1) { + // try simplify + ExcludeSpec[] asArray = result.toArray(new ExcludeSpec[0]); + boolean simplified = false; + for (int i = 0; i < asArray.length; i++) { + ExcludeSpec left = asArray[i]; + if (left != null) { + for (int j = 0; j < asArray.length; j++) { + ExcludeSpec right = asArray[j]; + if (right != null && i != j) { + ExcludeSpec merged = intersections.tryIntersect(left, right); + if (merged != null) { + if (merged instanceof ExcludeNothing) { + return merged; + } + left = merged; + asArray[i] = merged; + asArray[j] = null; + simplified = true; + } + } + } + } + } + if (simplified) { + result = Arrays.stream(asArray).filter(Objects::nonNull).collect(toSet()); + } + } + return Optimizations.optimizeCollection(this, result, delegate::allOf); + } + + private enum UnionOf { + MODULEID(ModuleIdExclude.class), + GROUP(GroupExclude.class), + MODULE(ModuleExclude.class), + MODULEID_SET(ModuleIdSetExclude.class), + GROUP_SET(GroupSetExclude.class), + MODULE_SET(ModuleSetExclude.class), + NOT_JOINABLE(ExcludeSpec.class); + + private final Class excludeClass; + + UnionOf(Class excludeClass) { + this.excludeClass = excludeClass; + } + + public List fromMap(Map> from) { + return Cast.uncheckedCast(from.getOrDefault(this, Collections.emptyList())); + } + + public static UnionOf typeOf(ExcludeSpec spec) { + for (UnionOf unionOf : UnionOf.values()) { + if (unionOf.excludeClass.isInstance(spec)) { + return unionOf; + } + } + return null; + } + } + + private static class FlattenOperationResult { + private static final FlattenOperationResult FAST_EXIT = new FlattenOperationResult(null, true); + private final Set result; + private final boolean fastExit; + + private FlattenOperationResult(Set result, boolean fastExit) { + this.result = result; + this.fastExit = fastExit; + } + + public static FlattenOperationResult of(Set specs) { + return new FlattenOperationResult(specs, false); + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/excludes/simple/DefaultCompositeExclude.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/excludes/simple/DefaultCompositeExclude.java new file mode 100644 index 0000000..b958c36 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/excludes/simple/DefaultCompositeExclude.java @@ -0,0 +1,79 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.simple; + +import com.google.common.base.Objects; +import com.google.common.collect.ImmutableSet; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.specs.CompositeExclude; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.specs.ExcludeSpec; + +import java.util.Set; +import java.util.stream.Stream; + +abstract class DefaultCompositeExclude implements CompositeExclude { + private final ImmutableSet components; + private final int hashCode; + private final int size; + + DefaultCompositeExclude(ImmutableSet components) { + this.components = components; + this.size = components.size(); + this.hashCode = (31 * components.hashCode() + this.size) ^ mask(); + } + + abstract int mask(); + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DefaultCompositeExclude that = (DefaultCompositeExclude) o; + return hashCode == that.hashCode && Objects.equal(components, that.components); + } + + @Override + public int hashCode() { + return hashCode; + } + + @Override + public final Stream components() { + return components.stream(); + } + + @Override + public Set getComponents() { + return components; + } + + @Override + public int size() { + return size; + } + + @Override + public String toString() { + return "{\"" + getDisplayName() + "\": " + + " " + components + + '}'; + } + + protected abstract String getDisplayName(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/excludes/simple/ExcludeJsonHelper.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/excludes/simple/ExcludeJsonHelper.java new file mode 100644 index 0000000..8e9373b --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/excludes/simple/ExcludeJsonHelper.java @@ -0,0 +1,27 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.simple; + +import java.util.Collection; +import java.util.stream.Collectors; + +class ExcludeJsonHelper { + static String toJson(Collection objects) { + return objects.stream() + .map(o -> "\"" + o + "\"") + .collect(Collectors.joining(", ")); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/excludes/specs/ExcludeEverything.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/excludes/specs/ExcludeEverything.java new file mode 100644 index 0000000..f2c94d3 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/excludes/specs/ExcludeEverything.java @@ -0,0 +1,19 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.specs; + +public interface ExcludeEverything extends ExcludeSpec { +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/excludes/specs/ModuleSetExclude.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/excludes/specs/ModuleSetExclude.java new file mode 100644 index 0000000..064568f --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/excludes/specs/ModuleSetExclude.java @@ -0,0 +1,22 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.specs; + +import java.util.Set; + +public interface ModuleSetExclude extends ExcludeSpec { + Set getModules(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/result/ComponentResultSerializer.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/result/ComponentResultSerializer.java new file mode 100644 index 0000000..83b4a54 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/result/ComponentResultSerializer.java @@ -0,0 +1,92 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.ivyservice.resolveengine.result; + +import com.google.common.collect.ImmutableList; +import org.gradle.api.artifacts.ModuleVersionIdentifier; +import org.gradle.api.artifacts.component.ComponentIdentifier; +import org.gradle.api.artifacts.result.ComponentSelectionReason; +import org.gradle.api.artifacts.result.ResolvedVariantResult; +import org.gradle.api.internal.artifacts.ImmutableModuleIdentifierFactory; +import org.gradle.api.internal.artifacts.ModuleVersionIdentifierSerializer; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.ResolvedGraphComponent; +import org.gradle.internal.serialize.Decoder; +import org.gradle.internal.serialize.Encoder; +import org.gradle.internal.serialize.Serializer; + +import java.io.IOException; +import java.util.List; + +public class ComponentResultSerializer implements Serializer { + + private final ModuleVersionIdentifierSerializer idSerializer; + private final ComponentSelectionReasonSerializer reasonSerializer; + private final ComponentIdentifierSerializer componentIdSerializer; + private final ResolvedVariantResultSerializer resolvedVariantResultSerializer; + + public ComponentResultSerializer(ImmutableModuleIdentifierFactory moduleIdentifierFactory, + ResolvedVariantResultSerializer resolvedVariantResultSerializer, + ComponentSelectionDescriptorFactory componentSelectionDescriptorFactory) { + this.idSerializer = new ModuleVersionIdentifierSerializer(moduleIdentifierFactory); + this.resolvedVariantResultSerializer = resolvedVariantResultSerializer; + this.reasonSerializer = new ComponentSelectionReasonSerializer(componentSelectionDescriptorFactory); + this.componentIdSerializer = new ComponentIdentifierSerializer(); + } + + void reset() { + resolvedVariantResultSerializer.reset(); + } + + @Override + public ResolvedGraphComponent read(Decoder decoder) throws IOException { + long resultId = decoder.readSmallLong(); + ModuleVersionIdentifier id = idSerializer.read(decoder); + ComponentSelectionReason reason = reasonSerializer.read(decoder); + ComponentIdentifier componentId = componentIdSerializer.read(decoder); + List resolvedVariants = readResolvedVariants(decoder); + String repositoryName = decoder.readNullableString(); + return new DetachedComponentResult(resultId, id, reason, componentId, resolvedVariants, repositoryName); + } + + private List readResolvedVariants(Decoder decoder) throws IOException { + int size = decoder.readSmallInt(); + ImmutableList.Builder builder = ImmutableList.builderWithExpectedSize(size); + for (int i=0; i variants) throws IOException { + encoder.writeSmallInt(variants.size()); + for (ResolvedVariantResult variant : variants) { + resolvedVariantResultSerializer.write(encoder, variant); + } + } + + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/repositories/resolver/ExternalResourceResolverDescriptorParseContext.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/repositories/resolver/ExternalResourceResolverDescriptorParseContext.java new file mode 100644 index 0000000..8292a48 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/repositories/resolver/ExternalResourceResolverDescriptorParseContext.java @@ -0,0 +1,98 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.repositories.resolver; + +import org.gradle.api.artifacts.component.ComponentArtifactIdentifier; +import org.gradle.api.artifacts.component.ModuleComponentIdentifier; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ComponentResolvers; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.DescriptorParseContext; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionSelector; +import org.gradle.internal.hash.ChecksumService; +import org.gradle.api.internal.artifacts.repositories.metadata.DefaultMetadataFileSource; +import org.gradle.api.internal.component.ArtifactType; +import org.gradle.internal.component.external.model.ModuleComponentArtifactIdentifier; +import org.gradle.internal.component.external.model.ModuleDependencyMetadata; +import org.gradle.internal.component.model.ComponentArtifactMetadata; +import org.gradle.internal.component.model.DefaultComponentOverrideMetadata; +import org.gradle.internal.component.model.MutableModuleSources; +import org.gradle.internal.resolve.resolver.ArtifactResolver; +import org.gradle.internal.resolve.resolver.ComponentMetaDataResolver; +import org.gradle.internal.resolve.result.BuildableArtifactResolveResult; +import org.gradle.internal.resolve.result.BuildableArtifactSetResolveResult; +import org.gradle.internal.resolve.result.BuildableComponentIdResolveResult; +import org.gradle.internal.resolve.result.BuildableComponentResolveResult; +import org.gradle.internal.resolve.result.DefaultBuildableArtifactResolveResult; +import org.gradle.internal.resolve.result.DefaultBuildableArtifactSetResolveResult; +import org.gradle.internal.resolve.result.DefaultBuildableComponentIdResolveResult; +import org.gradle.internal.resolve.result.DefaultBuildableComponentResolveResult; +import org.gradle.internal.resource.local.FileResourceRepository; +import org.gradle.internal.resource.local.LocallyAvailableExternalResource; + +import java.io.File; + +/** + * ParserSettings that control the scope of searches carried out during parsing. + * If the parser asks for a resolver for the currently resolving revision, the resolver scope is only the repository where the module was resolved. + * If the parser asks for a resolver for a different revision, the resolver scope is all repositories. + */ +public class ExternalResourceResolverDescriptorParseContext implements DescriptorParseContext { + private final ComponentResolvers mainResolvers; + private final FileResourceRepository fileResourceRepository; + private final MutableModuleSources sources = new MutableModuleSources(); + private final ChecksumService checksumService; + + public ExternalResourceResolverDescriptorParseContext(ComponentResolvers mainResolvers, FileResourceRepository fileResourceRepository, ChecksumService checksumService) { + this.mainResolvers = mainResolvers; + this.fileResourceRepository = fileResourceRepository; + this.checksumService = checksumService; + } + + @Override + public LocallyAvailableExternalResource getMetaDataArtifact(ModuleComponentIdentifier moduleComponentIdentifier, ArtifactType artifactType) { + return resolveMetaDataArtifactFile(moduleComponentIdentifier, mainResolvers.getComponentResolver(), mainResolvers.getArtifactResolver(), artifactType); + } + + @Override + public LocallyAvailableExternalResource getMetaDataArtifact(ModuleDependencyMetadata dependencyMetadata, VersionSelector acceptor, ArtifactType artifactType) { + BuildableComponentIdResolveResult idResolveResult = new DefaultBuildableComponentIdResolveResult(); + mainResolvers.getComponentIdResolver().resolve(dependencyMetadata, acceptor, null, idResolveResult); + return getMetaDataArtifact((ModuleComponentIdentifier) idResolveResult.getId(), artifactType); + } + + private LocallyAvailableExternalResource resolveMetaDataArtifactFile(ModuleComponentIdentifier moduleComponentIdentifier, ComponentMetaDataResolver componentResolver, + ArtifactResolver artifactResolver, ArtifactType artifactType) { + BuildableComponentResolveResult moduleVersionResolveResult = new DefaultBuildableComponentResolveResult(); + componentResolver.resolve(moduleComponentIdentifier, DefaultComponentOverrideMetadata.EMPTY, moduleVersionResolveResult); + + BuildableArtifactSetResolveResult moduleArtifactsResolveResult = new DefaultBuildableArtifactSetResolveResult(); + artifactResolver.resolveArtifactsWithType(moduleVersionResolveResult.getMetadata(), artifactType, moduleArtifactsResolveResult); + + BuildableArtifactResolveResult artifactResolveResult = new DefaultBuildableArtifactResolveResult(); + ComponentArtifactMetadata artifactMetaData = moduleArtifactsResolveResult.getResult().iterator().next(); + artifactResolver.resolveArtifact(artifactMetaData, moduleVersionResolveResult.getMetadata().getSources(), artifactResolveResult); + File file = artifactResolveResult.getResult(); + LocallyAvailableExternalResource resource = fileResourceRepository.resource(file); + ComponentArtifactIdentifier id = artifactMetaData.getId(); + if (id instanceof ModuleComponentArtifactIdentifier) { + sources.add(new DefaultMetadataFileSource((ModuleComponentArtifactIdentifier) id, file, checksumService.sha1(file))); + } + return resource; + } + + public void appendSources(MutableModuleSources sources) { + this.sources.withSources(sources::add); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/repositories/resolver/MavenUniqueSnapshotComponentIdentifier.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/repositories/resolver/MavenUniqueSnapshotComponentIdentifier.java new file mode 100644 index 0000000..f4bb092 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/repositories/resolver/MavenUniqueSnapshotComponentIdentifier.java @@ -0,0 +1,71 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.repositories.resolver; + +import org.gradle.api.artifacts.ModuleIdentifier; +import org.gradle.api.artifacts.component.ModuleComponentIdentifier; +import org.gradle.internal.component.external.model.DefaultModuleComponentIdentifier; + +/** + * A component identifier for a Maven unique snapshot module. + */ +public class MavenUniqueSnapshotComponentIdentifier extends DefaultModuleComponentIdentifier { + private final String timestamp; + private final int hashCode; + + public MavenUniqueSnapshotComponentIdentifier(ModuleIdentifier module, String version, String timestamp) { + super(module, version); + this.timestamp = timestamp; + this.hashCode = super.hashCode() + timestamp.hashCode(); + } + + public MavenUniqueSnapshotComponentIdentifier(ModuleComponentIdentifier baseIdentifier, String timestamp) { + super(baseIdentifier.getModuleIdentifier(), baseIdentifier.getVersion()); + this.timestamp = timestamp; + this.hashCode = super.hashCode() + timestamp.hashCode(); + } + + @Override + public boolean equals(Object o) { + return super.equals(o) && ((MavenUniqueSnapshotComponentIdentifier) o).timestamp.equals(timestamp); + } + + @Override + public int hashCode() { + return hashCode; + } + + @Override + public String getDisplayName() { + return String.format("%s:%s:%s:%s", getGroup(), getModule(), getSnapshotVersion(), timestamp); + } + + public String getTimestamp() { + return timestamp; + } + + public String getSnapshotVersion() { + return getVersion().replace(timestamp, "SNAPSHOT"); + } + + public ModuleComponentIdentifier getSnapshotComponent() { + return DefaultModuleComponentIdentifier.newId(getModuleIdentifier(), getSnapshotVersion()); + } + + public String getTimestampedVersion() { + return getVersion().replace("SNAPSHOT", timestamp); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/transform/CachingTransformationWorkspaceProvider.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/transform/CachingTransformationWorkspaceProvider.java new file mode 100644 index 0000000..7a39e4b --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/transform/CachingTransformationWorkspaceProvider.java @@ -0,0 +1,29 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.transform; + +import com.google.common.collect.ImmutableList; +import org.gradle.internal.Try; + +import javax.annotation.Nullable; +import java.io.File; + +public interface CachingTransformationWorkspaceProvider extends TransformationWorkspaceProvider { + + @Nullable + Try> getCachedResult(TransformationWorkspaceIdentity identity); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/verification/verifier/MissingChecksums.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/verification/verifier/MissingChecksums.java new file mode 100644 index 0000000..b8db167 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/verification/verifier/MissingChecksums.java @@ -0,0 +1,31 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.verification.verifier; + +import org.gradle.internal.logging.text.TreeFormatter; + +import java.io.File; + +public class MissingChecksums extends AbstractVerificationFailure { + public MissingChecksums(File file) { + super(file); + } + + @Override + public void explainTo(TreeFormatter formatter) { + formatter.append("checksum is missing from verification metadata."); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/verification/verifier/OnlyIgnoredKeys.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/verification/verifier/OnlyIgnoredKeys.java new file mode 100644 index 0000000..8642829 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/api/internal/artifacts/verification/verifier/OnlyIgnoredKeys.java @@ -0,0 +1,36 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.verification.verifier; + +import org.gradle.internal.logging.text.TreeFormatter; + +import java.io.File; + +public class OnlyIgnoredKeys extends AbstractVerificationFailure { + public OnlyIgnoredKeys(File file) { + super(file); + } + + @Override + public boolean isFatal() { + return false; + } + + @Override + public void explainTo(TreeFormatter formatter) { + formatter.append("artifact was signed but all keys were ignored"); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/internal/resolve/resolver/OriginArtifactSelector.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/internal/resolve/resolver/OriginArtifactSelector.java new file mode 100644 index 0000000..e295d62 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/dependency-management/org/gradle/internal/resolve/resolver/OriginArtifactSelector.java @@ -0,0 +1,34 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.resolve.resolver; + +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.ArtifactSet; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.specs.ExcludeSpec; +import org.gradle.api.internal.artifacts.type.ArtifactTypeRegistry; +import org.gradle.api.internal.attributes.ImmutableAttributes; +import org.gradle.internal.component.model.ComponentResolveMetadata; +import org.gradle.internal.component.model.ConfigurationMetadata; + +import javax.annotation.Nullable; + +public interface OriginArtifactSelector { + /** + * Creates a set that will resolve the artifacts of the given configuration, minus those artifacts that are excluded. + */ + @Nullable + ArtifactSet resolveArtifacts(ComponentResolveMetadata component, ConfigurationMetadata configuration, ArtifactTypeRegistry artifactTypeRegistry, ExcludeSpec exclusions, ImmutableAttributes overriddenAttributes); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/diagnostics/org/gradle/api/reporting/components/internal/TrackingReportRenderer.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/diagnostics/org/gradle/api/reporting/components/internal/TrackingReportRenderer.java new file mode 100644 index 0000000..c114882 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/diagnostics/org/gradle/api/reporting/components/internal/TrackingReportRenderer.java @@ -0,0 +1,43 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.reporting.components.internal; + +import com.google.common.collect.Sets; +import org.gradle.reporting.ReportRenderer; + +import java.io.IOException; +import java.util.Set; + +public class TrackingReportRenderer extends ReportRenderer { + private final Set items = Sets.newHashSet(); + private final ReportRenderer delegate; + + public TrackingReportRenderer(ReportRenderer delegate) { + this.delegate = delegate; + } + + public Set getItems() { + return items; + } + + @Override + public void render(T model, E output) throws IOException { + if (items.add(model)) { + delegate.render(model, output); + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/diagnostics/org/gradle/api/tasks/diagnostics/internal/insight/DependencyInsightReporter.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/diagnostics/org/gradle/api/tasks/diagnostics/internal/insight/DependencyInsightReporter.java new file mode 100644 index 0000000..0075ecc --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/diagnostics/org/gradle/api/tasks/diagnostics/internal/insight/DependencyInsightReporter.java @@ -0,0 +1,211 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.tasks.diagnostics.internal.insight; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import org.gradle.api.Transformer; +import org.gradle.api.artifacts.component.ComponentIdentifier; +import org.gradle.api.artifacts.result.ComponentSelectionCause; +import org.gradle.api.artifacts.result.ComponentSelectionDescriptor; +import org.gradle.api.artifacts.result.ComponentSelectionReason; +import org.gradle.api.artifacts.result.DependencyResult; +import org.gradle.api.artifacts.result.ResolvedDependencyResult; +import org.gradle.api.artifacts.result.ResolvedVariantResult; +import org.gradle.api.artifacts.result.UnresolvedDependencyResult; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionComparator; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionParser; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionSelectorScheme; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.ComponentSelectionDescriptorInternal; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.ComponentSelectionReasonInternal; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.ComponentSelectionReasons; +import org.gradle.api.tasks.diagnostics.internal.graph.nodes.DefaultSection; +import org.gradle.api.tasks.diagnostics.internal.graph.nodes.DependencyEdge; +import org.gradle.api.tasks.diagnostics.internal.graph.nodes.DependencyReportHeader; +import org.gradle.api.tasks.diagnostics.internal.graph.nodes.RenderableDependency; +import org.gradle.api.tasks.diagnostics.internal.graph.nodes.RequestedVersion; +import org.gradle.api.tasks.diagnostics.internal.graph.nodes.ResolvedDependencyEdge; +import org.gradle.api.tasks.diagnostics.internal.graph.nodes.Section; +import org.gradle.api.tasks.diagnostics.internal.graph.nodes.UnresolvedDependencyEdge; +import org.gradle.internal.logging.text.TreeFormatter; +import org.gradle.util.CollectionUtils; + +import java.util.Collection; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; + +public class DependencyInsightReporter { + + private final VersionSelectorScheme versionSelectorScheme; + private final VersionComparator versionComparator; + private final VersionParser versionParser; + + private static final Transformer TO_EDGES = result -> { + if (result instanceof UnresolvedDependencyResult) { + return new UnresolvedDependencyEdge((UnresolvedDependencyResult) result); + } else { + return new ResolvedDependencyEdge((ResolvedDependencyResult) result); + } + }; + + public DependencyInsightReporter(VersionSelectorScheme versionSelectorScheme, VersionComparator versionComparator, VersionParser versionParser) { + this.versionSelectorScheme = versionSelectorScheme; + this.versionComparator = versionComparator; + this.versionParser = versionParser; + } + + public Collection convertToRenderableItems(Collection dependencies, boolean singlePathToDependency) { + LinkedList out = new LinkedList<>(); + Collection sortedEdges = toDependencyEdges(dependencies); + + //remember if module id was annotated + Set annotated = Sets.newHashSet(); + Set alreadyReportedErrors = Sets.newHashSet(); + RequestedVersion current = null; + for (DependencyEdge dependency : sortedEdges) { + //add description only to the first module + if (annotated.add(dependency.getActual())) { + DependencyReportHeader header = createHeaderForDependency(dependency, alreadyReportedErrors); + out.add(header); + current = newRequestedVersion(out, dependency); + } else if (!current.getRequested().equals(dependency.getRequested())) { + current = newRequestedVersion(out, dependency); + } + if (!singlePathToDependency || current.getChildren().isEmpty()) { + current.addChild(dependency); + } + } + + return out; + } + + private DependencyReportHeader createHeaderForDependency(DependencyEdge dependency, Set alreadyReportedErrors) { + ComponentSelectionReasonInternal reason = (ComponentSelectionReasonInternal) dependency.getReason(); + Section selectionReasonsSection = buildSelectionReasonSection(reason); + List
reasonSections = selectionReasonsSection.getChildren(); + + String reasonShortDescription; + List
extraDetails = Lists.newArrayList(); + + boolean displayFullReasonSection = reason.hasCustomDescriptions() || reasonSections.size() > 1; + if (displayFullReasonSection) { + reasonShortDescription = null; + extraDetails.add(selectionReasonsSection); + } else { + reasonShortDescription = reasonSections.isEmpty() ? null : reasonSections.get(0).getDescription().toLowerCase(); + } + + buildFailureSection(dependency, alreadyReportedErrors, extraDetails); + List selectedVariants = dependency.getSelectedVariants(); + return new DependencyReportHeader(dependency, reasonShortDescription, selectedVariants, extraDetails); + } + + private RequestedVersion newRequestedVersion(LinkedList out, DependencyEdge dependency) { + RequestedVersion current; + current = new RequestedVersion(dependency.getRequested(), dependency.getActual(), dependency.isResolvable()); + out.add(current); + return current; + } + + private Collection toDependencyEdges(Collection dependencies) { + List edges = CollectionUtils.collect(dependencies, TO_EDGES); + return DependencyResultSorter.sort(edges, versionSelectorScheme, versionComparator, versionParser); + } + + private static void buildFailureSection(DependencyEdge edge, Set alreadyReportedErrors, List
sections) { + if (edge instanceof UnresolvedDependencyEdge) { + UnresolvedDependencyEdge unresolved = (UnresolvedDependencyEdge) edge; + Throwable failure = unresolved.getFailure(); + DefaultSection failures = new DefaultSection("Failures"); + String errorMessage = collectErrorMessages(failure, alreadyReportedErrors); + failures.addChild(new DefaultSection(errorMessage)); + sections.add(failures); + } + } + + private static String collectErrorMessages(Throwable failure, Set alreadyReportedErrors) { + TreeFormatter formatter = new TreeFormatter(); + collectErrorMessages(failure, formatter, alreadyReportedErrors); + return formatter.toString(); + } + + private static void collectErrorMessages(Throwable failure, TreeFormatter formatter, Set alreadyReportedErrors) { + if (alreadyReportedErrors.add(failure)) { + formatter.node(failure.getMessage()); + Throwable cause = failure.getCause(); + if (alreadyReportedErrors.contains(cause)) { + formatter.append(" (already reported)"); + } + if (cause != null && cause != failure) { + formatter.startChildren(); + collectErrorMessages(cause, formatter, alreadyReportedErrors); + formatter.endChildren(); + } + } + } + + private static DefaultSection buildSelectionReasonSection(ComponentSelectionReason reason) { + DefaultSection selectionReasons = new DefaultSection("Selection reasons"); + for (ComponentSelectionDescriptor entry : reason.getDescriptions()) { + ComponentSelectionDescriptorInternal descriptor = (ComponentSelectionDescriptorInternal) entry; + boolean hasCustomDescription = descriptor.hasCustomDescription(); + + if (ComponentSelectionReasons.isCauseExpected(descriptor) && !hasCustomDescription) { + // Don't render empty 'requested' reason + continue; + } + + Section item = new DefaultSection(render(descriptor)); + selectionReasons.addChild(item); + } + return selectionReasons; + } + + private static String render(ComponentSelectionDescriptor descriptor) { + if (((ComponentSelectionDescriptorInternal) descriptor).hasCustomDescription()) { + return prettyCause(descriptor.getCause()) + " : " + descriptor.getDescription(); + } + return prettyCause(descriptor.getCause()); + } + + private static String prettyCause(ComponentSelectionCause cause) { + switch (cause) { + case ROOT: + return "Root component"; + case REQUESTED: + return "Was requested"; + case SELECTED_BY_RULE: + return "Selected by rule"; + case FORCED: + return "Forced"; + case CONFLICT_RESOLUTION: + return "By conflict resolution"; + case COMPOSITE_BUILD: + return "By composite build"; + case REJECTION: + return "Rejection"; + case CONSTRAINT: + return "By constraint"; + case BY_ANCESTOR: + return "By ancestor"; + default: + assert false : "Missing an enum value " + cause; + return cause.getDefaultReason(); + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/enterprise/org/gradle/internal/enterprise/impl/legacy/LegacyGradleEnterprisePluginCheckInService.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/enterprise/org/gradle/internal/enterprise/impl/legacy/LegacyGradleEnterprisePluginCheckInService.java new file mode 100644 index 0000000..1b35c20 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/enterprise/org/gradle/internal/enterprise/impl/legacy/LegacyGradleEnterprisePluginCheckInService.java @@ -0,0 +1,214 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.enterprise.impl.legacy; + +import org.gradle.StartParameter; +import org.gradle.api.internal.BuildType; +import org.gradle.api.internal.GradleInternal; +import org.gradle.internal.enterprise.core.GradleEnterprisePluginAdapter; +import org.gradle.internal.enterprise.core.GradleEnterprisePluginManager; +import org.gradle.internal.scan.config.BuildScanConfig; +import org.gradle.internal.scan.config.BuildScanConfigProvider; +import org.gradle.internal.scan.config.BuildScanPluginMetadata; +import org.gradle.internal.scan.eob.BuildScanEndOfBuildNotifier; +import org.gradle.util.VersionNumber; + +import javax.annotation.Nullable; +import javax.inject.Inject; + +public class LegacyGradleEnterprisePluginCheckInService implements BuildScanConfigProvider, BuildScanEndOfBuildNotifier { + + public static final String FIRST_GRADLE_ENTERPRISE_PLUGIN_VERSION_DISPLAY = "3.0"; + public static final VersionNumber FIRST_GRADLE_ENTERPRISE_PLUGIN_VERSION = VersionNumber.parse(FIRST_GRADLE_ENTERPRISE_PLUGIN_VERSION_DISPLAY); + + // Used just to test the mechanism + public static final String UNSUPPORTED_TOGGLE = "org.gradle.internal.unsupported-scan-plugin"; + public static final String UNSUPPORTED_TOGGLE_MESSAGE = "Build scan support disabled by secret toggle"; + + private static final VersionNumber FIRST_VERSION_AWARE_OF_UNSUPPORTED = VersionNumber.parse("1.11"); + + private final GradleInternal gradle; + private final GradleEnterprisePluginManager manager; + private final BuildType buildType; + + private BuildScanEndOfBuildNotifier.Listener listener; + + @Inject + public LegacyGradleEnterprisePluginCheckInService( + GradleInternal gradle, + GradleEnterprisePluginManager manager, + BuildType buildType + ) { + this.gradle = gradle; + this.manager = manager; + this.buildType = buildType; + } + + @Nullable + private String unsupportedReason(VersionNumber pluginVersion) { + if (Boolean.getBoolean(UNSUPPORTED_TOGGLE)) { + return UNSUPPORTED_TOGGLE_MESSAGE; + } else if (gradle.getStartParameter().isConfigurationCache()) { + return "Build scans have been disabled due to incompatibility between your Gradle Enterprise plugin version (" + pluginVersion.toString() + ") and configuration caching. " + + "Please use Gradle Enterprise plugin version 3.4 or later for compatibility with configuration caching."; + } else { + return null; + } + } + + @Override + public BuildScanConfig collect(BuildScanPluginMetadata pluginMetadata) { + if (manager.isPresent()) { + throw new IllegalStateException("Configuration has already been collected."); + } + + VersionNumber pluginVersion = VersionNumber.parse(pluginMetadata.getVersion()).getBaseVersion(); + if (pluginVersion.compareTo(FIRST_GRADLE_ENTERPRISE_PLUGIN_VERSION) < 0) { + throw new UnsupportedBuildScanPluginVersionException(GradleEnterprisePluginManager.OLD_SCAN_PLUGIN_VERSION_MESSAGE); + } + + String unsupportedReason = unsupportedReason(pluginVersion); + if (unsupportedReason == null) { + manager.registerAdapter(new Adapter()); + } else { + manager.unsupported(); + if (!isPluginAwareOfUnsupported(pluginVersion)) { + throw new UnsupportedBuildScanPluginVersionException(unsupportedReason); + } + } + + return new Config( + Requestedness.from(gradle), + new Attributes(buildType), + unsupportedReason + ); + } + + @Override + public void notify(BuildScanEndOfBuildNotifier.Listener listener) { + if (this.listener != null) { + throw new IllegalStateException("listener already set to " + this.listener); + } + this.listener = listener; + } + + private boolean isPluginAwareOfUnsupported(VersionNumber pluginVersion) { + return pluginVersion.compareTo(FIRST_VERSION_AWARE_OF_UNSUPPORTED) >= 0; + } + + private static class Config implements BuildScanConfig { + private final Requestedness requestedness; + private final String unsupported; + private final Attributes attributes; + + public Config(Requestedness requestedness, Attributes attributes, String unsupported) { + this.requestedness = requestedness; + this.unsupported = unsupported; + this.attributes = attributes; + } + + @Override + public boolean isEnabled() { + return requestedness.enabled; + } + + @Override + public boolean isDisabled() { + return requestedness.disabled; + } + + @Override + public String getUnsupportedMessage() { + return unsupported; + } + + @Override + public Attributes getAttributes() { + return attributes; + } + } + + private enum Requestedness { + + DEFAULTED(false, false), + ENABLED(true, false), + DISABLED(false, true); + + private final boolean enabled; + private final boolean disabled; + + Requestedness(boolean enabled, boolean disabled) { + this.enabled = enabled; + this.disabled = disabled; + } + + private static Requestedness from(GradleInternal gradle) { + StartParameter startParameter = gradle.getStartParameter(); + if (startParameter.isNoBuildScan()) { + return DISABLED; + } else if (startParameter.isBuildScan()) { + return ENABLED; + } else { + return DEFAULTED; + } + } + } + + private static class Attributes implements BuildScanConfig.Attributes { + private final BuildType buildType; + + public Attributes(BuildType buildType) { + this.buildType = buildType; + } + + @Override + public boolean isRootProjectHasVcsMappings() { + return false; + } + + @Override + public boolean isTaskExecutingBuild() { + boolean forceTaskExecutingBuild = System.getProperty("org.gradle.internal.ide.scan") != null; + return forceTaskExecutingBuild || buildType == BuildType.TASKS; + } + } + + private class Adapter implements GradleEnterprisePluginAdapter { + @Override + public boolean shouldSaveToConfigurationCache() { + return false; + } + + @Override + public void onLoadFromConfigurationCache() { + throw new UnsupportedOperationException(); + } + + @Override + public void buildFinished(@Nullable Throwable buildFailure) { + if (listener != null) { + listener.execute(new BuildResult() { + @Nullable + @Override + public Throwable getFailure() { + return buildFailure; + } + }); + } + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/execution/org/gradle/internal/execution/history/changes/AbstractFingerprintCompareStrategy.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/execution/org/gradle/internal/execution/history/changes/AbstractFingerprintCompareStrategy.java new file mode 100644 index 0000000..ef71e7e --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/execution/org/gradle/internal/execution/history/changes/AbstractFingerprintCompareStrategy.java @@ -0,0 +1,128 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.execution.history.changes; + +import com.google.common.annotations.VisibleForTesting; +import com.google.common.collect.Iterables; +import org.gradle.internal.fingerprint.FileCollectionFingerprint; +import org.gradle.internal.fingerprint.FileSystemLocationFingerprint; +import org.gradle.internal.hash.HashCode; + +import javax.annotation.Nullable; +import java.util.Map; + +public abstract class AbstractFingerprintCompareStrategy implements FingerprintCompareStrategy { + + @Override + public boolean visitChangesSince(FileCollectionFingerprint current, FileCollectionFingerprint previous, String propertyTitle, ChangeVisitor visitor) { + if (hasSameRootHashes(current, previous)) { + return true; + } + return visitChangesSince(current.getFingerprints(), previous.getFingerprints(), propertyTitle, visitor); + } + + private boolean hasSameRootHashes(FileCollectionFingerprint current, FileCollectionFingerprint previous) { + return Iterables.elementsEqual(current.getRootHashes().entries(), previous.getRootHashes().entries()); + } + + private boolean visitChangesSince(Map current, Map previous, String propertyTitle, ChangeVisitor visitor) { + // Handle trivial cases with 0 or 1 elements in both current and previous + Boolean trivialResult = compareTrivialFingerprints(visitor, current, previous, propertyTitle); + if (trivialResult != null) { + return trivialResult; + } + return doVisitChangesSince(visitor, current, previous, propertyTitle); + } + + protected abstract boolean doVisitChangesSince(ChangeVisitor visitor, Map current, Map previous, String propertyTitle); + + /** + * Compares collection fingerprints if one of current or previous are empty or both have at most one element. + * + * @return {@code null} if the comparison is not trivial. + * For a trivial comparision returns whether the {@link ChangeVisitor} is looking for further changes. + * See {@link ChangeVisitor#visitChange(Change)}. + */ + @VisibleForTesting + @Nullable + static Boolean compareTrivialFingerprints(ChangeVisitor visitor, Map current, Map previous, String propertyTitle) { + switch (current.size()) { + case 0: + switch (previous.size()) { + case 0: + return true; + default: + for (Map.Entry entry : previous.entrySet()) { + Change change = DefaultFileChange.removed(entry.getKey(), propertyTitle, entry.getValue().getType(), entry.getValue().getNormalizedPath()); + if (!visitor.visitChange(change)) { + return false; + } + } + return true; + } + + case 1: + switch (previous.size()) { + case 0: + return reportAllAdded(visitor, current, propertyTitle); + case 1: + Map.Entry previousEntry = previous.entrySet().iterator().next(); + Map.Entry currentEntry = current.entrySet().iterator().next(); + return compareTrivialFingerprintEntries(visitor, currentEntry, previousEntry, propertyTitle); + default: + return null; + } + + default: + if (!previous.isEmpty()) { + return null; + } + return reportAllAdded(visitor, current, propertyTitle); + } + } + + private static boolean reportAllAdded(ChangeVisitor visitor, Map current, String propertyTitle) { + for (Map.Entry entry : current.entrySet()) { + Change change = DefaultFileChange.added(entry.getKey(), propertyTitle, entry.getValue().getType(), entry.getValue().getNormalizedPath()); + if (!visitor.visitChange(change)) { + return false; + } + } + return true; + } + + private static boolean compareTrivialFingerprintEntries(ChangeVisitor visitor, Map.Entry currentEntry, Map.Entry previousEntry, String propertyTitle) { + FileSystemLocationFingerprint previousFingerprint = previousEntry.getValue(); + FileSystemLocationFingerprint currentFingerprint = currentEntry.getValue(); + if (currentFingerprint.getNormalizedPath().equals(previousFingerprint.getNormalizedPath())) { + HashCode previousContent = previousFingerprint.getNormalizedContentHash(); + HashCode currentContent = currentFingerprint.getNormalizedContentHash(); + if (!currentContent.equals(previousContent)) { + String path = currentEntry.getKey(); + Change change = DefaultFileChange.modified(path, propertyTitle, previousFingerprint.getType(), currentFingerprint.getType(), currentFingerprint.getNormalizedPath()); + return visitor.visitChange(change); + } + return true; + } else { + String previousPath = previousEntry.getKey(); + Change remove = DefaultFileChange.removed(previousPath, propertyTitle, previousFingerprint.getType(), previousFingerprint.getNormalizedPath()); + String currentPath = currentEntry.getKey(); + Change add = DefaultFileChange.added(currentPath, propertyTitle, currentFingerprint.getType(), currentFingerprint.getNormalizedPath()); + return visitor.visitChange(remove) && visitor.visitChange(add); + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/execution/org/gradle/internal/execution/impl/package-info.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/execution/org/gradle/internal/execution/impl/package-info.java new file mode 100644 index 0000000..5abc84e --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/execution/org/gradle/internal/execution/impl/package-info.java @@ -0,0 +1,19 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +@NonNullApi +package org.gradle.internal.execution.impl; + +import org.gradle.api.NonNullApi; diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/file-collections/org/gradle/api/internal/file/AbstractFileCollection.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/file-collections/org/gradle/api/internal/file/AbstractFileCollection.java new file mode 100644 index 0000000..ff50641 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/file-collections/org/gradle/api/internal/file/AbstractFileCollection.java @@ -0,0 +1,395 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.file; + +import com.google.common.collect.ImmutableSet; +import groovy.lang.Closure; +import org.gradle.api.Action; +import org.gradle.api.Task; +import org.gradle.api.file.DirectoryTree; +import org.gradle.api.file.FileCollection; +import org.gradle.api.file.FileSystemLocation; +import org.gradle.api.file.FileVisitDetails; +import org.gradle.api.file.FileVisitor; +import org.gradle.api.internal.file.collections.DirectoryFileTree; +import org.gradle.api.internal.file.collections.FileBackedDirectoryFileTree; +import org.gradle.api.internal.file.collections.FileSystemMirroringFileTree; +import org.gradle.api.internal.provider.AbstractProviderWithValue; +import org.gradle.api.internal.tasks.AbstractTaskDependency; +import org.gradle.api.internal.tasks.TaskDependencyResolveContext; +import org.gradle.api.provider.Provider; +import org.gradle.api.specs.Spec; +import org.gradle.api.specs.Specs; +import org.gradle.api.tasks.TaskDependency; +import org.gradle.api.tasks.util.PatternSet; +import org.gradle.api.tasks.util.internal.PatternSets; +import org.gradle.internal.Cast; +import org.gradle.internal.Factory; +import org.gradle.internal.MutableBoolean; +import org.gradle.internal.logging.text.TreeFormatter; +import org.gradle.util.GUtil; + +import java.io.File; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import java.util.function.Supplier; + +public abstract class AbstractFileCollection implements FileCollectionInternal { + protected final Factory patternSetFactory; + + protected AbstractFileCollection(Factory patternSetFactory) { + this.patternSetFactory = patternSetFactory; + } + + @SuppressWarnings("deprecation") + public AbstractFileCollection() { + this.patternSetFactory = PatternSets.getNonCachingPatternSetFactory(); + } + + /** + * Returns the display name of this file collection. Used in log and error messages. + * + * @return the display name + */ + public abstract String getDisplayName(); + + @Override + public String toString() { + return getDisplayName(); + } + + /** + * This is final - override {@link #appendContents(TreeFormatter)} instead. + */ + @Override + public final TreeFormatter describeContents(TreeFormatter formatter) { + formatter.node("collection type: ").appendType(getClass()).append(" (id: ").append(String.valueOf(System.identityHashCode(this))).append(")"); + formatter.startChildren(); + appendContents(formatter); + formatter.endChildren(); + return formatter; + } + + protected void appendContents(TreeFormatter formatter) { + } + + // This is final - override {@link TaskDependencyContainer#visitDependencies} to provide the dependencies instead. + @Override + public final TaskDependency getBuildDependencies() { + return new AbstractTaskDependency() { + @Override + public String toString() { + return "Dependencies of " + getDisplayName(); + } + + @Override + public void visitDependencies(TaskDependencyResolveContext context) { + context.add(AbstractFileCollection.this); + } + }; + } + + @Override + public void visitDependencies(TaskDependencyResolveContext context) { + // Assume no dependencies + } + + @Override + public FileCollectionInternal replace(FileCollectionInternal original, Supplier supplier) { + if (original == this) { + return supplier.get(); + } + return this; + } + + @Override + public Set getFiles() { + // Use a JVM type here, rather than a Guava type, as some plugins serialize this return value and cannot deserialize the result + Set files = new LinkedHashSet<>(); + visitContents(new FileCollectionStructureVisitor() { + @Override + public void visitCollection(Source source, Iterable contents) { + for (File content : contents) { + files.add(content); + } + } + + private void addTreeContents(FileTreeInternal fileTree) { + // TODO - add some convenient way to visit the files of the tree without collecting them into a set + files.addAll(fileTree.getFiles()); + } + + @Override + public void visitGenericFileTree(FileTreeInternal fileTree, FileSystemMirroringFileTree sourceTree) { + addTreeContents(fileTree); + } + + @Override + public void visitFileTree(File root, PatternSet patterns, FileTreeInternal fileTree) { + addTreeContents(fileTree); + } + + @Override + public void visitFileTreeBackedByFile(File file, FileTreeInternal fileTree, FileSystemMirroringFileTree sourceTree) { + addTreeContents(fileTree); + } + }); + return files; + } + + @Override + public File getSingleFile() throws IllegalStateException { + Iterator iterator = iterator(); + if (!iterator.hasNext()) { + throw new IllegalStateException(String.format("Expected %s to contain exactly one file, however, it contains no files.", getDisplayName())); + } + File singleFile = iterator.next(); + if (iterator.hasNext()) { + throw new IllegalStateException(String.format("Expected %s to contain exactly one file, however, it contains more than one file.", getDisplayName())); + } + return singleFile; + } + + @Override + public Iterator iterator() { + return getFiles().iterator(); + } + + @Override + public String getAsPath() { + return GUtil.asPath(this); + } + + @Override + public boolean contains(File file) { + return getFiles().contains(file); + } + + @Override + public FileCollection plus(FileCollection collection) { + return new UnionFileCollection(this, (FileCollectionInternal) collection); + } + + @Override + public Provider> getElements() { + return new ElementsProvider(this); + } + + @Override + public FileCollection minus(final FileCollection collection) { + return new SubtractingFileCollection(this, collection); + } + + @Override + public void addToAntBuilder(Object builder, String nodeName, AntType type) { + if (type == AntType.ResourceCollection) { + addAsResourceCollection(builder, nodeName); + } else if (type == AntType.FileSet) { + addAsFileSet(builder, nodeName); + } else { + addAsMatchingTask(builder, nodeName); + } + } + + protected void addAsMatchingTask(Object builder, String nodeName) { + new AntFileCollectionMatchingTaskBuilder(getAsFileTrees()).addToAntBuilder(builder, nodeName); + } + + protected void addAsFileSet(Object builder, String nodeName) { + new AntFileSetBuilder(getAsFileTrees()).addToAntBuilder(builder, nodeName); + } + + protected void addAsResourceCollection(Object builder, String nodeName) { + new AntFileCollectionBuilder(this).addToAntBuilder(builder, nodeName); + } + + /** + * Returns this collection as a set of {@link DirectoryFileTree} instance. These are used to map to Ant types. + */ + protected Collection getAsFileTrees() { + List fileTrees = new ArrayList<>(); + visitStructure(new FileCollectionStructureVisitor() { + @Override + public void visitCollection(Source source, Iterable contents) { + for (File file : contents) { + if (file.isFile()) { + fileTrees.add(new FileBackedDirectoryFileTree(file)); + } + } + } + + @Override + public void visitFileTree(File root, PatternSet patterns, FileTreeInternal fileTree) { + if (root.isFile()) { + fileTrees.add(new FileBackedDirectoryFileTree(root)); + } else if (root.isDirectory()) { + fileTrees.add(new DirectoryTree() { + @Override + public File getDir() { + return root; + } + + @Override + public PatternSet getPatterns() { + return patterns; + } + }); + } + } + + @Override + public void visitGenericFileTree(FileTreeInternal fileTree, FileSystemMirroringFileTree sourceTree) { + // Visit the contents of the tree to generate the tree + if (visitAll(sourceTree)) { + fileTrees.add(sourceTree.getMirror()); + } + } + + @Override + public void visitFileTreeBackedByFile(File file, FileTreeInternal fileTree, FileSystemMirroringFileTree sourceTree) { + visitGenericFileTree(fileTree, sourceTree); + } + }); + return fileTrees; + } + + /** + * Visits all the files of the given tree. + */ + protected static boolean visitAll(FileSystemMirroringFileTree tree) { + final MutableBoolean hasContent = new MutableBoolean(); + tree.visit(new FileVisitor() { + @Override + public void visitDir(FileVisitDetails dirDetails) { + dirDetails.getFile(); + hasContent.set(true); + } + + @Override + public void visitFile(FileVisitDetails fileDetails) { + fileDetails.getFile(); + hasContent.set(true); + } + }); + return hasContent.get(); + } + + @Override + public Object addToAntBuilder(Object node, String childNodeName) { + addToAntBuilder(node, childNodeName, AntType.ResourceCollection); + return this; + } + + @Override + public boolean isEmpty() { + return getFiles().isEmpty(); + } + + @Override + public FileTreeInternal getAsFileTree() { + return new FileCollectionBackedFileTree(patternSetFactory, this); + } + + @Override + public FileCollection filter(Closure filterClosure) { + return filter(Specs.convertClosureToSpec(filterClosure)); + } + + @Override + public FileCollectionInternal filter(final Spec filterSpec) { + return new FilteredFileCollection(this, filterSpec); + } + + /** + * This is final - override {@link #visitContents(FileCollectionStructureVisitor)} instead to provide the contents. + */ + @Override + public final void visitStructure(FileCollectionStructureVisitor visitor) { + if (visitor.startVisit(OTHER, this)) { + visitContents(visitor); + } + } + + protected void visitContents(FileCollectionStructureVisitor visitor) { + visitor.visitCollection(OTHER, this); + } + + private static class ElementsProvider extends AbstractProviderWithValue> { + private final AbstractFileCollection collection; + + public ElementsProvider(AbstractFileCollection collection) { + this.collection = collection; + } + + @Override + public Class> getType() { + return Cast.uncheckedCast(Set.class); + } + + @Override + public ValueProducer getProducer() { + return new ValueProducer() { + @Override + public boolean isKnown() { + return true; + } + + @Override + public boolean isProducesDifferentValueOverTime() { + return false; + } + + @Override + public void visitProducerTasks(Action visitor) { + for (Task dependency : collection.getBuildDependencies().getDependencies(null)) { + visitor.execute(dependency); + } + } + }; + } + + @Override + public ExecutionTimeValue> calculateExecutionTimeValue() { + ExecutionTimeValue> value = ExecutionTimeValue.fixedValue(get()); + if (contentsAreBuiltByTask()) { + return value.withChangingContent(); + } else { + return value; + } + } + + private boolean contentsAreBuiltByTask() { + return !collection.getBuildDependencies().getDependencies(null).isEmpty(); + } + + @Override + protected Value> calculateOwnValue(ValueConsumer consumer) { + // TODO - visit the contents of this collection instead. + // This is just a super simple implementation for now + Set files = collection.getFiles(); + ImmutableSet.Builder builder = ImmutableSet.builderWithExpectedSize(files.size()); + for (File file : files) { + builder.add(new DefaultFileSystemLocation(file)); + } + return Value.of(builder.build()); + } + } + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/file-collections/org/gradle/api/internal/file/FileCollectionFactory.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/file-collections/org/gradle/api/internal/file/FileCollectionFactory.java new file mode 100644 index 0000000..c21c497 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/file-collections/org/gradle/api/internal/file/FileCollectionFactory.java @@ -0,0 +1,137 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.file; + +import org.gradle.api.Action; +import org.gradle.api.file.ConfigurableFileCollection; +import org.gradle.api.file.ConfigurableFileTree; +import org.gradle.api.file.FileCollection; +import org.gradle.api.internal.file.collections.MinimalFileSet; +import org.gradle.api.internal.file.collections.MinimalFileTree; +import org.gradle.api.tasks.TaskDependency; +import org.gradle.internal.Factory; +import org.gradle.internal.file.PathToFileResolver; +import org.gradle.internal.service.scopes.Scope; +import org.gradle.internal.service.scopes.ServiceScope; + +import java.io.File; +import java.io.OutputStream; +import java.util.Collection; +import java.util.List; + +@ServiceScope(Scope.Global.class) +public interface FileCollectionFactory { + /** + * Creates a copy of this factory that uses the given resolver to convert various types to File instances. + */ + FileCollectionFactory withResolver(PathToFileResolver fileResolver); + + /** + * Creates a {@link FileCollection} with the given contents. + * + * The collection is live, so that the contents are queried as required on query of the collection. + */ + FileCollectionInternal create(MinimalFileSet contents); + + /** + * Creates a {@link FileCollection} with the given contents, and built by the given tasks. + * + * The collection is live, so that the contents are queried as required on query of the collection. + */ + FileCollectionInternal create(TaskDependency builtBy, MinimalFileSet contents); + + /** + * Creates an empty {@link FileCollection} + */ + FileCollectionInternal empty(String displayName); + + /** + * Creates an empty {@link FileCollection} + */ + FileCollectionInternal empty(); + + /** + * Creates a {@link FileCollection} with the given files as content. + * + *

The collection is not live. The provided array is queried on construction and discarded. + */ + FileCollectionInternal fixed(File... files); + + /** + * Creates a {@link FileCollection} with the given files as content. + * + *

The collection is not live. The provided {@link Collection} is queried on construction and discarded. + */ + FileCollectionInternal fixed(Collection files); + + /** + * Creates a {@link FileCollection} with the given files as content. The result is not live and does not reflect changes to the array. + * + *

The collection is not live. The provided array is queried on construction and discarded. + */ + FileCollectionInternal fixed(String displayName, File... files); + + /** + * Creates a {@link FileCollection} with the given files as content. + * + *

The collection is not live. The provided {@link Collection} is queried on construction and discarded. + */ + FileCollectionInternal fixed(String displayName, Collection files); + + /** + * Creates a {@link FileCollection} with the given files as content. + * + *

The collection is live and resolves the files on each query. + */ + FileCollectionInternal resolving(String displayName, Object sources); + + /** + * Creates a {@link FileCollection} with the given files as content. + * + *

The collection is live and resolves the files on each query. + */ + FileCollectionInternal resolving(Object sources); + + /** + * Creates an empty {@link ConfigurableFileCollection} instance. + */ + ConfigurableFileCollection configurableFiles(String displayName); + + /** + * Creates an empty {@link ConfigurableFileCollection} instance. + */ + ConfigurableFileCollection configurableFiles(); + + /** + * Creates a {@link ConfigurableFileTree} instance with no base dir specified. + */ + ConfigurableFileTree fileTree(); + + /** + * Creates a file tree containing the given generated file. + */ + FileTreeInternal generated(Factory tmpDir, String fileName, Action fileGenerationListener, Action contentGenerator); + + /** + * Creates a file tree made up of the union of the given trees. + * + *

The tree is not live. The provided list is queried on construction and discarded. + */ + FileTreeInternal treeOf(List fileTrees); + + FileTreeInternal treeOf(MinimalFileTree tree); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/files/org/gradle/api/internal/file/pattern/PatternMatcher.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/files/org/gradle/api/internal/file/pattern/PatternMatcher.java new file mode 100644 index 0000000..355d5ae --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/files/org/gradle/api/internal/file/pattern/PatternMatcher.java @@ -0,0 +1,109 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.file.pattern; + +import com.google.common.collect.Lists; + +import java.util.List; + +public abstract class PatternMatcher { + public static final PatternMatcher MATCH_ALL = new PatternMatcher() { + @Override + public boolean test(String[] segments, boolean isFile) { + return true; + } + + @Override + public PatternMatcher and(PatternMatcher other) { + return other; + } + + @Override + public PatternMatcher or(PatternMatcher other) { + return this; + } + }; + + public abstract boolean test(String[] segments, boolean isFile); + + public PatternMatcher and(final PatternMatcher other) { + return new And(PatternMatcher.this, other); + } + + public PatternMatcher or(final PatternMatcher other) { + return new Or(PatternMatcher.this, other); + } + + public PatternMatcher negate() { + return new PatternMatcher() { + @Override + public boolean test(String[] segments, boolean isFile) { + return !PatternMatcher.this.test(segments, isFile); + } + }; + } + + private static final class Or extends PatternMatcher { + private final List parts = Lists.newLinkedList(); + + public Or(PatternMatcher patternMatcher, PatternMatcher other) { + parts.add(patternMatcher); + parts.add(other); + } + + @Override + public PatternMatcher or(PatternMatcher other) { + parts.add(other); + return this; + } + + @Override + public boolean test(String[] segments, boolean isFile) { + for (PatternMatcher part : parts) { + if (part.test(segments, isFile)) { + return true; + } + } + return false; + } + } + + private static final class And extends PatternMatcher { + private final List parts = Lists.newLinkedList(); + + public And(PatternMatcher patternMatcher, PatternMatcher other) { + parts.add(patternMatcher); + parts.add(other); + } + + @Override + public PatternMatcher and(PatternMatcher other) { + parts.add(other); + return this; + } + + @Override + public boolean test(String[] segments, boolean isFile) { + for (PatternMatcher part : parts) { + if (!part.test(segments, isFile)) { + return false; + } + } + return true; + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/files/org/gradle/internal/file/Deleter.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/files/org/gradle/internal/file/Deleter.java new file mode 100644 index 0000000..e7503d2 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/files/org/gradle/internal/file/Deleter.java @@ -0,0 +1,110 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.file; + +import java.io.File; +import java.io.IOException; + +/** + * A file deleter that doesn't give up if deletion doesn't work on the first try. + */ +public interface Deleter { + /** + * Attempts to delete the given file or directory recursively. + * + * Can delete directories with contents. + * Does not Follow symlinks. + * + * @return {@code true} if anything was removed, {@code false} if no change was + * attempted (because {@code target} didn't exist). + * + * @throws IOException when {@code target} cannot be deleted (with detailed error + * message). + */ + boolean deleteRecursively(File target) throws IOException; + + /** + * Attempts to delete the given file or directory recursively. + * + * Can delete directories with contents. + * Follows symlinks pointing to directories when instructed to. + * + * @return {@code true} if anything was removed, {@code false} if no change was + * attempted (because {@code target} didn't exist). + * + * @throws IOException when {@code target} cannot be deleted (with detailed error + * message). + */ + boolean deleteRecursively(File target, boolean followSymlinks) throws IOException; + + /** + * Makes sure that the given target is an empty directory. + * + * If target is... + * + *

    + *
  • a directory, then its contents are removed recursively,
  • + *
  • a file or a symlink, then it is deleted and a directory is created in its place,
  • + *
  • non-existent, then a directory is created in its place.
  • + *
+ * + * Does not follow symlinks. + * + * @return {@code true} if anything was removed, {@code false} if no change was + * attempted (because {@code target} didn't exist). + * + * @throws IOException when {@code target} cannot be deleted (with detailed error + * message). + */ + boolean ensureEmptyDirectory(File target) throws IOException; + + /** + * Makes sure that the given target is an empty directory. + * + * If target is... + * + *
    + *
  • a directory, then its contents are removed recursively,
  • + *
  • a symlink pointing to an existing directory, then either the linked directory's + * contents are removed recursively (if {@code followSymlinks} is {@code true}), + * or the link is removed and a new directory is created (if {@code followSymlinks} + * is {@code false}),
  • + *
  • a file, or a symlink to an existing file, it is deleted and a directory is created in its place,
  • + *
  • non-existent, then a directory is created in its place.
  • + *
+ * + * Follows symlinks pointing to directories when instructed to. + * + * @return {@code true} if anything was removed, {@code false} if no change was + * attempted (because {@code target} didn't exist). + * + * @throws IOException when {@code target} cannot be deleted (with detailed error + * message). + */ + boolean ensureEmptyDirectory(File target, boolean followSymlinks) throws IOException; + + /** + * Deletes a single file or an empty directory. + * + * Does not follow symlinks. + * + * @return {@code true} if the target existed, {@code false} if it didn't exist. + * + * @throws IOException if the file cannot be deleted. + */ + boolean delete(File target) throws IOException; +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide-native/org/gradle/ide/visualstudio/internal/CppApplicationVisualStudioTargetBinary.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide-native/org/gradle/ide/visualstudio/internal/CppApplicationVisualStudioTargetBinary.java new file mode 100644 index 0000000..93d4e3b --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide-native/org/gradle/ide/visualstudio/internal/CppApplicationVisualStudioTargetBinary.java @@ -0,0 +1,64 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.ide.visualstudio.internal; + +import org.gradle.api.file.ProjectLayout; +import org.gradle.language.cpp.CppBinary; +import org.gradle.language.cpp.CppComponent; +import org.gradle.language.cpp.CppExecutable; + +import java.io.File; + +public class CppApplicationVisualStudioTargetBinary extends AbstractCppBinaryVisualStudioTargetBinary { + private final CppExecutable binary; + + public CppApplicationVisualStudioTargetBinary(String projectName, String projectPath, CppComponent component, CppExecutable binary, ProjectLayout projectLayout) { + super(projectName, projectPath, component, projectLayout); + this.binary = binary; + } + + @Override + public String getVisualStudioProjectName() { + return projectName; + } + + @Override + CppBinary getBinary() { + return binary; + } + + @Override + public ProjectType getProjectType() { + return ProjectType.EXE; + } + + @Override + public boolean isExecutable() { + return true; + } + + @Override + public String getBuildTaskPath() { + return binary.getInstallTask().get().getPath(); + } + + @Override + public File getOutputFile() { + return binary.getDebuggerExecutableFile().get().getAsFile(); + } + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide-native/org/gradle/ide/visualstudio/tasks/internal/VisualStudioProjectFile.groovy b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide-native/org/gradle/ide/visualstudio/tasks/internal/VisualStudioProjectFile.groovy new file mode 100644 index 0000000..d8085c1 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide-native/org/gradle/ide/visualstudio/tasks/internal/VisualStudioProjectFile.groovy @@ -0,0 +1,129 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.ide.visualstudio.tasks.internal + +import org.gradle.api.Transformer +import org.gradle.ide.visualstudio.internal.VisualStudioProjectConfiguration +import org.gradle.ide.visualstudio.internal.VisualStudioTargetBinary +import org.gradle.internal.xml.XmlTransformer +import org.gradle.plugins.ide.internal.generator.XmlPersistableConfigurationObject +import org.gradle.util.VersionNumber + +class VisualStudioProjectFile extends XmlPersistableConfigurationObject { + private final Transformer fileLocationResolver + String gradleCommand = 'gradle' + VersionNumber visualStudioVersion + + VisualStudioProjectFile(XmlTransformer xmlTransformer, Transformer fileLocationResolver) { + super(xmlTransformer) + this.fileLocationResolver = fileLocationResolver + } + + protected String getDefaultResourceName() { + 'default.vcxproj' + } + + def setProjectUuid(String uuid) { + Node globals = xml.PropertyGroup.find({ it.'@Label' == 'Globals' }) as Node + globals.appendNode("ProjectGUID", uuid) + } + + def setVisualStudioVersion(VersionNumber version) { + visualStudioVersion = version + xml.attributes().ToolsVersion = version.major >= 12 ? "${version.major}.0" : "4.0" + } + + def setSdkVersion(VersionNumber version) { + Node globals = xml.PropertyGroup.find({ it.'@Label' == 'Globals' }) as Node + globals.appendNode("WindowsTargetPlatformVersion", version.micro != 0 ? version : "${version.major}.${version.minor}") + } + + def addSourceFile(File it) { + def sources = xml.ItemGroup.find({ it.'@Label' == 'Sources' }) as Node + sources.appendNode("ClCompile", [Include: toPath(it)]) + } + + def addResource(File it) { + def resources = xml.ItemGroup.find({ it.'@Label' == 'References' }) as Node + resources.appendNode("ResourceCompile", [Include: toPath(it)]) + } + + def addHeaderFile(File it) { + def headers = xml.ItemGroup.find({ it.'@Label' == 'Headers' }) as Node + headers.appendNode("ClInclude", [Include: toPath(it)]) + } + + def addConfiguration(VisualStudioProjectConfiguration configuration) { + def configNode = configurations.appendNode("ProjectConfiguration", [Include: configuration.name]) + configNode.appendNode("Configuration", configuration.configurationName) + configNode.appendNode("Platform", configuration.platformName) + final configCondition = "'\$(Configuration)|\$(Platform)'=='${configuration.name}'" + + def vsOutputDir = ".vs\\${configuration.project.name}\\\$(Configuration)" + Node defaultProps = xml.Import.find({ it.'@Project' == '$(VCTargetsPath)\\Microsoft.Cpp.Default.props' }) as Node + defaultProps + { + PropertyGroup(Label: "Configuration", Condition: configCondition) { + ConfigurationType(configuration.type) + if (configuration.buildable) { + UseDebugLibraries(configuration.targetBinary.debuggable) + OutDir(vsOutputDir) + IntDir(vsOutputDir) + } + if (visualStudioVersion.major > 14) { + PlatformToolset("v141") + } else if (visualStudioVersion.major >= 11) { + PlatformToolset("v${visualStudioVersion.major}0") + } + } + } + + final includePath = toPath(configuration.buildable ? configuration.targetBinary.includePaths : [] as Set).join(";") + Node userMacros = xml.PropertyGroup.find({ it.'@Label' == 'UserMacros' }) as Node + userMacros + { + PropertyGroup(Label: "NMakeConfiguration", Condition: configCondition) { + if (configuration.buildable) { + NMakeBuildCommandLine("${gradleCommand} ${configuration.targetBinary.buildTaskPath}") + NMakeCleanCommandLine("${gradleCommand} ${configuration.targetBinary.cleanTaskPath}") + NMakeReBuildCommandLine("${gradleCommand} ${configuration.targetBinary.cleanTaskPath} ${configuration.targetBinary.buildTaskPath}") + NMakePreprocessorDefinitions(configuration.targetBinary.compilerDefines.join(";")) + NMakeIncludeSearchPath(includePath) + NMakeOutput(toPath(configuration.targetBinary.outputFile)) + } else { + NMakeBuildCommandLine("echo '${configuration.project.name}' project is not buildable. && exit /b -42") + NMakeCleanCommandLine("echo '${configuration.project.name}' project is not buildable. && exit /b -42") + NMakeReBuildCommandLine("echo '${configuration.project.name}' project is not buildable. && exit /b -42") + } + } + } + + if (configuration.targetBinary != null && configuration.targetBinary.languageStandard != VisualStudioTargetBinary.LanguageStandard.NONE) { + xml.appendNode("ItemDefinitionGroup", [Condition: configCondition]).appendNode("ClCompile").appendNode("LanguageStandard", configuration.targetBinary.languageStandard.value) + } + } + + private Node getConfigurations() { + return xml.ItemGroup.find({ it.'@Label' == 'ProjectConfigurations' }) as Node + } + + private List toPath(Set files) { + return files.collect({ toPath(it) }) + } + + private String toPath(File it) { + fileLocationResolver.transform(it) + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide-native/org/gradle/ide/xcode/internal/XcodeUtils.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide-native/org/gradle/ide/xcode/internal/XcodeUtils.java new file mode 100644 index 0000000..d051941 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide-native/org/gradle/ide/xcode/internal/XcodeUtils.java @@ -0,0 +1,45 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.ide.xcode.internal; + +import org.apache.commons.lang.StringUtils; +import org.gradle.api.Transformer; +import org.gradle.util.CollectionUtils; + +import java.io.File; +import java.util.Arrays; + +public class XcodeUtils { + private XcodeUtils() {} + + public static String toSpaceSeparatedList(File... files) { + return toSpaceSeparatedList(Arrays.asList(files)); + } + + public static String toSpaceSeparatedList(Iterable it) { + return StringUtils.join(CollectionUtils.collect(it, new Transformer() { + @Override + public String transform(File file) { + return quote(file.getAbsolutePath()); + } + }), ' '); + } + + private static String quote(String value) { + return "\"" + value + "\""; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide-native/org/gradle/ide/xcode/internal/xcodeproj/PBXFileReference.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide-native/org/gradle/ide/xcode/internal/xcodeproj/PBXFileReference.java new file mode 100644 index 0000000..90c7ca7 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide-native/org/gradle/ide/xcode/internal/xcodeproj/PBXFileReference.java @@ -0,0 +1,71 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.ide.xcode.internal.xcodeproj; + +import com.google.common.base.Optional; +import com.google.common.io.Files; + +/** + * Reference to a concrete file. + */ +public class PBXFileReference extends PBXReference { + private Optional explicitFileType; + private Optional lastKnownFileType; + + public PBXFileReference(String name, String path, SourceTree sourceTree) { + super(name, path, sourceTree); + + // this is necessary to prevent O(n^2) behavior in xcode project loading + String fileType = FileTypes.FILE_EXTENSION_TO_UTI.get(Files.getFileExtension(name)); + explicitFileType = Optional.fromNullable(fileType); + lastKnownFileType = Optional.absent(); + } + + public Optional getExplicitFileType() { + return explicitFileType; + } + + public void setExplicitFileType(Optional explicitFileType) { + this.explicitFileType = explicitFileType; + } + + @Override + public String isa() { + return "PBXFileReference"; + } + + @Override + public void serializeInto(XcodeprojSerializer s) { + super.serializeInto(s); + + if (explicitFileType.isPresent()) { + s.addField("explicitFileType", explicitFileType.get()); + } + + if (lastKnownFileType.isPresent()) { + s.addField("lastKnownFileType", lastKnownFileType.get()); + } + } + + @Override + public String toString() { + return String.format( + "%s explicitFileType=%s", + super.toString(), + getExplicitFileType()); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide/org/gradle/plugins/ide/eclipse/GenerateEclipseClasspath.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide/org/gradle/plugins/ide/eclipse/GenerateEclipseClasspath.java new file mode 100644 index 0000000..8482742 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide/org/gradle/plugins/ide/eclipse/GenerateEclipseClasspath.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.plugins.ide.eclipse; + +import org.gradle.api.tasks.Internal; +import org.gradle.internal.xml.XmlTransformer; +import org.gradle.plugins.ide.api.XmlGeneratorTask; +import org.gradle.plugins.ide.eclipse.model.Classpath; +import org.gradle.plugins.ide.eclipse.model.EclipseClasspath; + +import javax.inject.Inject; + +/** + * Generates an Eclipse .classpath file. If you want to fine tune the eclipse configuration + *

+ * At this moment nearly all configuration is done via {@link EclipseClasspath}. + */ +public class GenerateEclipseClasspath extends XmlGeneratorTask { + + private EclipseClasspath classpath; + + public GenerateEclipseClasspath() { + getXmlTransformer().setIndentation("\t"); + } + + @Inject + public GenerateEclipseClasspath(EclipseClasspath classpath) { + this.classpath = classpath; + } + + @Override + protected Classpath create() { + return new Classpath(getXmlTransformer(), classpath.getFileReferenceFactory()); + } + + @Override + protected void configure(Classpath xmlClasspath) { + classpath.mergeXmlClasspath(xmlClasspath); + } + + @Override + public XmlTransformer getXmlTransformer() { + if (classpath == null) { + return super.getXmlTransformer(); + } + return classpath.getFile().getXmlTransformer(); + } + + /** + * The Eclipse Classpath model containing the information required to generate the classpath file. + */ + @Internal + public EclipseClasspath getClasspath() { + return classpath; + } + + public void setClasspath(EclipseClasspath classpath) { + this.classpath = classpath; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide/org/gradle/plugins/ide/eclipse/model/EclipseWtpComponent.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide/org/gradle/plugins/ide/eclipse/model/EclipseWtpComponent.java new file mode 100644 index 0000000..ee41385 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide/org/gradle/plugins/ide/eclipse/model/EclipseWtpComponent.java @@ -0,0 +1,400 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.plugins.ide.eclipse.model; + +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import groovy.lang.Closure; +import org.gradle.api.Action; +import org.gradle.api.Project; +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.internal.project.ProjectInternal; +import org.gradle.api.internal.project.ProjectStateRegistry; +import org.gradle.plugins.ide.api.XmlFileContentMerger; +import org.gradle.plugins.ide.eclipse.model.internal.FileReferenceFactory; +import org.gradle.plugins.ide.eclipse.model.internal.WtpComponentFactory; +import org.gradle.plugins.ide.internal.IdeArtifactRegistry; + +import javax.inject.Inject; +import java.io.File; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import static org.gradle.util.ConfigureUtil.configure; + +/** + * Enables fine-tuning wtp component details of the Eclipse plugin + *

+ * Example of use with a blend of all possible properties. + * Bear in mind that usually you don't have to configure them directly because Gradle configures it for free! + * + *

+ * plugins {
+ *     id 'war' // or 'ear' or 'java'
+ *     id 'eclipse-wtp'
+ * }
+ *
+ * configurations {
+ *   someInterestingConfiguration
+ *   anotherConfiguration
+ * }
+ *
+ * eclipse {
+ *
+ *   //if you want parts of paths in resulting file(s) to be replaced by variables (files):
+ *   pathVariables 'GRADLE_HOME': file('/best/software/gradle'), 'TOMCAT_HOME': file('../tomcat')
+ *
+ *   wtp {
+ *     component {
+ *       //you can configure the context path:
+ *       contextPath = 'someContextPath'
+ *
+ *       //you can configure the deployName:
+ *       deployName = 'killerApp'
+ *
+ *       //you can alter the wb-resource elements.
+ *       //non-existing source dirs won't be added to the component file.
+ *       sourceDirs += file('someExtraFolder')
+ *
+ *       // dependencies to mark as deployable with lib folder deploy path
+ *       libConfigurations += [ configurations.someInterestingConfiguration ]
+ *
+ *       // dependencies to mark as deployable with root folder deploy path
+ *       rootConfigurations += [ configurations.someInterestingConfiguration ]
+ *
+ *       // dependencies to exclude from wtp deployment
+ *       minusConfigurations << configurations.anotherConfiguration
+ *
+ *       //you can add a wb-resource elements; mandatory keys: 'sourcePath', 'deployPath':
+ *       //if sourcePath points to non-existing folder it will *not* be added.
+ *       resource sourcePath: 'extra/resource', deployPath: 'deployment/resource'
+ *
+ *       //you can add a wb-property elements; mandatory keys: 'name', 'value':
+ *       property name: 'moodOfTheDay', value: ':-D'
+ *     }
+ *   }
+ * }
+ * 
+ * + * For tackling edge cases users can perform advanced configuration on resulting XML file. + * It is also possible to affect the way eclipse plugin merges the existing configuration + * via beforeMerged and whenMerged closures. + *

+ * beforeMerged and whenMerged closures receive {@link WtpComponent} object + *

+ * Examples of advanced configuration: + * + *

+ * plugins {
+ *     id 'war'
+ *     id 'eclipse-wtp'
+ * }
+ *
+ * eclipse {
+ *
+ *   wtp {
+ *     component {
+ *       file {
+ *         //if you want to mess with the resulting XML in whatever way you fancy
+ *         withXml {
+ *           def node = it.asNode()
+ *           node.appendNode('xml', 'is what I love')
+ *         }
+ *
+ *         //closure executed after wtp component file content is loaded from existing file
+ *         //but before gradle build information is merged
+ *         beforeMerged { wtpComponent ->
+ *           //tinker with {@link WtpComponent} here
+ *         }
+ *
+ *         //closure executed after wtp component file content is loaded from existing file
+ *         //and after gradle build information is merged
+ *         whenMerged { wtpComponent ->
+ *           //you can tinker with the {@link WtpComponent} here
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
+ */ +public class EclipseWtpComponent { + + private final Project project; + private final XmlFileContentMerger file; + + private Set sourceDirs; + private Set rootConfigurations = Sets.newLinkedHashSet(); + private Set libConfigurations = Sets.newLinkedHashSet(); + private Set minusConfigurations = Sets.newLinkedHashSet(); + private String deployName; + private List resources = Lists.newArrayList(); + private List properties = Lists.newArrayList(); + private String contextPath; + private String classesDeployPath = "/WEB-INF/classes"; + private String libDeployPath; + private Map pathVariables = Maps.newHashMap(); + + @Inject + public EclipseWtpComponent(org.gradle.api.Project project, XmlFileContentMerger file) { + this.project = project; + this.file = file; + } + + public Project getProject() { + return project; + } + + /** + * See {@link #file(Action) } + */ + public XmlFileContentMerger getFile() { + return file; + } + + /** + * Enables advanced configuration like tinkering with the output XML + * or affecting the way existing wtp component file content is merged with gradle build information + *

+ * The object passed to whenMerged{} and beforeMerged{} closures is of type {@link WtpComponent} + *

+ * For example see docs for {@link EclipseWtpComponent} + */ + public void file(Closure closure) { + configure(closure, file); + } + + /** + * Enables advanced configuration like tinkering with the output XML + * or affecting the way existing wtp component file content is merged with gradle build information. + *

+ * For example see docs for {@link EclipseWtpComponent} + * + * @since 3.5 + */ + public void file(Action action) { + action.execute(file); + } + + /** + * Source directories to be transformed into wb-resource elements. + *

+ * For examples see docs for {@link EclipseWtp} + *

+ * Only source dirs that exist will be added to the wtp component file. + * Non-existing resource directory declarations lead to errors when project is imported into Eclipse. + */ + public Set getSourceDirs() { + return sourceDirs; + } + + public void setSourceDirs(Set sourceDirs) { + this.sourceDirs = sourceDirs; + } + + /** + * The configurations whose files are to be marked to be deployed with a deploy path of '/'. + *

+ * For examples see docs for {@link EclipseWtp} + */ + public Set getRootConfigurations() { + return rootConfigurations; + } + + public void setRootConfigurations(Set rootConfigurations) { + this.rootConfigurations = rootConfigurations; + } + + /** + * The configurations whose files are to be marked to be deployed with a deploy path of {@link #getLibDeployPath()}. + *

+ * For examples see docs for {@link EclipseWtp} + */ + public Set getLibConfigurations() { + return libConfigurations; + } + + public void setLibConfigurations(Set libConfigurations) { + this.libConfigurations = libConfigurations; + } + + /** + * Synonym for {@link #getLibConfigurations()}. + */ + public Set getPlusConfigurations() { + return getLibConfigurations(); + } + + /** + * Synonym for {@link #setLibConfigurations(Set)}. + */ + public void setPlusConfigurations(Set plusConfigurations) { + setLibConfigurations(plusConfigurations); + } + + /** + * The configurations whose files are to be excluded from wtp deployment. + *

+ * For examples see docs for {@link EclipseWtp} + */ + public Set getMinusConfigurations() { + return minusConfigurations; + } + + public void setMinusConfigurations(Set minusConfigurations) { + this.minusConfigurations = minusConfigurations; + } + + /** + * The deploy name to be used. + *

+ * For examples see docs for {@link EclipseWtp} + */ + public String getDeployName() { + return deployName; + } + + public void setDeployName(String deployName) { + this.deployName = deployName; + } + + /** + * Additional wb-resource elements. + *

+ * For examples see docs for {@link EclipseWtp} + *

+ * Only resources that link to an existing directory ({@link WbResource#getSourcePath()}) + * will be added to the wtp component file. + * The reason is that non-existing resource directory declarations + * lead to errors when project is imported into Eclipse. + */ + public List getResources() { + return resources; + } + + public void setResources(List resources) { + this.resources = resources; + } + + /** + * Adds a wb-resource. + *

+ * For examples see docs for {@link EclipseWtp} + * + * @param args A map that must contain a deployPath and sourcePath key with corresponding values. + */ + public void resource(Map args) { + resources = Lists.newArrayList(Iterables.concat(getResources(), Collections.singleton(new WbResource(args.get("deployPath"), args.get("sourcePath"))))); + } + + /** + * Additional property elements. + *

+ * For examples see docs for {@link EclipseWtp} + */ + public List getProperties() { + return properties; + } + + public void setProperties(List properties) { + this.properties = properties; + } + + /** + * Adds a property. + *

+ * For examples see docs for {@link EclipseWtp} + * + * @param args A map that must contain a 'name' and 'value' key with corresponding values. + */ + public void property(Map args) { + properties = Lists.newArrayList(Iterables.concat(getProperties(), Collections.singleton(new WbProperty(args.get("name"), args.get("value"))))); + } + + /** + * The context path for the web application + *

+ * For examples see docs for {@link EclipseWtp} + */ + public String getContextPath() { + return contextPath; + } + + public void setContextPath(String contextPath) { + this.contextPath = contextPath; + } + + /** + * The deploy path for classes. + *

+ * For examples see docs for {@link EclipseWtp} + */ + public String getClassesDeployPath() { + return classesDeployPath; + } + + public void setClassesDeployPath(String classesDeployPath) { + this.classesDeployPath = classesDeployPath; + } + + /** + * The deploy path for libraries. + *

+ * For examples see docs for {@link EclipseWtp} + */ + public String getLibDeployPath() { + return libDeployPath; + } + + public void setLibDeployPath(String libDeployPath) { + this.libDeployPath = libDeployPath; + } + + /** + * The variables to be used for replacing absolute path in dependent-module elements. + *

+ * For examples see docs for {@link EclipseModel} + */ + public Map getPathVariables() { + return pathVariables; + } + + public void setPathVariables(Map pathVariables) { + this.pathVariables = pathVariables; + } + + public FileReferenceFactory getFileReferenceFactory() { + FileReferenceFactory referenceFactory = new FileReferenceFactory(); + for (Map.Entry pathVariable : pathVariables.entrySet()) { + referenceFactory.addPathVariable(pathVariable.getKey(), pathVariable.getValue()); + } + return referenceFactory; + } + + @SuppressWarnings("unchecked") + public void mergeXmlComponent(WtpComponent xmlComponent) { + file.getBeforeMerged().execute(xmlComponent); + ProjectInternal projectInternal = (ProjectInternal) this.project; + IdeArtifactRegistry ideArtifactRegistry = projectInternal.getServices().get(IdeArtifactRegistry.class); + ProjectStateRegistry projectRegistry = projectInternal.getServices().get(ProjectStateRegistry.class); + new WtpComponentFactory(projectInternal, ideArtifactRegistry, projectRegistry).configure(this, xmlComponent); + file.getWhenMerged().execute(xmlComponent); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide/org/gradle/plugins/ide/eclipse/model/ResourceFilterType.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide/org/gradle/plugins/ide/eclipse/model/ResourceFilterType.java new file mode 100644 index 0000000..8ea5ef2 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide/org/gradle/plugins/ide/eclipse/model/ResourceFilterType.java @@ -0,0 +1,26 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.plugins.ide.eclipse.model; + +/** + * Specifies whether an Eclipse {@link ResourceFilter} is including or excluding resources. + * + * @since 3.5 + */ +public enum ResourceFilterType { + INCLUDE_ONLY, + EXCLUDE_ALL; +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide/org/gradle/plugins/ide/internal/configurer/HierarchicalElementDeduplicator.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide/org/gradle/plugins/ide/internal/configurer/HierarchicalElementDeduplicator.java new file mode 100644 index 0000000..6813029 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide/org/gradle/plugins/ide/internal/configurer/HierarchicalElementDeduplicator.java @@ -0,0 +1,242 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.plugins.ide.internal.configurer; + +import com.google.common.base.Joiner; +import com.google.common.base.Splitter; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.Iterables; +import com.google.common.collect.LinkedHashMultimap; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Multimap; +import com.google.common.collect.Sets; +import com.google.common.primitives.Ints; + +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.Set; + +/** + * A generic name de-duplicator for hierarchical elements. + *

+ * Conflicting sub-elements are de-duplicated by prepending their parent element names, separated by a dash. + * Conflicting root elements are rejected with an {@link IllegalArgumentException} + *

+ * If a child's simple name already contains the name of its parent, the two prefixes are collapsed to keep names short. + * For example, an elements with the name segments root:impl:impl-simple would initially get the name + * root-impl-impl-simple and would then be shortened to root-impl-simple + * This shortening is of course only applied if it does not introduce a new name conflict. + * + * @param the type of element to de-duplicate + */ +public class HierarchicalElementDeduplicator { + + private final HierarchicalElementAdapter adapter; + + public HierarchicalElementDeduplicator(HierarchicalElementAdapter adapter) { + this.adapter = adapter; + } + + /** + * Calculates a set of renamings for each duplicate name in the given set of elements. + * + * @param elements the elements with possibly duplicated names + * @return a Map containing the new name for each element that has to be renamed + */ + public Map deduplicate(Iterable elements) { + return new StatefulDeduplicator(elements).getNewNames(); + } + + /* + * This inner class hides the fact that the actual de-duplication algorithm is stateful. + */ + private class StatefulDeduplicator { + + private final List elements; + private final Multimap elementsByName; + private final Map newNames; + private final Map prefixes; + + private StatefulDeduplicator(Iterable elements) { + this.elements = Lists.newArrayList(elements); + this.elementsByName = LinkedHashMultimap.create(); + this.newNames = Maps.newHashMap(); + this.prefixes = Maps.newHashMap(); + } + + private Map getNewNames() { + if (!elements.isEmpty() && newNames.isEmpty()) { + calculateNewNames(); + } + + return ImmutableMap.copyOf(newNames); + } + + private void calculateNewNames() { + sortElementsByDepth(); + for (T element : elements) { + elementsByName.put(getOriginalName(element), element); + prefixes.put(element, getParent(element)); + } + while (!getDuplicateNames().isEmpty()) { + deduplicate(); + } + simplifyNames(); + } + + private void deduplicate() { + for (String duplicateName : getDuplicateNames()) { + Collection duplicatedElements = elementsByName.get(duplicateName); + Set reservedNames = ImmutableSet.copyOf(elementsByName.keySet()); + Set notYetRenamed = getNotYetRenamedElements(duplicatedElements); + boolean deduplicationSuccessful = false; + Set elementsToRename = notYetRenamed.isEmpty() ? ImmutableSet.copyOf(duplicatedElements) : notYetRenamed; + for (T element : elementsToRename) { + boolean elementRenamed = true; + while (elementRenamed && reservedNames.contains(getCurrentlyAssignedName(element))) { + elementRenamed = renameUsingParentPrefix(element); + deduplicationSuccessful |= elementRenamed; + } + } + if (!deduplicationSuccessful) { + throw new IllegalArgumentException("Duplicate root element " + duplicateName); + } + } + } + + private boolean renameUsingParentPrefix(T element) { + T prefixElement = prefixes.get(element); + if (prefixElement != null) { + renameTo(element, getOriginalName(prefixElement) + "-" + getCurrentlyAssignedName(element)); + prefixes.put(element, getParent(prefixElement)); + return true; + } + return false; + } + + private void renameTo(T element, String newName) { + elementsByName.remove(getCurrentlyAssignedName(element), element); + elementsByName.put(newName, element); + newNames.put(element, newName); + } + + private void simplifyNames() { + Set deduplicatedNames = elementsByName.keySet(); + for (T element : elements) { + String simplifiedName = removeDuplicateWordsFromPrefix(getCurrentlyAssignedName(element), getOriginalName(element)); + if (!deduplicatedNames.contains(simplifiedName)) { + renameTo(element, simplifiedName); + } + } + } + + private String removeDuplicateWordsFromPrefix(String deduplicatedName, String originalName) { + String prefix = deduplicatedName.substring(0, deduplicatedName.lastIndexOf(originalName)); + if (prefix.isEmpty()) { + return deduplicatedName; + } + + Splitter splitter = Splitter.on('-').omitEmptyStrings(); + List prefixParts = Lists.newArrayList(splitter.split(prefix)); + List postfixParts = Lists.newArrayList(splitter.split(originalName)); + List words = Lists.newArrayList(); + + if (postfixParts.size() > 1) { + String postfixHead = postfixParts.get(0); + prefixParts.add(postfixHead); + postfixParts.remove(postfixHead); + } + + for (String prefixPart : prefixParts) { + if (!prefixPart.equals(Iterables.getLast(words, null))) { + words.add(prefixPart); + } + } + + words.addAll(postfixParts); + + return Joiner.on('-').join(words); + } + + private Set getDuplicateNames() { + Set duplicates = Sets.newLinkedHashSet(); + for (Entry> entry : elementsByName.asMap().entrySet()) { + if (entry.getValue().size() > 1) { + duplicates.add(entry.getKey()); + } + } + return duplicates; + } + + private Set getNotYetRenamedElements(Collection elementsToRename) { + Set notYetRenamed = Sets.newLinkedHashSet(); + for (T element : elementsToRename) { + if (!hasBeenRenamed(element)) { + notYetRenamed.add(element); + } + } + return notYetRenamed; + } + + private String getOriginalName(T element) { + return adapter.getName(element); + } + + private String getCurrentlyAssignedName(T element) { + if (hasBeenRenamed(element)) { + return newNames.get(element); + } else { + return getOriginalName(element); + } + } + + private T getParent(T parent) { + return adapter.getParent(parent); + } + + private boolean hasBeenRenamed(T element) { + return newNames.containsKey(element); + } + + private void sortElementsByDepth() { + Collections.sort(elements, new Comparator() { + + @Override + public int compare(T left, T right) { + return Ints.compare(getDepth(left), getDepth(right)); + } + + private int getDepth(T element) { + int depth = 0; + T parent = element; + while (parent != null) { + depth++; + parent = getParent(parent); + } + return depth; + } + }); + } + } + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide/org/gradle/plugins/ide/internal/tooling/eclipse/DefaultRunClosedProjectBuildDependencies.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide/org/gradle/plugins/ide/internal/tooling/eclipse/DefaultRunClosedProjectBuildDependencies.java new file mode 100644 index 0000000..1ba9a5f --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide/org/gradle/plugins/ide/internal/tooling/eclipse/DefaultRunClosedProjectBuildDependencies.java @@ -0,0 +1,28 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.plugins.ide.internal.tooling.eclipse; + +import org.gradle.tooling.model.eclipse.RunClosedProjectBuildDependencies; + +import java.io.Serializable; + +public class DefaultRunClosedProjectBuildDependencies implements RunClosedProjectBuildDependencies, Serializable { + public static final RunClosedProjectBuildDependencies INSTANCE = new DefaultRunClosedProjectBuildDependencies(); + + private DefaultRunClosedProjectBuildDependencies() { + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide/org/gradle/plugins/ide/internal/tooling/model/DefaultGradleProject.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide/org/gradle/plugins/ide/internal/tooling/model/DefaultGradleProject.java new file mode 100644 index 0000000..d8b809a --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ide/org/gradle/plugins/ide/internal/tooling/model/DefaultGradleProject.java @@ -0,0 +1,148 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.plugins.ide.internal.tooling.model; + +import org.gradle.tooling.internal.gradle.DefaultProjectIdentifier; +import org.gradle.tooling.internal.gradle.GradleProjectIdentity; + +import java.io.File; +import java.io.Serializable; +import java.util.Collection; +import java.util.LinkedList; +import java.util.List; + +public class DefaultGradleProject implements Serializable, GradleProjectIdentity { + private DefaultGradleScript buildScript = new DefaultGradleScript(); + private File buildDirectory; + private File projectDirectory; + private List tasks = new LinkedList(); + private String name; + private String description; + private DefaultProjectIdentifier projectIdentifier; + private DefaultGradleProject parent; + private List children = new LinkedList(); + + public String getName() { + return name; + } + + public DefaultGradleProject setName(String name) { + this.name = name; + return this; + } + + public String getDescription() { + return description; + } + + public DefaultGradleProject setDescription(String description) { + this.description = description; + return this; + } + + public DefaultGradleProject getParent() { + return parent; + } + + public DefaultGradleProject setParent(DefaultGradleProject parent) { + this.parent = parent; + return this; + } + + public Collection getChildren() { + return children; + } + + public DefaultGradleProject setChildren(List children) { + this.children = children; + return this; + } + + public String getPath() { + return projectIdentifier.getProjectPath(); + } + + public DefaultProjectIdentifier getProjectIdentifier() { + return projectIdentifier; + } + + @Override + public String getProjectPath() { + return projectIdentifier.getProjectPath(); + } + + @Override + public File getRootDir() { + return projectIdentifier.getBuildIdentifier().getRootDir(); + } + + public DefaultGradleProject setProjectIdentifier(DefaultProjectIdentifier projectIdentifier) { + this.projectIdentifier = projectIdentifier; + return this; + } + + public DefaultGradleProject findByPath(String path) { + if (path.equals(this.getPath())) { + return this; + } + for (DefaultGradleProject child : children) { + DefaultGradleProject found = child.findByPath(path); + if (found != null) { + return found; + } + } + + return null; + } + + public String toString() { + return "GradleProject{" + + "path='" + getPath() + '\'' + + '}'; + } + + public Collection getTasks() { + return tasks; + } + + public DefaultGradleProject setTasks(List tasks) { + this.tasks = tasks; + return this; + } + + public File getBuildDirectory() { + return buildDirectory; + } + + public DefaultGradleProject setBuildDirectory(File buildDirectory) { + this.buildDirectory = buildDirectory; + return this; + } + + public File getProjectDirectory() { + return projectDirectory; + } + + public DefaultGradleProject setProjectDirectory(File projectDirectory) { + this.projectDirectory = projectDirectory; + return this; + } + + public DefaultGradleScript getBuildScript() { + return buildScript; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ivy/org/gradle/api/publish/ivy/IvyModuleDescriptorAuthor.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ivy/org/gradle/api/publish/ivy/IvyModuleDescriptorAuthor.java new file mode 100644 index 0000000..5fc2017 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/ivy/org/gradle/api/publish/ivy/IvyModuleDescriptorAuthor.java @@ -0,0 +1,39 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.publish.ivy; + +import org.gradle.api.provider.Property; + +/** + * An author of an Ivy publication. + * + * @since 4.8 + * @see IvyModuleDescriptorSpec + */ +public interface IvyModuleDescriptorAuthor { + + /** + * The name of this author. + */ + Property getName(); + + /** + * The URL of this author. + */ + Property getUrl(); + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/jacoco/org/gradle/internal/jacoco/AntJacocoCheck.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/jacoco/org/gradle/internal/jacoco/AntJacocoCheck.java new file mode 100644 index 0000000..523c390 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/jacoco/org/gradle/internal/jacoco/AntJacocoCheck.java @@ -0,0 +1,114 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.jacoco; + +import com.google.common.base.Joiner; +import com.google.common.base.Predicate; +import com.google.common.collect.ImmutableMap; +import groovy.lang.Closure; +import groovy.lang.GroovyObjectSupport; +import org.gradle.api.Action; +import org.gradle.api.file.FileCollection; +import org.gradle.api.internal.project.IsolatedAntBuilder; +import org.gradle.internal.reflect.JavaMethod; +import org.gradle.testing.jacoco.tasks.rules.JacocoLimit; +import org.gradle.testing.jacoco.tasks.rules.JacocoViolationRule; +import org.gradle.testing.jacoco.tasks.rules.JacocoViolationRulesContainer; + +import java.util.HashMap; +import java.util.Hashtable; +import java.util.Map; + +import static com.google.common.collect.Iterables.filter; + +public class AntJacocoCheck extends AbstractAntJacocoReport { + + private static final String VIOLATIONS_ANT_PROPERTY = "jacocoViolations"; + private static final Predicate RULE_ENABLED_PREDICATE = new Predicate() { + @Override + public boolean apply(JacocoViolationRule rule) { + return rule.isEnabled(); + } + }; + + public AntJacocoCheck(IsolatedAntBuilder ant) { + super(ant); + } + + public JacocoCheckResult execute(FileCollection classpath, final String projectName, + final FileCollection allClassesDirs, final FileCollection allSourcesDirs, + final FileCollection executionData, final JacocoViolationRulesContainer violationRules) { + final JacocoCheckResult jacocoCheckResult = new JacocoCheckResult(); + + configureAntReportTask(classpath, new Action() { + @Override + public void execute(GroovyObjectSupport antBuilder) { + try { + invokeJacocoReport(antBuilder, projectName, allClassesDirs, allSourcesDirs, executionData, violationRules); + } catch (Exception e) { + String violations = getViolations(antBuilder); + jacocoCheckResult.setSuccess(false); + jacocoCheckResult.setFailureMessage(violations != null ? violations : e.getMessage()); + } + } + }); + + return jacocoCheckResult; + } + + @Override + protected void configureReport(final GroovyObjectSupport antBuilder, final JacocoViolationRulesContainer violationRules) { + if (!violationRules.getRules().isEmpty()) { + Map checkArgs = ImmutableMap.of("failonviolation", violationRules.isFailOnViolation(), "violationsproperty", VIOLATIONS_ANT_PROPERTY); + antBuilder.invokeMethod("check", new Object[] {checkArgs, new Closure(this, this) { + @SuppressWarnings("UnusedDeclaration") + public Object doCall(Object ignore) { + for (final JacocoViolationRule rule : filter(violationRules.getRules(), RULE_ENABLED_PREDICATE)) { + Map ruleArgs = ImmutableMap.of("element", rule.getElement(), "includes", Joiner.on(':').join(rule.getIncludes()), "excludes", Joiner.on(':').join(rule.getExcludes())); + antBuilder.invokeMethod("rule", new Object[] {ruleArgs, new Closure(this, this) { + @SuppressWarnings("UnusedDeclaration") + public Object doCall(Object ignore) { + for (JacocoLimit limit : rule.getLimits()) { + Map limitArgs = new HashMap(); + limitArgs.put("counter", limit.getCounter()); + limitArgs.put("value", limit.getValue()); + + if (limit.getMinimum() != null) { + limitArgs.put("minimum", limit.getMinimum()); + } + if (limit.getMaximum() != null) { + limitArgs.put("maximum", limit.getMaximum()); + } + + antBuilder.invokeMethod("limit", new Object[] {ImmutableMap.copyOf(limitArgs) }); + } + return null; + } + }}); + } + return null; + } + }}); + } + } + + private String getViolations(GroovyObjectSupport antBuilder) { + Object project = antBuilder.getProperty("project"); + Hashtable properties = JavaMethod.of(project, Hashtable.class, "getProperties").invoke(project, new Object[0]); + return (String) properties.get(VIOLATIONS_ANT_PROPERTY); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/jacoco/org/gradle/internal/jacoco/JacocoAgentJar.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/jacoco/org/gradle/internal/jacoco/JacocoAgentJar.java new file mode 100644 index 0000000..2d0d34b --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/jacoco/org/gradle/internal/jacoco/JacocoAgentJar.java @@ -0,0 +1,102 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.internal.jacoco; + +import com.google.common.base.Predicate; +import com.google.common.collect.Iterables; +import org.gradle.api.file.FileCollection; +import org.gradle.api.internal.file.FileOperations; +import org.gradle.api.specs.Spec; +import org.gradle.util.VersionNumber; + +import java.io.File; +import javax.inject.Inject; + +/** + * Helper to resolve the {@code jacocoagent.jar} from inside of the {@code org.jacoco.agent.jar}. + */ +public class JacocoAgentJar { + + private static final VersionNumber V_0_6_2_0 = VersionNumber.parse("0.6.2.0"); + private static final VersionNumber V_0_7_6_0 = VersionNumber.parse("0.7.6.0"); + + private final FileOperations fileOperations; + private FileCollection agentConf; + private File agentJar; + + /** + * Constructs a new agent JAR wrapper. + */ + @Inject + public JacocoAgentJar(FileOperations fileOperations) { + this.fileOperations = fileOperations; + } + + /** + * @return the configuration that the agent JAR is located in + */ + public FileCollection getAgentConf() { + return agentConf; + } + + public void setAgentConf(FileCollection agentConf) { + this.agentConf = agentConf; + } + + /** + * Unzips the resolved {@code org.jacoco.agent.jar} to retrieve the {@code jacocoagent.jar}. + * + * @return a file pointing to the {@code jacocoagent.jar} + */ + public File getJar() { + if (agentJar == null) { + agentJar = fileOperations.zipTree(getAgentConf().getSingleFile()).filter(new Spec() { + @Override + public boolean isSatisfiedBy(File file) { + return file.getName().equals("jacocoagent.jar"); + } + }).getSingleFile(); + } + return agentJar; + } + + public boolean supportsJmx() { + boolean pre062 = Iterables.any(getAgentConf(), new Predicate() { + @Override + public boolean apply(File file) { + return V_0_6_2_0.compareTo(extractVersion(file.getName())) > 0; + } + }); + return !pre062; + } + + public boolean supportsInclNoLocationClasses() { + boolean pre076 = Iterables.any(getAgentConf(), new Predicate() { + @Override + public boolean apply(File file) { + return V_0_7_6_0.compareTo(extractVersion(file.getName())) > 0; + } + }); + return !pre076; + } + + public static VersionNumber extractVersion(String jarName) { + // jarName format: org.jacoco.agent-.jar + int versionStart = "org.jacoco.agent-".length(); + int versionEnd = jarName.length() - ".jar".length(); + return VersionNumber.parse(jarName.substring(versionStart, versionEnd)); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/jacoco/org/gradle/internal/jacoco/JacocoCheckResult.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/jacoco/org/gradle/internal/jacoco/JacocoCheckResult.java new file mode 100644 index 0000000..ff12cf4 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/jacoco/org/gradle/internal/jacoco/JacocoCheckResult.java @@ -0,0 +1,39 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.jacoco; + +public class JacocoCheckResult { + + private boolean success = true; + private String failureMessage; + + public boolean isSuccess() { + return success; + } + + public void setSuccess(boolean success) { + this.success = success; + } + + public String getFailureMessage() { + return failureMessage; + } + + public void setFailureMessage(String failureMessage) { + this.failureMessage = failureMessage; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/jacoco/org/gradle/testing/jacoco/plugins/JacocoPlugin.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/jacoco/org/gradle/testing/jacoco/plugins/JacocoPlugin.java new file mode 100644 index 0000000..ea8e343 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/jacoco/org/gradle/testing/jacoco/plugins/JacocoPlugin.java @@ -0,0 +1,293 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.testing.jacoco.plugins; + +import org.apache.commons.lang.StringUtils; +import org.gradle.api.Action; +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.Task; +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.artifacts.DependencySet; +import org.gradle.api.internal.file.FileOperations; +import org.gradle.api.internal.project.ProjectInternal; +import org.gradle.api.plugins.JavaPlugin; +import org.gradle.api.plugins.ReportingBasePlugin; +import org.gradle.api.reporting.ConfigurableReport; +import org.gradle.api.reporting.Report; +import org.gradle.api.reporting.ReportingExtension; +import org.gradle.api.tasks.SourceSetContainer; +import org.gradle.api.tasks.TaskProvider; +import org.gradle.api.tasks.testing.Test; +import org.gradle.internal.jacoco.JacocoAgentJar; +import org.gradle.internal.reflect.Instantiator; +import org.gradle.language.base.plugins.LifecycleBasePlugin; +import org.gradle.testing.jacoco.tasks.JacocoBase; +import org.gradle.testing.jacoco.tasks.JacocoCoverageVerification; +import org.gradle.testing.jacoco.tasks.JacocoMerge; +import org.gradle.testing.jacoco.tasks.JacocoReport; + +import javax.inject.Inject; +import java.io.File; +import java.util.concurrent.Callable; + +/** + * Plugin that provides support for generating Jacoco coverage data. + */ +public class JacocoPlugin implements Plugin { + + /** + * The jacoco version used if none is explicitly specified. + * @since 3.4 + */ + public static final String DEFAULT_JACOCO_VERSION = "0.8.5"; + public static final String AGENT_CONFIGURATION_NAME = "jacocoAgent"; + public static final String ANT_CONFIGURATION_NAME = "jacocoAnt"; + public static final String PLUGIN_EXTENSION_NAME = "jacoco"; + private final Instantiator instantiator; + private Project project; + + @Inject + public JacocoPlugin(Instantiator instantiator) { + this.instantiator = instantiator; + } + + @Override + public void apply(Project project) { + project.getPluginManager().apply(ReportingBasePlugin.class); + this.project = project; + addJacocoConfigurations(); + ProjectInternal projectInternal = (ProjectInternal) project; + JacocoAgentJar agent = instantiator.newInstance(JacocoAgentJar.class, projectInternal.getServices().get(FileOperations.class)); + JacocoPluginExtension extension = project.getExtensions().create(PLUGIN_EXTENSION_NAME, JacocoPluginExtension.class, project, agent); + extension.setToolVersion(DEFAULT_JACOCO_VERSION); + final ReportingExtension reportingExtension = (ReportingExtension) project.getExtensions().getByName(ReportingExtension.NAME); + extension.setReportsDir(project.provider(new Callable() { + @Override + public File call() throws Exception { + return reportingExtension.file("jacoco"); + } + })); + + configureAgentDependencies(agent, extension); + configureTaskClasspathDefaults(extension); + applyToDefaultTasks(extension); + configureDefaultOutputPathForJacocoMerge(); + configureJacocoReportsDefaults(extension); + addDefaultReportAndCoverageVerificationTasks(extension); + } + + /** + * Creates the configurations used by plugin. + */ + private void addJacocoConfigurations() { + Configuration agentConf = project.getConfigurations().create(AGENT_CONFIGURATION_NAME); + agentConf.setVisible(false); + agentConf.setTransitive(true); + agentConf.setDescription("The Jacoco agent to use to get coverage data."); + Configuration antConf = project.getConfigurations().create(ANT_CONFIGURATION_NAME); + antConf.setVisible(false); + antConf.setTransitive(true); + antConf.setDescription("The Jacoco ant tasks to use to get execute Gradle tasks."); + } + + + /** + * Configures the agent dependencies using the 'jacocoAnt' configuration. Uses the version declared in 'toolVersion' of the Jacoco extension if no dependencies are explicitly declared. + * + * @param extension the extension that has the tool version to use + */ + private void configureAgentDependencies(JacocoAgentJar jacocoAgentJar, final JacocoPluginExtension extension) { + final Configuration config = project.getConfigurations().getAt(AGENT_CONFIGURATION_NAME); + jacocoAgentJar.setAgentConf(config); + config.defaultDependencies(new Action() { + @Override + public void execute(DependencySet dependencies) { + dependencies.add(project.getDependencies().create("org.jacoco:org.jacoco.agent:" + extension.getToolVersion())); + } + }); + } + + /** + * Configures the classpath for Jacoco tasks using the 'jacocoAnt' configuration. Uses the version information declared in 'toolVersion' of the Jacoco extension if no dependencies are explicitly + * declared. + * + * @param extension the JacocoPluginExtension + */ + private void configureTaskClasspathDefaults(final JacocoPluginExtension extension) { + final Configuration config = this.project.getConfigurations().getAt(ANT_CONFIGURATION_NAME); + project.getTasks().withType(JacocoBase.class).configureEach(new Action() { + @Override + public void execute(JacocoBase task) { + task.setJacocoClasspath(config); + } + }); + config.defaultDependencies(new Action() { + @Override + public void execute(DependencySet dependencies) { + dependencies.add(project.getDependencies().create("org.jacoco:org.jacoco.ant:" + extension.getToolVersion())); + } + }); + } + + /** + * Applies the Jacoco agent to all tasks of type {@code Test}. + * + * @param extension the extension to apply Jacoco with + */ + private void applyToDefaultTasks(final JacocoPluginExtension extension) { + project.getTasks().withType(Test.class).configureEach(new Action() { + @Override + public void execute(Test task) { + extension.applyTo(task); + } + }); + } + + private void configureDefaultOutputPathForJacocoMerge() { + project.getTasks().withType(JacocoMerge.class).configureEach(new Action() { + @Override + public void execute(final JacocoMerge task) { + task.setDestinationFile(project.provider(new Callable() { + @Override + public File call() { + return new File(project.getBuildDir(), "/jacoco/" + task.getName() + ".exec"); + } + })); + } + }); + } + + private void configureJacocoReportsDefaults(final JacocoPluginExtension extension) { + project.getTasks().withType(JacocoReport.class).configureEach(new Action() { + @Override + public void execute(JacocoReport reportTask) { + configureJacocoReportDefaults(extension, reportTask); + } + }); + } + + private Action configureReportOutputDirectory(final JacocoPluginExtension extension, final JacocoReport reportTask) { + return new Action() { + @Override + public void execute(final ConfigurableReport report) { + if (report.getOutputType().equals(Report.OutputType.DIRECTORY)) { + report.setDestination(project.provider(new Callable() { + @Override + public File call() throws Exception { + return new File(extension.getReportsDir(), reportTask.getName() + "/" + report.getName()); + } + })); + } else { + report.setDestination(project.provider(new Callable() { + @Override + public File call() throws Exception { + return new File(extension.getReportsDir(), reportTask.getName() + "/" + reportTask.getName() + "." + report.getName()); + } + })); + } + } + }; + } + + private void configureJacocoReportDefaults(final JacocoPluginExtension extension, final JacocoReport reportTask) { + reportTask.getReports().all(new Action() { + @Override + public void execute(final ConfigurableReport report) { + report.setEnabled(project.provider(new Callable() { + @Override + public Boolean call() throws Exception { + return report.getName().equals("html"); + } + })); + } + }); + reportTask.getReports().all(configureReportOutputDirectory(extension, reportTask)); + } + + /** + * Adds report and coverage verification tasks for specific default test tasks. + * + * @param extension the extension describing the test task names + */ + private void addDefaultReportAndCoverageVerificationTasks(final JacocoPluginExtension extension) { + project.getPlugins().withType(JavaPlugin.class, new Action() { + @Override + public void execute(JavaPlugin javaPlugin) { + final TaskProvider testTaskProvider = project.getTasks().named(JavaPlugin.TEST_TASK_NAME); + addDefaultReportTask(extension, testTaskProvider); + addDefaultCoverageVerificationTask(testTaskProvider); + } + }); + } + + private void addDefaultReportTask(final JacocoPluginExtension extension, final TaskProvider testTaskProvider) { + project.getTasks().register( + "jacoco" + StringUtils.capitalize(testTaskProvider.getName()) + "Report", + JacocoReport.class, + new Action() { + @Override + public void execute(final JacocoReport reportTask) { + reportTask.setGroup(LifecycleBasePlugin.VERIFICATION_GROUP); + reportTask.setDescription(String.format("Generates code coverage report for the %s task.", testTaskProvider.getName())); + reportTask.executionData(testTaskProvider.get()); + reportTask.sourceSets(project.getExtensions().getByType(SourceSetContainer.class).getByName("main")); + // TODO: Change the default location for these reports to follow the convention defined in #configureReportOutputDirectory + reportTask.getReports().all(new Action() { + @Override + public void execute(final ConfigurableReport report) { + /* + * For someone looking for the difference between this and the duplicate code above + * this one uses the `testTaskProvider` and the `reportTask`. The other just + * uses the `reportTask`. + * https://github.com/gradle/gradle/issues/6343 + */ + if (report.getOutputType().equals(Report.OutputType.DIRECTORY)) { + report.setDestination(project.provider(new Callable() { + @Override + public File call() throws Exception { + return new File(extension.getReportsDir(), testTaskProvider.getName() + "/" + report.getName()); + } + })); + } else { + report.setDestination(project.provider(new Callable() { + @Override + public File call() throws Exception { + return new File(extension.getReportsDir(), testTaskProvider.getName() + "/" + reportTask.getName() + "." + report.getName()); + } + })); + } + } + }); + } + }); + } + + private void addDefaultCoverageVerificationTask(final TaskProvider testTaskProvider) { + project.getTasks().register( + "jacoco" + StringUtils.capitalize(testTaskProvider.getName()) + "CoverageVerification", + JacocoCoverageVerification.class, + new Action() { + @Override + public void execute(final JacocoCoverageVerification coverageVerificationTask) { + coverageVerificationTask.setGroup(LifecycleBasePlugin.VERIFICATION_GROUP); + coverageVerificationTask.setDescription(String.format("Verifies code coverage metrics based on specified rules for the %s task.", testTaskProvider.getName())); + coverageVerificationTask.executionData(testTaskProvider.get()); + coverageVerificationTask.sourceSets(project.getExtensions().getByType(SourceSetContainer.class).getByName("main")); + } + }); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/kotlin-dsl/org/gradle/kotlin/dsl/SourceControlExtensions.kt b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/kotlin-dsl/org/gradle/kotlin/dsl/SourceControlExtensions.kt new file mode 100644 index 0000000..d66cc7b --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/kotlin-dsl/org/gradle/kotlin/dsl/SourceControlExtensions.kt @@ -0,0 +1,29 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.kotlin.dsl + +import org.gradle.vcs.VcsMapping +import org.gradle.vcs.VersionControlSpec + + +/** + * Specifies the VCS location for the requested component. + * + * @see VcsMapping.from + */ +inline fun VcsMapping.from(noinline configureAction: T.() -> Unit) = + from(T::class.java, configureAction) diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/kotlin-dsl/org/gradle/kotlin/dsl/codegen/GradleApiExtensions.kt b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/kotlin-dsl/org/gradle/kotlin/dsl/codegen/GradleApiExtensions.kt new file mode 100644 index 0000000..577c78b --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/kotlin-dsl/org/gradle/kotlin/dsl/codegen/GradleApiExtensions.kt @@ -0,0 +1,45 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.kotlin.dsl.codegen + +import org.gradle.kotlin.dsl.support.gradleApiMetadataFrom + +import java.io.File + + +internal +fun writeGradleApiKotlinDslExtensionsTo(outputDirectory: File, gradleJars: Collection, gradleApiMetadataJar: File): List { + + val gradleApiJars = gradleApiJarsFrom(gradleJars) + + val gradleApiMetadata = gradleApiMetadataFrom(gradleApiMetadataJar, gradleApiJars) + + return generateKotlinDslApiExtensionsSourceTo( + outputDirectory, + "org.gradle.kotlin.dsl", + "GradleApiKotlinDslExtensions", + gradleApiJars, + gradleJars - gradleApiJars, + gradleApiMetadata.spec, + gradleApiMetadata.parameterNamesSupplier + ) +} + + +private +fun gradleApiJarsFrom(gradleJars: Collection) = + gradleJars.filter { it.name.startsWith("gradle-") && !it.name.contains("gradle-kotlin-") } diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/kotlin-dsl/org/gradle/kotlin/dsl/execution/Program.kt b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/kotlin-dsl/org/gradle/kotlin/dsl/execution/Program.kt new file mode 100644 index 0000000..e045e62 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/kotlin-dsl/org/gradle/kotlin/dsl/execution/Program.kt @@ -0,0 +1,85 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.kotlin.dsl.execution + + +/** + * A source Kotlin DSL program can be: + * - empty + * - a single buildscript block + * - a single plugins block + * - a buildscript block followed by a plugins block + * - a script with neither a buildscript nor a plugins block + * - a script preceded by a buildscript or plugins block or both + * + * The evaluation of a Kotlin DSL program happens, in the general case, in + * [two stages](https://en.wikipedia.org/wiki/Multi-stage_programming): + * - in stage 1, the [Buildscript] and [Plugins] programs are executed and their execution + * is assumed to affect the classpath available to the stage 2 program; + * - in stage 2, the remaining [Script] must be evaluated against the dynamically resolved classpath and, + * for that reason, [stage 2 programs][Script] can only be specialized after stage 1 executes at least once; + */ +sealed class Program { + + /** + * A program with no observable side-effects. + */ + object Empty : Program() { + + override fun toString() = "Empty" + } + + /** + * A `buildscript` / `initscript` block. + */ + data class Buildscript(override val fragment: ProgramSourceFragment) : Stage1(), FragmentHolder + + /** + * A `pluginManagement` block. + */ + data class PluginManagement(override val fragment: ProgramSourceFragment) : Stage1(), FragmentHolder + + /** + * A `plugins` block. + */ + data class Plugins(override val fragment: ProgramSourceFragment) : Stage1(), FragmentHolder + + interface FragmentHolder { + val fragment: ProgramSourceFragment + } + + /** + * An optional `pluginManagement` block followed by a `buildscript` block then followed by a `plugins` block. + */ + data class Stage1Sequence(val pluginManagement: PluginManagement?, val buildscript: Buildscript?, val plugins: Plugins?) : Stage1() + + /** + * A script that must be dynamically evaluated after stage 1 completes and the script classpath + * becomes available. + */ + data class Script(val source: ProgramSource) : Program() + + /** + * A [Stage1] program followed by a stage 2 [Script] program. + */ + data class Staged(val stage1: Stage1, val stage2: Script) : Program() + + /** + * Any stage 1 program, one of [Buildscript], [Plugins] or [a sequence of the two][Stage1Sequence]. + */ + abstract class Stage1 : Program() +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/kotlin-dsl/org/gradle/kotlin/dsl/provider/ScriptCacheRepository.kt b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/kotlin-dsl/org/gradle/kotlin/dsl/provider/ScriptCacheRepository.kt new file mode 100644 index 0000000..5455e7b --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/kotlin-dsl/org/gradle/kotlin/dsl/provider/ScriptCacheRepository.kt @@ -0,0 +1,30 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.kotlin.dsl.provider + +import org.gradle.cache.CacheBuilder +import org.gradle.cache.CacheRepository + + +internal +class ScriptCacheRepository( + private val cacheRepository: CacheRepository +) { + + fun cache(key: String): CacheBuilder = + cacheRepository.cache(key) +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/kotlin-dsl/org/gradle/kotlin/dsl/resolver/ConcurrentGroupingQueue.kt b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/kotlin-dsl/org/gradle/kotlin/dsl/resolver/ConcurrentGroupingQueue.kt new file mode 100644 index 0000000..87ae940 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/kotlin-dsl/org/gradle/kotlin/dsl/resolver/ConcurrentGroupingQueue.kt @@ -0,0 +1,101 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.kotlin.dsl.resolver + +import org.gradle.kotlin.dsl.concurrent.pollTimeoutMillis + +import java.util.* +import java.util.concurrent.TimeUnit +import java.util.concurrent.locks.ReentrantLock + +import kotlin.concurrent.withLock + + +/** + * A queue that gives priority to the most recently pushed element. + */ +internal +class ConcurrentGroupingQueue( + + /** + * Predicate to check whether the given most recently pushed element (the receiver) + * supersedes the given less recent element (the argument). + * + * When the predicate returns true the argument is considered to be in the same group + * as the receiver. + */ + private + val supersedes: T.(T) -> Boolean + +) { + + private + val q = ArrayDeque() + + private + val lock = ReentrantLock() + + private + val notEmpty = lock.newCondition() + + fun push(element: T) { + lock.withLock { + q.addFirst(element) + if (q.size == 1) { + notEmpty.signal() + } + } + } + + /** + * Returns the next group of elements after removing them from the queue. + * + * The group contains the most recently pushed element plus all + * elements superseded by it ordered from most recent to least recent. + */ + fun nextGroup(timeoutMillis: Long = pollTimeoutMillis): List { + lock.withLock { + if (q.isNotEmpty()) { + return takeNextGroup() + } + if (notEmpty.await(timeoutMillis, TimeUnit.MILLISECONDS)) { + return takeNextGroup() + } + } + return emptyList() + } + + private + fun takeNextGroup(): List { + require(q.isNotEmpty()) + val group = mutableListOf() + q.iterator().run { + // the most recently pushed element + val mostRecent = next() + group.add(mostRecent) + remove() + // plus all elements superseded by it + for (next in this) { + if (mostRecent.supersedes(next)) { + group.add(next) + remove() + } + } + } + return group + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/kotlin-dsl/org/gradle/kotlin/dsl/support/CompiledKotlinSettingsScript.kt b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/kotlin-dsl/org/gradle/kotlin/dsl/support/CompiledKotlinSettingsScript.kt new file mode 100644 index 0000000..8d0bf9e --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/kotlin-dsl/org/gradle/kotlin/dsl/support/CompiledKotlinSettingsScript.kt @@ -0,0 +1,47 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.kotlin.dsl.support + +import org.gradle.api.initialization.Settings +import org.gradle.api.initialization.dsl.ScriptHandler +import org.gradle.api.internal.ProcessOperations +import org.gradle.api.internal.file.FileOperations +import org.gradle.api.logging.Logger +import org.gradle.api.logging.Logging +import org.gradle.api.logging.LoggingManager +import org.gradle.api.plugins.PluginAware + + +@ImplicitReceiver(Settings::class) +open class CompiledKotlinSettingsScript( + private val host: KotlinScriptHost +) : DefaultKotlinScript(SettingsScriptHost(host)), PluginAware by PluginAwareScript(host) { + + /** + * The [ScriptHandler] for this script. + */ + val buildscript: ScriptHandler + get() = host.scriptHandler + + private + class SettingsScriptHost(val host: KotlinScriptHost) : Host { + override fun getLogger(): Logger = Logging.getLogger(Settings::class.java) + override fun getLogging(): LoggingManager = host.target.serviceOf() + override fun getFileOperations(): FileOperations = host.fileOperations + override fun getProcessOperations(): ProcessOperations = host.processOperations + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-java/org/gradle/api/internal/tasks/compile/CommandLineJavaCompilerArgumentsGenerator.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-java/org/gradle/api/internal/tasks/compile/CommandLineJavaCompilerArgumentsGenerator.java new file mode 100644 index 0000000..34a5564 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-java/org/gradle/api/internal/tasks/compile/CommandLineJavaCompilerArgumentsGenerator.java @@ -0,0 +1,46 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.compile; + +import com.google.common.collect.Iterables; +import org.gradle.internal.process.ArgCollector; +import org.gradle.internal.process.ArgWriter; + +import java.io.File; +import java.io.Serializable; +import java.util.List; + +public class CommandLineJavaCompilerArgumentsGenerator implements CompileSpecToArguments, Serializable { + @Override + public void collectArguments(JavaCompileSpec spec, ArgCollector collector) { + for (String arg : generate(spec)) { + collector.args(arg); + } + } + + public Iterable generate(JavaCompileSpec spec) { + List launcherOptions = new JavaCompilerArgumentsBuilder(spec).includeLauncherOptions(true).includeMainOptions(false).includeClasspath(false).build(); + List remainingArgs = new JavaCompilerArgumentsBuilder(spec).includeSourceFiles(true).build(); + return Iterables.concat(launcherOptions, shortenArgs(spec.getTempDir(), remainingArgs)); + } + + private Iterable shortenArgs(File tempDir, List args) { + // for command file format, see http://docs.oracle.com/javase/6/docs/technotes/tools/windows/javac.html#commandlineargfile + // use platform character and line encoding + return ArgWriter.argsFileGenerator(new File(tempDir, "java-compiler-args.txt"), ArgWriter.unixStyleFactory()).transform(args); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-java/org/gradle/api/internal/tasks/compile/DefaultJavaCompileSpec.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-java/org/gradle/api/internal/tasks/compile/DefaultJavaCompileSpec.java new file mode 100644 index 0000000..80c9538 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-java/org/gradle/api/internal/tasks/compile/DefaultJavaCompileSpec.java @@ -0,0 +1,107 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.compile; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import org.gradle.api.internal.tasks.compile.processing.AnnotationProcessorDeclaration; +import org.gradle.api.tasks.compile.CompileOptions; + +import java.io.File; +import java.util.List; +import java.util.Set; + +public class DefaultJavaCompileSpec extends DefaultJvmLanguageCompileSpec implements JavaCompileSpec { + private MinimalJavaCompileOptions compileOptions; + private List annotationProcessorPath; + private Set effectiveAnnotationProcessors; + private Set classes; + private List modulePath; + private List sourceRoots; + + @Override + public MinimalJavaCompileOptions getCompileOptions() { + return compileOptions; + } + + public void setCompileOptions(CompileOptions compileOptions) { + this.compileOptions = new MinimalJavaCompileOptions(compileOptions); + } + + @Override + public List getAnnotationProcessorPath() { + return annotationProcessorPath; + } + + @Override + public void setAnnotationProcessorPath(List annotationProcessorPath) { + this.annotationProcessorPath = annotationProcessorPath; + } + + @Override + public Set getEffectiveAnnotationProcessors() { + return effectiveAnnotationProcessors; + } + + @Override + public void setEffectiveAnnotationProcessors(Set annotationProcessors) { + this.effectiveAnnotationProcessors = annotationProcessors; + } + + @Override + public Set getClasses() { + return classes; + } + + @Override + public void setClasses(Set classes) { + this.classes = classes; + } + + @Override + public List getModulePath() { + if (modulePath == null || modulePath.isEmpty()) { + int i = compileOptions.getCompilerArgs().indexOf("--module-path"); + if (i >= 0) { + // This is kept for backward compatibility - may be removed in the future + String[] modules = compileOptions.getCompilerArgs().get(i + 1).split(File.pathSeparator); + modulePath = Lists.newArrayListWithCapacity(modules.length); + for (String module : modules) { + modulePath.add(new File(module)); + } + } else if (modulePath == null) { + modulePath = ImmutableList.of(); + } + } + return modulePath; + } + + @Override + public void setModulePath(List modulePath) { + this.modulePath = modulePath; + } + + @Override + public List getSourceRoots() { + return sourceRoots; + } + + @Override + public void setSourcesRoots(List sourcesRoots) { + this.sourceRoots = sourcesRoots; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-java/org/gradle/api/internal/tasks/compile/incremental/deps/ClassChanges.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-java/org/gradle/api/internal/tasks/compile/incremental/deps/ClassChanges.java new file mode 100644 index 0000000..6188904 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-java/org/gradle/api/internal/tasks/compile/incremental/deps/ClassChanges.java @@ -0,0 +1,38 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.compile.incremental.deps; + +import java.util.Set; + +public class ClassChanges { + + private final Set modified; + private final Set addedClasses; + + public ClassChanges(Set modified, Set addedClasses) { + this.modified = modified; + this.addedClasses = addedClasses; + } + + public Set getModified() { + return modified; + } + + public Set getAdded() { + return addedClasses; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-java/org/gradle/api/internal/tasks/compile/incremental/recomp/SourceFileChangeProcessor.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-java/org/gradle/api/internal/tasks/compile/incremental/recomp/SourceFileChangeProcessor.java new file mode 100644 index 0000000..31e9ef6 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-java/org/gradle/api/internal/tasks/compile/incremental/recomp/SourceFileChangeProcessor.java @@ -0,0 +1,45 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.compile.incremental.recomp; + +import it.unimi.dsi.fastutil.ints.IntSets; +import org.gradle.api.internal.tasks.compile.incremental.deps.DependentsSet; + +import java.io.File; +import java.util.Collection; + +class SourceFileChangeProcessor { + private final PreviousCompilation previousCompilation; + + public SourceFileChangeProcessor(PreviousCompilation previousCompilation) { + this.previousCompilation = previousCompilation; + } + + public void processChange(File inputFile, Collection classNames, RecompilationSpec spec) { + spec.getClassesToCompile().addAll(classNames); + + for (String className : classNames) { + DependentsSet actualDependents = previousCompilation.getDependents(className, IntSets.EMPTY_SET); + if (actualDependents.isDependencyToAll()) { + spec.setFullRebuildCause(actualDependents.getDescription(), inputFile); + return; + } + spec.getClassesToCompile().addAll(actualDependents.getAllDependentClasses()); + spec.getResourcesToGenerate().addAll(actualDependents.getDependentResources()); + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-java/org/gradle/external/javadoc/internal/AbstractListJavadocOptionFileOption.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-java/org/gradle/external/javadoc/internal/AbstractListJavadocOptionFileOption.java new file mode 100644 index 0000000..63ef564 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-java/org/gradle/external/javadoc/internal/AbstractListJavadocOptionFileOption.java @@ -0,0 +1,57 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.external.javadoc.internal; + +import java.io.IOException; +import java.util.List; + +/** + * A base class for {@link org.gradle.external.javadoc.JavadocOptionFileOption} implementations whose value is a {@code List}. + * + * @param The type which this option represents. + */ +public abstract class AbstractListJavadocOptionFileOption> extends AbstractJavadocOptionFileOption { + protected final String joinBy; + + protected AbstractListJavadocOptionFileOption(String option, T value, String joinBy) { + super(option, value); + this.joinBy = joinBy; + } + + @Override + public T getValue() { + return value; + } + + @Override + public void setValue(T value) { + if (value == null) { + this.value.clear(); + } else { + this.value = value; + } + } + + @Override + public void write(JavadocOptionFileWriterContext writerContext) throws IOException { + if (value != null && !value.isEmpty()) { + writeCollectionValue(writerContext); + } + } + + protected abstract void writeCollectionValue(JavadocOptionFileWriterContext writerContext) throws IOException; +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-java/org/gradle/external/javadoc/internal/GroupsJavadocOptionFileOption.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-java/org/gradle/external/javadoc/internal/GroupsJavadocOptionFileOption.java new file mode 100644 index 0000000..77b38c5 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-java/org/gradle/external/javadoc/internal/GroupsJavadocOptionFileOption.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.external.javadoc.internal; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import org.gradle.util.CollectionUtils; + +import java.io.IOException; +import java.util.List; +import java.util.Map; + +/** + * A {@link org.gradle.external.javadoc.JavadocOptionFileOption} which represents the -groups command line + * option. + */ +public class GroupsJavadocOptionFileOption extends AbstractJavadocOptionFileOption>> { + public GroupsJavadocOptionFileOption(String option, Map> value) { + super(option, value); + } + + @Override + public void write(JavadocOptionFileWriterContext writerContext) throws IOException { + if (value != null && !value.isEmpty()) { + for (final String group : value.keySet()) { + final List groupPackages = value.get(group); + + writerContext + .writeOptionHeader(option) + .write("\"" + group + "\"") + .write(" ") + .write("\"" + CollectionUtils.join(":", groupPackages) + "\"") + .newLine(); + } + } + } + + @Override + public GroupsJavadocOptionFileOption duplicate() { + Map> duplicateValue = Maps.newLinkedHashMap(); + for (Map.Entry> entry : value.entrySet()) { + duplicateValue.put(entry.getKey(), Lists.newArrayList(entry.getValue())); + } + return new GroupsJavadocOptionFileOption(option, duplicateValue); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-java/org/gradle/external/javadoc/internal/JavadocOptionFileOptionInternalAdapter.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-java/org/gradle/external/javadoc/internal/JavadocOptionFileOptionInternalAdapter.java new file mode 100644 index 0000000..ce67026 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-java/org/gradle/external/javadoc/internal/JavadocOptionFileOptionInternalAdapter.java @@ -0,0 +1,55 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.external.javadoc.internal; + +import org.gradle.external.javadoc.JavadocOptionFileOption; + +import java.io.IOException; + +public class JavadocOptionFileOptionInternalAdapter implements JavadocOptionFileOptionInternal { + private final JavadocOptionFileOption option; + + public JavadocOptionFileOptionInternalAdapter(JavadocOptionFileOption option) { + this.option = option; + } + + @Override + public JavadocOptionFileOptionInternal duplicate() { + // TODO: We basically don't support copying custom Javadoc options + return this; + } + + @Override + public String getOption() { + return option.getOption(); + } + + @Override + public T getValue() { + return option.getValue(); + } + + @Override + public void setValue(T value) { + option.setValue(value); + } + + @Override + public void write(JavadocOptionFileWriterContext writerContext) throws IOException { + option.write(writerContext); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-jvm/org/gradle/language/jvm/package-info.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-jvm/org/gradle/language/jvm/package-info.java new file mode 100644 index 0000000..12bf838 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-jvm/org/gradle/language/jvm/package-info.java @@ -0,0 +1,21 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Types for support for JVM languages. + */ +@org.gradle.api.Incubating +package org.gradle.language.jvm; diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-native/org/gradle/language/c/internal/DefaultCCompileSpec.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-native/org/gradle/language/c/internal/DefaultCCompileSpec.java new file mode 100644 index 0000000..59ee5c1 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-native/org/gradle/language/c/internal/DefaultCCompileSpec.java @@ -0,0 +1,23 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.c.internal; + +import org.gradle.language.nativeplatform.internal.AbstractNativeCompileSpec; +import org.gradle.nativeplatform.toolchain.internal.compilespec.CCompileSpec; + +public class DefaultCCompileSpec extends AbstractNativeCompileSpec implements CCompileSpec { +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-native/org/gradle/language/cpp/internal/DefaultCppPlatform.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-native/org/gradle/language/cpp/internal/DefaultCppPlatform.java new file mode 100644 index 0000000..e6964f6 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-native/org/gradle/language/cpp/internal/DefaultCppPlatform.java @@ -0,0 +1,44 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.cpp.internal; + +import org.gradle.language.cpp.CppPlatform; +import org.gradle.nativeplatform.TargetMachine; +import org.gradle.nativeplatform.platform.NativePlatform; + +public class DefaultCppPlatform implements CppPlatform { + private final TargetMachine targetMachine; + private final NativePlatform nativePlatform; + + public DefaultCppPlatform(TargetMachine targetMachine) { + this(targetMachine, null); + } + + public DefaultCppPlatform(TargetMachine targetMachine, NativePlatform nativePlatform) { + this.targetMachine = targetMachine; + this.nativePlatform = nativePlatform; + } + + @Override + public TargetMachine getTargetMachine() { + return targetMachine; + } + + public NativePlatform getNativePlatform() { + return nativePlatform; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/DefaultIncrementalCompilation.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/DefaultIncrementalCompilation.java new file mode 100644 index 0000000..aeaaf8d --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/DefaultIncrementalCompilation.java @@ -0,0 +1,61 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.language.nativeplatform.internal.incremental; + +import java.io.File; +import java.util.List; +import java.util.Set; + +public class DefaultIncrementalCompilation implements IncrementalCompilation { + private final CompilationState finalState; + private final List recompile; + private final List removed; + private final Set existingHeaders; + private final boolean macroIncludesUsedInSources; + + public DefaultIncrementalCompilation(CompilationState finalState, List recompile, List removed, Set existingHeaders, boolean macroIncludesUsedInSources) { + this.finalState = finalState; + this.recompile = recompile; + this.removed = removed; + this.existingHeaders = existingHeaders; + this.macroIncludesUsedInSources = macroIncludesUsedInSources; + } + + @Override + public List getRecompile() { + return recompile; + } + + @Override + public List getRemoved() { + return removed; + } + + @Override + public CompilationState getFinalState() { + return finalState; + } + + @Override + public Set getExistingHeaders() { + return existingHeaders; + } + + @Override + public boolean isUnresolvedHeaders() { + return macroIncludesUsedInSources; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/IncrementalCompileSourceProcessor.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/IncrementalCompileSourceProcessor.java new file mode 100644 index 0000000..db422df --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/IncrementalCompileSourceProcessor.java @@ -0,0 +1,25 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.nativeplatform.internal.incremental; + +import java.io.File; + +public interface IncrementalCompileSourceProcessor { + void processSource(File sourceFile); + + IncrementalCompilation getResult(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/sourceparser/AbstractExpression.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/sourceparser/AbstractExpression.java new file mode 100644 index 0000000..e0a6256 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/sourceparser/AbstractExpression.java @@ -0,0 +1,93 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.nativeplatform.internal.incremental.sourceparser; + +import com.google.common.base.Joiner; +import org.gradle.language.nativeplatform.internal.Expression; +import org.gradle.language.nativeplatform.internal.IncludeType; + +import javax.annotation.Nullable; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public abstract class AbstractExpression implements Expression { + @Override + public String toString() { + return getAsSourceText(); + } + + @Override + public String getAsSourceText() { + return format(this); + } + + @Override + public List getArguments() { + return Collections.emptyList(); + } + + @Override + public Expression asMacroExpansion() { + return asMacroExpansion(this); + } + + static Expression asMacroExpansion(Expression expression) { + if (expression.getType() == IncludeType.IDENTIFIER) { + return new SimpleExpression(expression.getValue(), IncludeType.MACRO); + } + if (expression.getType() == IncludeType.TOKEN_CONCATENATION) { + return new ComplexExpression(IncludeType.EXPAND_TOKEN_CONCATENATION, expression.getValue(), expression.getArguments()); + } + if (expression.getType() == IncludeType.ARGS_LIST && !expression.getArguments().isEmpty()) { + List mapped = new ArrayList(expression.getArguments().size()); + for (Expression arg : expression.getArguments()) { + mapped.add(arg.asMacroExpansion()); + } + return new ComplexExpression(IncludeType.ARGS_LIST, null, mapped); + } + return expression; + } + + static String format(Expression expression) { + return format(expression.getType(), expression.getValue(), expression.getArguments()); + } + + static String format(IncludeType type, @Nullable String value, List arguments) { + switch (type) { + case QUOTED: + return '"' + value + '"'; + case SYSTEM: + return '<' + value + '>'; + case MACRO: + case IDENTIFIER: + case TOKEN: + return value; + case TOKEN_CONCATENATION: + case EXPAND_TOKEN_CONCATENATION: + return arguments.get(0).getAsSourceText() + "##" + arguments.get(1).getAsSourceText(); + case MACRO_FUNCTION: + return value + "(" + Joiner.on(", ").join(arguments) + ")"; + case EXPRESSIONS: + return Joiner.on(" ").join(arguments); + case ARGS_LIST: + return "(" + Joiner.on(", ").join(arguments) + ")"; + default: + return value != null ? value : "??"; + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/sourceparser/AbstractMacroFunction.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/sourceparser/AbstractMacroFunction.java new file mode 100644 index 0000000..987d81b --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/sourceparser/AbstractMacroFunction.java @@ -0,0 +1,67 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.nativeplatform.internal.incremental.sourceparser; + +import org.gradle.language.nativeplatform.internal.MacroFunction; + +public abstract class AbstractMacroFunction implements MacroFunction { + private final String name; + private final int parameters; + + AbstractMacroFunction(String name, int parameters) { + this.name = name; + this.parameters = parameters; + } + + @Override + public String toString() { + return "#define " + getName() + "(...) " + getBody(); + } + + protected String getBody() { + return "=> ???"; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getParameterCount() { + return parameters; + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj == null || obj.getClass() != getClass()) { + return false; + } + + AbstractMacroFunction other = (AbstractMacroFunction) obj; + return name.equals(other.name) && parameters == other.parameters; + } + + @Override + public int hashCode() { + return name.hashCode(); + } + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/sourceparser/ReturnFixedValueMacroFunction.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/sourceparser/ReturnFixedValueMacroFunction.java new file mode 100644 index 0000000..837922d --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/language-native/org/gradle/language/nativeplatform/internal/incremental/sourceparser/ReturnFixedValueMacroFunction.java @@ -0,0 +1,90 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.nativeplatform.internal.incremental.sourceparser; + +import com.google.common.base.Objects; +import org.gradle.language.nativeplatform.internal.Expression; +import org.gradle.language.nativeplatform.internal.IncludeType; + +import javax.annotation.Nullable; +import java.util.List; + +/** + * A macro function that returns a fixed expression and ignores its parameters. + */ +public class ReturnFixedValueMacroFunction extends AbstractMacroFunction implements Expression { + private final String value; + private final IncludeType type; + private final List arguments; + + public ReturnFixedValueMacroFunction(String name, int parameters, IncludeType type, @Nullable String value, List arguments) { + super(name, parameters); + this.value = value; + this.type = type; + this.arguments = arguments; + } + + @Override + protected String getBody() { + return getAsSourceText(); + } + + @Override + public Expression asMacroExpansion() { + return AbstractExpression.asMacroExpansion(this); + } + + @Override + public String getAsSourceText() { + return AbstractExpression.format(this); + } + + @Override + public List getArguments() { + return arguments; + } + + @Override + public IncludeType getType() { + return type; + } + + @Override + public String getValue() { + return value; + } + + @Override + public Expression evaluate(List arguments) { + return this; + } + + @Override + public boolean equals(Object obj) { + if (!super.equals(obj)) { + return false; + } + + ReturnFixedValueMacroFunction other = (ReturnFixedValueMacroFunction) obj; + return Objects.equal(value, other.value) && type == other.type && arguments.equals(other.arguments); + } + + @Override + public int hashCode() { + return super.hashCode() ^ (value == null ? 0 : value.hashCode()) ^ type.hashCode() ^ arguments.hashCode(); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/launcher/org/gradle/launcher/daemon/client/DaemonStartListener.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/launcher/org/gradle/launcher/daemon/client/DaemonStartListener.java new file mode 100644 index 0000000..264fbe2 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/launcher/org/gradle/launcher/daemon/client/DaemonStartListener.java @@ -0,0 +1,29 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.launcher.daemon.client; + +import org.gradle.internal.service.scopes.EventScope; +import org.gradle.internal.service.scopes.Scope.Global; +import org.gradle.launcher.daemon.context.DaemonConnectDetails; + +/** + * Notified when a daemon is started. + */ +@EventScope(Global.class) +public interface DaemonStartListener { + void daemonStarted(DaemonConnectDetails daemonInfo); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/launcher/org/gradle/launcher/daemon/server/api/DaemonStoppedException.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/launcher/org/gradle/launcher/daemon/server/api/DaemonStoppedException.java new file mode 100644 index 0000000..bf95d17 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/launcher/org/gradle/launcher/daemon/server/api/DaemonStoppedException.java @@ -0,0 +1,32 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.launcher.daemon.server.api; + +/** + * Thrown when the daemon is stopped while running a command. + */ +public class DaemonStoppedException extends RuntimeException { + public static final String MESSAGE = "Gradle build daemon has been stopped"; + + public DaemonStoppedException() { + super(MESSAGE); + } + + public DaemonStoppedException(String reason) { + super(MESSAGE + ": " + reason); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/launcher/org/gradle/launcher/daemon/server/exec/RequestStopIfSingleUsedDaemon.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/launcher/org/gradle/launcher/daemon/server/exec/RequestStopIfSingleUsedDaemon.java new file mode 100644 index 0000000..47686a6 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/launcher/org/gradle/launcher/daemon/server/exec/RequestStopIfSingleUsedDaemon.java @@ -0,0 +1,37 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.launcher.daemon.server.exec; + +import org.gradle.api.logging.Logger; +import org.gradle.api.logging.Logging; +import org.gradle.launcher.daemon.server.api.DaemonCommandAction; +import org.gradle.launcher.daemon.server.api.DaemonCommandExecution; + +public class RequestStopIfSingleUsedDaemon implements DaemonCommandAction { + + private static final Logger LOGGER = Logging.getLogger(RequestStopIfSingleUsedDaemon.class); + + @Override + public void execute(DaemonCommandExecution execution) { + if (execution.isSingleUseDaemon()) { + LOGGER.debug("Requesting daemon stop after processing {}", execution.getCommand()); + // Does not take effect until after execution has completed + execution.getDaemonStateControl().requestStop("stopping after processing"); + } + execution.proceed(); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/launcher/org/gradle/launcher/daemon/server/scaninfo/DaemonScanInfo.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/launcher/org/gradle/launcher/daemon/server/scaninfo/DaemonScanInfo.java new file mode 100644 index 0000000..5188fba --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/launcher/org/gradle/launcher/daemon/server/scaninfo/DaemonScanInfo.java @@ -0,0 +1,64 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.launcher.daemon.server.scaninfo; + +import org.gradle.api.Action; +import org.gradle.internal.scan.UsedByScanPlugin; + +/** + * A means to expose Daemon information _specifically_ for the purpose of build scans. The associated plugin obtains this via the service registry and queries all values when it is applied. + * + * This API is a contract with the plugin. Any binary incompatible changes will require changes to the plugin. + */ +@UsedByScanPlugin +public interface DaemonScanInfo { + /** + * @return the number of builds that the daemon has run + */ + int getNumberOfBuilds(); + + /** + * @return The time (milliseconds) since epoch at which the daemon was started + */ + long getStartedAt(); + + /** + * @return The idle timeout (milliseconds) of the daemon + */ + long getIdleTimeout(); + + /** + * @return The number of running daemons + */ + int getNumberOfRunningDaemons(); + + /** + * @return true if daemon is single use daemon, false otherwise + */ + boolean isSingleUse(); + + /** + * Invokes the given action when the Daemon becomes unhealthy in way that requires it be terminated at the end of the build. + *

+ * The action will be invoked at-most once during a build. + * It will only be invoked for the build in which it was registered (i.e. not subsequent builds). + * Each action provided to each invocation of this message will be notified. + *

+ * The action receives a free-form, human friendly, string describing why the Daemon needs to be shut down. + */ + void notifyOnUnhealthy(Action listener); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/launcher/org/gradle/launcher/exec/BuildActionExecuter.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/launcher/org/gradle/launcher/exec/BuildActionExecuter.java new file mode 100644 index 0000000..45d672a --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/launcher/org/gradle/launcher/exec/BuildActionExecuter.java @@ -0,0 +1,28 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.launcher.exec; + +import org.gradle.internal.invocation.BuildAction; + +public interface BuildActionExecuter { + /** + * Executes the given action, and returns the result. Build failures should be packaged in the result, rather than thrown. A failure packaged in this way will have already been reported as a build failure and should not be reported again. + * + * @param action The action + * @return The result. + */ + BuildActionResult execute(BuildAction action, PARAMS actionParameters, CONTEXT context); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/launcher/org/gradle/tooling/internal/provider/ProviderConnection.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/launcher/org/gradle/tooling/internal/provider/ProviderConnection.java new file mode 100644 index 0000000..215657a --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/launcher/org/gradle/tooling/internal/provider/ProviderConnection.java @@ -0,0 +1,436 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.provider; + +import com.google.common.annotations.VisibleForTesting; +import com.google.common.collect.ImmutableMap; +import org.gradle.api.internal.StartParameterInternal; +import org.gradle.api.internal.file.FileCollectionFactory; +import org.gradle.api.logging.LogLevel; +import org.gradle.cli.CommandLineParser; +import org.gradle.cli.ParsedCommandLine; +import org.gradle.initialization.BuildCancellationToken; +import org.gradle.initialization.BuildEventConsumer; +import org.gradle.initialization.BuildRequestContext; +import org.gradle.initialization.DefaultBuildRequestContext; +import org.gradle.initialization.DefaultBuildRequestMetaData; +import org.gradle.initialization.NoOpBuildEventConsumer; +import org.gradle.initialization.layout.BuildLayoutFactory; +import org.gradle.internal.build.event.BuildEventSubscriptions; +import org.gradle.internal.invocation.BuildAction; +import org.gradle.internal.jvm.Jvm; +import org.gradle.internal.jvm.inspection.JvmVersionDetector; +import org.gradle.internal.logging.LoggingManagerInternal; +import org.gradle.internal.logging.events.OutputEventListener; +import org.gradle.internal.logging.services.LoggingServiceRegistry; +import org.gradle.internal.service.ServiceRegistry; +import org.gradle.launcher.cli.converter.BuildLayoutConverter; +import org.gradle.launcher.cli.converter.InitialPropertiesConverter; +import org.gradle.launcher.cli.converter.LayoutToPropertiesConverter; +import org.gradle.launcher.configuration.AllProperties; +import org.gradle.launcher.configuration.BuildLayoutResult; +import org.gradle.launcher.configuration.InitialProperties; +import org.gradle.launcher.daemon.client.DaemonClient; +import org.gradle.launcher.daemon.client.DaemonClientFactory; +import org.gradle.launcher.daemon.client.NotifyDaemonAboutChangedPathsClient; +import org.gradle.launcher.daemon.configuration.DaemonBuildOptions; +import org.gradle.launcher.daemon.configuration.DaemonParameters; +import org.gradle.launcher.exec.BuildActionExecuter; +import org.gradle.launcher.exec.BuildActionParameters; +import org.gradle.launcher.exec.BuildActionResult; +import org.gradle.process.internal.streams.SafeStreams; +import org.gradle.tooling.events.OperationType; +import org.gradle.tooling.internal.build.DefaultBuildEnvironment; +import org.gradle.tooling.internal.consumer.parameters.FailsafeBuildProgressListenerAdapter; +import org.gradle.tooling.internal.gradle.DefaultBuildIdentifier; +import org.gradle.tooling.internal.protocol.BuildExceptionVersion1; +import org.gradle.tooling.internal.protocol.InternalBuildActionFailureException; +import org.gradle.tooling.internal.protocol.InternalBuildActionVersion2; +import org.gradle.tooling.internal.protocol.InternalBuildCancelledException; +import org.gradle.tooling.internal.protocol.InternalBuildProgressListener; +import org.gradle.tooling.internal.protocol.InternalPhasedAction; +import org.gradle.tooling.internal.protocol.InternalUnsupportedModelException; +import org.gradle.tooling.internal.protocol.ModelIdentifier; +import org.gradle.tooling.internal.protocol.PhasedActionResultListener; +import org.gradle.tooling.internal.protocol.events.InternalProgressEvent; +import org.gradle.tooling.internal.protocol.test.InternalTestExecutionException; +import org.gradle.tooling.internal.provider.connection.ProviderConnectionParameters; +import org.gradle.tooling.internal.provider.connection.ProviderOperationParameters; +import org.gradle.tooling.internal.provider.serialization.PayloadSerializer; +import org.gradle.tooling.internal.provider.serialization.SerializedPayload; +import org.gradle.tooling.internal.provider.test.ProviderInternalTestExecutionRequest; +import org.gradle.tooling.model.build.BuildEnvironment; +import org.gradle.util.GradleVersion; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.io.InputStream; +import java.util.Collections; +import java.util.EnumSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import static java.util.Collections.emptySet; + +public class ProviderConnection { + private static final Logger LOGGER = LoggerFactory.getLogger(ProviderConnection.class); + private final PayloadSerializer payloadSerializer; + private final BuildLayoutFactory buildLayoutFactory; + private final DaemonClientFactory daemonClientFactory; + private final BuildActionExecuter embeddedExecutor; + private final ServiceRegistry sharedServices; + private final JvmVersionDetector jvmVersionDetector; + private final FileCollectionFactory fileCollectionFactory; + private GradleVersion consumerVersion; + + public ProviderConnection(ServiceRegistry sharedServices, BuildLayoutFactory buildLayoutFactory, DaemonClientFactory daemonClientFactory, + BuildActionExecuter embeddedExecutor, PayloadSerializer payloadSerializer, JvmVersionDetector jvmVersionDetector, FileCollectionFactory fileCollectionFactory) { + this.buildLayoutFactory = buildLayoutFactory; + this.daemonClientFactory = daemonClientFactory; + this.embeddedExecutor = embeddedExecutor; + this.payloadSerializer = payloadSerializer; + this.sharedServices = sharedServices; + this.jvmVersionDetector = jvmVersionDetector; + this.fileCollectionFactory = fileCollectionFactory; + } + + public void configure(ProviderConnectionParameters parameters, GradleVersion consumerVersion) { + this.consumerVersion = consumerVersion; + LogLevel providerLogLevel = parameters.getVerboseLogging() ? LogLevel.DEBUG : LogLevel.INFO; + LOGGER.debug("Configuring logging to level: {}", providerLogLevel); + LoggingManagerInternal loggingManager = sharedServices.newInstance(LoggingManagerInternal.class); + loggingManager.setLevelInternal(providerLogLevel); + loggingManager.start(); + } + + public Object run(String modelName, BuildCancellationToken cancellationToken, ProviderOperationParameters providerParameters) { + List tasks = providerParameters.getTasks(); + if (modelName.equals(ModelIdentifier.NULL_MODEL) && tasks == null) { + throw new IllegalArgumentException("No model type or tasks specified."); + } + Parameters params = initParams(providerParameters); + if (BuildEnvironment.class.getName().equals(modelName)) { + //we don't really need to launch the daemon to acquire information needed for BuildEnvironment + if (tasks != null) { + throw new IllegalArgumentException("Cannot run tasks and fetch the build environment model."); + } + return new DefaultBuildEnvironment( + new DefaultBuildIdentifier(providerParameters.getProjectDir()), + params.buildLayout.getGradleUserHomeDir(), + GradleVersion.current().getVersion(), + params.daemonParams.getEffectiveJvm().getJavaHome(), + params.daemonParams.getEffectiveJvmArgs()); + } + + StartParameterInternal startParameter = new ProviderStartParameterConverter().toStartParameter(providerParameters, params.buildLayout, params.properties); + ProgressListenerConfiguration listenerConfig = ProgressListenerConfiguration.from(providerParameters, consumerVersion); + BuildAction action = new BuildModelAction(startParameter, modelName, tasks != null, listenerConfig.clientSubscriptions); + return run(action, cancellationToken, listenerConfig, listenerConfig.buildEventConsumer, providerParameters, params); + } + + @SuppressWarnings({"deprecation", "overloads"}) + public Object run(org.gradle.tooling.internal.protocol.InternalBuildAction clientAction, BuildCancellationToken cancellationToken, ProviderOperationParameters providerParameters) { + return runClientAction(clientAction, cancellationToken, providerParameters); + } + + @SuppressWarnings("overloads") + public Object run(InternalBuildActionVersion2 clientAction, BuildCancellationToken cancellationToken, ProviderOperationParameters providerParameters) { + return runClientAction(clientAction, cancellationToken, providerParameters); + } + + public Object runClientAction(Object clientAction, BuildCancellationToken cancellationToken, ProviderOperationParameters providerParameters) { + List tasks = providerParameters.getTasks(); + SerializedPayload serializedAction = payloadSerializer.serialize(clientAction); + Parameters params = initParams(providerParameters); + StartParameterInternal startParameter = new ProviderStartParameterConverter().toStartParameter(providerParameters, params.buildLayout, params.properties); + ProgressListenerConfiguration listenerConfig = ProgressListenerConfiguration.from(providerParameters, consumerVersion); + BuildAction action = new ClientProvidedBuildAction(startParameter, serializedAction, tasks != null, listenerConfig.clientSubscriptions); + return run(action, cancellationToken, listenerConfig, listenerConfig.buildEventConsumer, providerParameters, params); + } + + public Object runPhasedAction(InternalPhasedAction clientPhasedAction, + PhasedActionResultListener resultListener, + BuildCancellationToken cancellationToken, + ProviderOperationParameters providerParameters) { + List tasks = providerParameters.getTasks(); + SerializedPayload serializedAction = payloadSerializer.serialize(clientPhasedAction); + Parameters params = initParams(providerParameters); + StartParameterInternal startParameter = new ProviderStartParameterConverter().toStartParameter(providerParameters, params.buildLayout, params.properties); + FailsafePhasedActionResultListener failsafePhasedActionResultListener = new FailsafePhasedActionResultListener(resultListener); + ProgressListenerConfiguration listenerConfig = ProgressListenerConfiguration.from(providerParameters, consumerVersion); + BuildAction action = new ClientProvidedPhasedAction(startParameter, serializedAction, tasks != null, listenerConfig.clientSubscriptions); + try { + return run(action, cancellationToken, listenerConfig, new PhasedActionEventConsumer(failsafePhasedActionResultListener, payloadSerializer, listenerConfig.buildEventConsumer), + providerParameters, params); + } finally { + failsafePhasedActionResultListener.rethrowErrors(); + } + } + + public Object runTests(ProviderInternalTestExecutionRequest testExecutionRequest, BuildCancellationToken cancellationToken, ProviderOperationParameters providerParameters) { + Parameters params = initParams(providerParameters); + StartParameterInternal startParameter = new ProviderStartParameterConverter().toStartParameter(providerParameters, params.buildLayout, params.properties); + ProgressListenerConfiguration listenerConfig = ProgressListenerConfiguration.from(providerParameters, consumerVersion); + TestExecutionRequestAction action = TestExecutionRequestAction.create(listenerConfig.clientSubscriptions, startParameter, testExecutionRequest); + return run(action, cancellationToken, listenerConfig, listenerConfig.buildEventConsumer, providerParameters, params); + } + + public void notifyDaemonsAboutChangedPaths(List changedPaths, ProviderOperationParameters providerParameters) { + LoggingServiceRegistry loggingServices = LoggingServiceRegistry.newNestedLogging(); + Parameters params = initParams(providerParameters); + ServiceRegistry clientServices = daemonClientFactory.createMessageDaemonServices(loggingServices.get(OutputEventListener.class), params.daemonParams); + NotifyDaemonAboutChangedPathsClient client = clientServices.get(NotifyDaemonAboutChangedPathsClient.class); + client.notifyDaemonsAboutChangedPaths(changedPaths); + } + + public void stopWhenIdle(ProviderOperationParameters providerParameters) { + LoggingServiceRegistry loggingServices = LoggingServiceRegistry.newNestedLogging(); + Parameters params = initParams(providerParameters); + ServiceRegistry clientServices = daemonClientFactory.createMessageDaemonServices(loggingServices.get(OutputEventListener.class), params.daemonParams); + ((ShutdownCoordinator) clientServices.find(ShutdownCoordinator.class)).stop(); + } + + private Object run(BuildAction action, BuildCancellationToken cancellationToken, + ProgressListenerConfiguration progressListenerConfiguration, + BuildEventConsumer buildEventConsumer, + ProviderOperationParameters providerParameters, + Parameters parameters) { + try { + BuildActionExecuter executer = createExecuter(providerParameters, parameters); + boolean interactive = providerParameters.getStandardInput() != null; + BuildRequestContext buildRequestContext = new DefaultBuildRequestContext(new DefaultBuildRequestMetaData(providerParameters.getStartTime(), interactive), cancellationToken, buildEventConsumer); + BuildActionResult result = executer.execute(action, new ConnectionOperationParameters(parameters.daemonParams, providerParameters), buildRequestContext); + throwFailure(result); + return payloadSerializer.deserialize(result.getResult()); + } finally { + progressListenerConfiguration.failsafeWrapper.rethrowErrors(); + } + } + + private void throwFailure(BuildActionResult result) { + if (result.getException() != null) { + throw map(result, result.getException()); + } + if (result.getFailure() != null) { + throw map(result, (RuntimeException) payloadSerializer.deserialize(result.getFailure())); + } + } + + private RuntimeException map(BuildActionResult result, RuntimeException exception) { + // Wrap build failure in 'cancelled' cross version exception + if (result.wasCancelled()) { + throw new InternalBuildCancelledException(exception); + } + + // Forward special cases directly to consumer + if (exception instanceof InternalTestExecutionException || exception instanceof InternalBuildActionFailureException || exception instanceof InternalUnsupportedModelException) { + return exception; + } + + // Wrap in generic 'build failed' cross version exception + throw new BuildExceptionVersion1(exception); + } + + private BuildActionExecuter createExecuter(ProviderOperationParameters operationParameters, Parameters params) { + LoggingManagerInternal loggingManager; + BuildActionExecuter executer; + InputStream standardInput = operationParameters.getStandardInput(); + if (standardInput == null) { + standardInput = SafeStreams.emptyInput(); + } + if (Boolean.TRUE.equals(operationParameters.isEmbedded())) { + loggingManager = sharedServices.getFactory(LoggingManagerInternal.class).create(); + loggingManager.captureSystemSources(); + executer = new StdInSwapExecuter(standardInput, embeddedExecutor); + } else { + LoggingServiceRegistry loggingServices = LoggingServiceRegistry.newNestedLogging(); + loggingManager = loggingServices.getFactory(LoggingManagerInternal.class).create(); + ServiceRegistry clientServices = daemonClientFactory.createBuildClientServices(loggingServices.get(OutputEventListener.class), params.daemonParams, standardInput); + executer = clientServices.get(DaemonClient.class); + } + return new LoggingBridgingBuildActionExecuter(new DaemonBuildActionExecuter(executer), loggingManager); + } + + private Parameters initParams(ProviderOperationParameters operationParameters) { + CommandLineParser commandLineParser = new CommandLineParser(); + commandLineParser.allowUnknownOptions(); + commandLineParser.allowMixedSubcommandsAndOptions(); + + InitialPropertiesConverter initialPropertiesConverter = new InitialPropertiesConverter(); + BuildLayoutConverter buildLayoutConverter = new BuildLayoutConverter(); + initialPropertiesConverter.configure(commandLineParser); + buildLayoutConverter.configure(commandLineParser); + + ParsedCommandLine parsedCommandLine = commandLineParser.parse(operationParameters.getArguments() == null ? Collections.emptyList() : operationParameters.getArguments()); + + InitialProperties initialProperties = initialPropertiesConverter.convert(parsedCommandLine); + BuildLayoutResult buildLayoutResult = buildLayoutConverter.convert(initialProperties, parsedCommandLine, operationParameters.getProjectDir(), layout -> { + if (operationParameters.getGradleUserHomeDir() != null) { + layout.setGradleUserHomeDir(operationParameters.getGradleUserHomeDir()); + } + Boolean searchUpwards = operationParameters.isSearchUpwards(); + if (searchUpwards != null) { + layout.setSearchUpwards(searchUpwards); + } + layout.setProjectDir(operationParameters.getProjectDir()); + }); + + AllProperties properties = new LayoutToPropertiesConverter(buildLayoutFactory).convert(initialProperties, buildLayoutResult); + + DaemonParameters daemonParams = new DaemonParameters(buildLayoutResult, fileCollectionFactory); + new DaemonBuildOptions().propertiesConverter().convert(properties.getProperties(), daemonParams); + if (operationParameters.getDaemonBaseDir() != null) { + daemonParams.setBaseDir(operationParameters.getDaemonBaseDir()); + } + + //override the params with the explicit settings provided by the tooling api + List jvmArguments = operationParameters.getJvmArguments(); + if (jvmArguments != null) { + daemonParams.setJvmArgs(jvmArguments); + } + + // Include the system properties that are defined in the daemon JVM args + properties = properties.merge(daemonParams.getSystemProperties()); + + Map envVariables = operationParameters.getEnvironmentVariables(null); + if (envVariables != null) { + daemonParams.setEnvironmentVariables(envVariables); + } + + File javaHome = operationParameters.getJavaHome(); + if (javaHome != null) { + daemonParams.setJvm(Jvm.forHome(javaHome)); + } + daemonParams.applyDefaultsFor(jvmVersionDetector.getJavaVersion(daemonParams.getEffectiveJvm())); + + if (operationParameters.getDaemonMaxIdleTimeValue() != null && operationParameters.getDaemonMaxIdleTimeUnits() != null) { + int idleTimeout = (int) operationParameters.getDaemonMaxIdleTimeUnits().toMillis(operationParameters.getDaemonMaxIdleTimeValue()); + daemonParams.setIdleTimeout(idleTimeout); + } + + return new Parameters(daemonParams, buildLayoutResult, properties); + } + + private static class Parameters { + final DaemonParameters daemonParams; + final BuildLayoutResult buildLayout; + final AllProperties properties; + + public Parameters(DaemonParameters daemonParams, BuildLayoutResult buildLayout, AllProperties properties) { + this.daemonParams = daemonParams; + this.buildLayout = buildLayout; + this.properties = properties; + } + } + + private static final class BuildProgressListenerInvokingBuildEventConsumer implements BuildEventConsumer { + private final InternalBuildProgressListener buildProgressListener; + + private BuildProgressListenerInvokingBuildEventConsumer(InternalBuildProgressListener buildProgressListener) { + this.buildProgressListener = buildProgressListener; + } + + @Override + public void dispatch(Object event) { + if (event instanceof InternalProgressEvent) { + this.buildProgressListener.onEvent(event); + } + } + } + + @VisibleForTesting + static final class ProgressListenerConfiguration { + + private static final Map OPERATION_TYPE_MAPPING = ImmutableMap.builderWithExpectedSize(OperationType.values().length) + .put(InternalBuildProgressListener.TEST_EXECUTION, OperationType.TEST) + .put(InternalBuildProgressListener.TASK_EXECUTION, OperationType.TASK) + .put(InternalBuildProgressListener.WORK_ITEM_EXECUTION, OperationType.WORK_ITEM) + .put(InternalBuildProgressListener.PROJECT_CONFIGURATION_EXECUTION, OperationType.PROJECT_CONFIGURATION) + .put(InternalBuildProgressListener.TRANSFORM_EXECUTION, OperationType.TRANSFORM) + .put(InternalBuildProgressListener.BUILD_EXECUTION, OperationType.GENERIC) + .put(InternalBuildProgressListener.TEST_OUTPUT, OperationType.TEST_OUTPUT) + .build(); + + private final BuildEventSubscriptions clientSubscriptions; + private final FailsafeBuildProgressListenerAdapter failsafeWrapper; + private final BuildEventConsumer buildEventConsumer; + + ProgressListenerConfiguration(BuildEventSubscriptions clientSubscriptions, BuildEventConsumer buildEventConsumer, FailsafeBuildProgressListenerAdapter failsafeWrapper) { + this.clientSubscriptions = clientSubscriptions; + this.buildEventConsumer = buildEventConsumer; + this.failsafeWrapper = failsafeWrapper; + } + + @VisibleForTesting + BuildEventSubscriptions getClientSubscriptions() { + return clientSubscriptions; + } + + @VisibleForTesting + static ProgressListenerConfiguration from(ProviderOperationParameters providerParameters, GradleVersion consumerVersion) { + InternalBuildProgressListener buildProgressListener = providerParameters.getBuildProgressListener(); + Set operationTypes = toOperationTypes(buildProgressListener, consumerVersion); + BuildEventSubscriptions clientSubscriptions = new BuildEventSubscriptions(operationTypes); + FailsafeBuildProgressListenerAdapter wrapper = new FailsafeBuildProgressListenerAdapter(buildProgressListener); + BuildEventConsumer buildEventConsumer = clientSubscriptions.isAnyOperationTypeRequested() ? new BuildProgressListenerInvokingBuildEventConsumer(wrapper) : new NoOpBuildEventConsumer(); + if (Boolean.TRUE.equals(providerParameters.isEmbedded())) { + // Contract requires build events are delivered by a single thread. This is taken care of by the daemon client when not in embedded mode + // Need to apply some synchronization when in embedded mode + buildEventConsumer = new SynchronizedConsumer(buildEventConsumer); + } + return new ProgressListenerConfiguration(clientSubscriptions, buildEventConsumer, wrapper); + } + + private static Set toOperationTypes(InternalBuildProgressListener buildProgressListener, GradleVersion consumerVersion) { + if (buildProgressListener != null) { + Set operationTypes = EnumSet.noneOf(OperationType.class); + for (String operation : buildProgressListener.getSubscribedOperations()) { + if (OPERATION_TYPE_MAPPING.containsKey(operation)) { + operationTypes.add(OPERATION_TYPE_MAPPING.get(operation)); + } + } + if (consumerVersion.compareTo(GradleVersion.version("5.1")) < 0) { + // Some types were split out of 'generic' type in 5.1, so include these when the consumer requests 'generic' + if (operationTypes.contains(OperationType.GENERIC)) { + operationTypes.add(OperationType.PROJECT_CONFIGURATION); + operationTypes.add(OperationType.TRANSFORM); + operationTypes.add(OperationType.WORK_ITEM); + } + } + return operationTypes; + } + return emptySet(); + } + + private static class SynchronizedConsumer implements BuildEventConsumer { + private final BuildEventConsumer delegate; + + public SynchronizedConsumer(BuildEventConsumer delegate) { + this.delegate = delegate; + } + + @Override + public void dispatch(Object message) { + synchronized (this) { + delegate.dispatch(message); + } + } + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/logging/org/gradle/internal/logging/console/UserInputStandardOutputRenderer.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/logging/org/gradle/internal/logging/console/UserInputStandardOutputRenderer.java new file mode 100644 index 0000000..1ac6b09 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/logging/org/gradle/internal/logging/console/UserInputStandardOutputRenderer.java @@ -0,0 +1,39 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.logging.console; + +import org.gradle.internal.logging.events.OutputEventListener; +import org.gradle.internal.logging.events.PromptOutputEvent; + +public class UserInputStandardOutputRenderer extends AbstractUserInputRenderer { + public UserInputStandardOutputRenderer(OutputEventListener delegate) { + super(delegate); + } + + @Override + void startInput() { + } + + @Override + void handlePrompt(PromptOutputEvent event) { + delegate.onOutput(event); + } + + @Override + void finishInput() { + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/logging/org/gradle/internal/logging/progress/ProgressLoggerFactory.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/logging/org/gradle/internal/logging/progress/ProgressLoggerFactory.java new file mode 100644 index 0000000..c3d893e --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/logging/org/gradle/internal/logging/progress/ProgressLoggerFactory.java @@ -0,0 +1,56 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.logging.progress; + +import org.gradle.internal.operations.BuildOperationDescriptor; +import org.gradle.internal.scan.UsedByScanPlugin; + +/** + * Thread-safe, however the progress logger instances created are not. + */ +@UsedByScanPlugin("test-distribution") +public interface ProgressLoggerFactory { + /** + * Creates a new long-running operation which has not been started. + * + * @param loggerCategory The logger category. + * @return The progress logger for the operation. + */ + ProgressLogger newOperation(String loggerCategory); + + /** + * Creates a new long-running operation which has not been started. + * + * @param loggerCategory The logger category. + * @return The progress logger for the operation. + */ + @UsedByScanPlugin("test-distribution") + ProgressLogger newOperation(Class loggerCategory); + + /** + * Creates a new long-running operation which has not been started, associated + * with the given build operation id. + * + * @param loggerCategory The logger category. + * @param buildOperationDescriptor descriptor for the build operation associated with this logger. + * @return the progress logger for the operation. + */ + ProgressLogger newOperation(Class loggerCategory, BuildOperationDescriptor buildOperationDescriptor); + + @UsedByScanPlugin("test-distribution") + ProgressLogger newOperation(Class loggerClass, ProgressLogger parent); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/logging/org/gradle/internal/logging/serializer/ProgressEventSerializer.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/logging/org/gradle/internal/logging/serializer/ProgressEventSerializer.java new file mode 100644 index 0000000..f0230b4 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/logging/org/gradle/internal/logging/serializer/ProgressEventSerializer.java @@ -0,0 +1,40 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.logging.serializer; + +import org.gradle.internal.operations.OperationIdentifier; +import org.gradle.internal.logging.events.ProgressEvent; +import org.gradle.internal.serialize.Decoder; +import org.gradle.internal.serialize.Encoder; +import org.gradle.internal.serialize.Serializer; + +public class ProgressEventSerializer implements Serializer { + @Override + public void write(Encoder encoder, ProgressEvent event) throws Exception { + encoder.writeSmallLong(event.getProgressOperationId().getId()); + encoder.writeString(event.getStatus()); + encoder.writeBoolean(event.isFailing()); + } + + @Override + public ProgressEvent read(Decoder decoder) throws Exception { + OperationIdentifier id = new OperationIdentifier(decoder.readSmallLong()); + String status = decoder.readString(); + boolean failing = decoder.readBoolean(); + return new ProgressEvent(id, status, failing); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/logging/org/gradle/logging/ProgressLoggerFactory.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/logging/org/gradle/logging/ProgressLoggerFactory.java new file mode 100644 index 0000000..79a5b68 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/logging/org/gradle/logging/ProgressLoggerFactory.java @@ -0,0 +1,26 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.logging; + +/** + * DO NOT REMOVE. + * + * @deprecated This is here because tasks implemented in Groovy that are compiled against older versions of Gradle have this type baked into their byte-code, and cannot be loaded if it's not found. + */ +@Deprecated +public interface ProgressLoggerFactory { +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/maven/org/gradle/api/artifacts/maven/Conf2ScopeMappingContainer.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/maven/org/gradle/api/artifacts/maven/Conf2ScopeMappingContainer.java new file mode 100644 index 0000000..ba596fc --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/maven/org/gradle/api/artifacts/maven/Conf2ScopeMappingContainer.java @@ -0,0 +1,87 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.artifacts.maven; + +import org.gradle.api.artifacts.Configuration; + +import java.util.Collection; +import java.util.Map; + +/** + * Defines a set of rules for how to map the Gradle dependencies to a POM. This mapping is based + * on the configuration the dependencies belong to. + */ +@Deprecated +public interface Conf2ScopeMappingContainer { + String PROVIDED = "provided"; + String COMPILE = "compile"; + String RUNTIME = "runtime"; + String TEST = "test"; + + /** + *

Specifies that dependencies of a certain configuration should be mapped against a certain + * Maven scope. A configuration can be mapped to one and only one scope. If this method is called + * more than once for a particular configuration, the last call wins.

+ * + * See {@link #getMapping(java.util.Collection)} for the rules how a scope is chosen from a set of mappings. + * + * @param priority a number that is used for comparison with the priority of other scopes. + * @param configuration a Gradle configuration name (must not be null). + * @param scope A Maven scope name (must not be null) + * @return this + * @see #getMapping(java.util.Collection) + */ + Conf2ScopeMappingContainer addMapping(int priority, Configuration configuration, String scope); + + /** + * Returns a scope that corresponds to the given configurations. Dependencies of different configurations can + * be equal. But only one of those equals dependencies (which might differ in content) can be mapped to a POM + * (due to the nature of a Maven POM). + * + *

Which scope is returned depends on the existing mappings. See {@link #addMapping(int, Configuration, String)}. If + * only one configuration is mapped, this mapping is used to choose the scope. If more than one configuration of a + * dependency is mapped, and those mappings all map to the same scope, this scope is used. If more than one + * configuration is mapped and the mappings map to different scopes, the mapping with the highest priority is used. + * If there is more than one mapping with the highest priority and those mappings map to different scopes, an + * exception is thrown.

+ * + * @param configurations The configuration + * @return The scope corresponding to the given configurations. Returns null if no such scope can be found. + * @see #addMapping(int, Configuration, String) + */ + Conf2ScopeMapping getMapping(Collection configurations); + + /** + * Returns a map with all the configuration to scope mappings. If no such mapping has been defined, + * an empty map is returned. + * + * @see #addMapping(int, Configuration, String) + */ + Map getMappings(); + + /** + * Returns whether unmapped configuration should be skipped or not. Defaults to true. + * @see #setSkipUnmappedConfs(boolean) + */ + boolean isSkipUnmappedConfs(); + + /** + * Sets, whether unmapped configuration should be skipped or not. If this is set to + * false, dependencies belonging to unmapped configurations will be added to the Maven POM with no + * scope specified. This means they belong to the Maven default scope, which is 'compile'. + */ + void setSkipUnmappedConfs(boolean skipDependenciesWithUnmappedConfiguration); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/maven/org/gradle/api/publication/maven/internal/wagon/RepositoryTransportDeployWagon.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/maven/org/gradle/api/publication/maven/internal/wagon/RepositoryTransportDeployWagon.java new file mode 100644 index 0000000..dc68fc7 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/maven/org/gradle/api/publication/maven/internal/wagon/RepositoryTransportDeployWagon.java @@ -0,0 +1,325 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.publication.maven.internal.wagon; + +import org.apache.maven.wagon.ConnectionException; +import org.apache.maven.wagon.ResourceDoesNotExistException; +import org.apache.maven.wagon.TransferFailedException; +import org.apache.maven.wagon.Wagon; +import org.apache.maven.wagon.authentication.AuthenticationException; +import org.apache.maven.wagon.authentication.AuthenticationInfo; +import org.apache.maven.wagon.events.SessionEvent; +import org.apache.maven.wagon.events.SessionEventSupport; +import org.apache.maven.wagon.events.SessionListener; +import org.apache.maven.wagon.events.TransferEvent; +import org.apache.maven.wagon.events.TransferEventSupport; +import org.apache.maven.wagon.events.TransferListener; +import org.apache.maven.wagon.proxy.ProxyInfo; +import org.apache.maven.wagon.proxy.ProxyInfoProvider; +import org.apache.maven.wagon.repository.Repository; +import org.apache.maven.wagon.resource.Resource; +import org.gradle.api.GradleException; +import org.gradle.internal.resource.ReadableContent; +import org.gradle.internal.resource.local.FileReadableContent; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.util.Date; +import java.util.List; + +import static org.apache.maven.wagon.events.SessionEvent.SESSION_DISCONNECTING; +import static org.apache.maven.wagon.events.SessionEvent.SESSION_LOGGED_IN; +import static org.apache.maven.wagon.events.SessionEvent.SESSION_LOGGED_OFF; +import static org.apache.maven.wagon.events.SessionEvent.SESSION_OPENED; +import static org.apache.maven.wagon.events.TransferEvent.REQUEST_GET; +import static org.apache.maven.wagon.events.TransferEvent.REQUEST_PUT; +import static org.apache.maven.wagon.events.TransferEvent.TRANSFER_COMPLETED; +import static org.apache.maven.wagon.events.TransferEvent.TRANSFER_INITIATED; +import static org.apache.maven.wagon.events.TransferEvent.TRANSFER_STARTED; + +/** + * A maven wagon intended to work with {@link org.apache.maven.artifact.manager.DefaultWagonManager} Maven uses reflection to initialize instances of this wagon see: {@link + * org.codehaus.plexus.component.factory.java.JavaComponentFactory#newInstance(org.codehaus.plexus.component.repository.ComponentDescriptor, org.codehaus.classworlds.ClassRealm, + * org.codehaus.plexus.PlexusContainer)} + */ +public class RepositoryTransportDeployWagon implements Wagon { + + private static final ThreadLocal CURRENT_DELEGATE = new InheritableThreadLocal(); + + private SessionEventSupport sessionEventSupport = new SessionEventSupport(); + private TransferEventSupport transferEventSupport = new TransferEventSupport(); + private Repository mutatingRepository; + + public static void contextualize(RepositoryTransportWagonAdapter adapter) { + CURRENT_DELEGATE.set(adapter); + } + + public static void decontextualize() { + CURRENT_DELEGATE.remove(); + } + + @Override + public final void get(String resourceName, File destination) throws TransferFailedException, ResourceDoesNotExistException { + Resource resource = new Resource(resourceName); + this.transferEventSupport.fireTransferInitiated(transferEvent(resource, TRANSFER_INITIATED, REQUEST_GET)); + this.transferEventSupport.fireTransferStarted(transferEvent(resource, TRANSFER_STARTED, REQUEST_GET)); + try { + if (!destination.exists()) { + destination.getParentFile().mkdirs(); + destination.createNewFile(); + } + if (!getDelegate().getRemoteFile(destination, resourceName)) { + throw new ResourceDoesNotExistException(String.format("Resource '%s' does not exist", resourceName)); + } + this.transferEventSupport.fireTransferCompleted(transferEvent(resource, TRANSFER_COMPLETED, REQUEST_GET)); + } catch (ResourceDoesNotExistException e) { + this.transferEventSupport.fireTransferError(transferEvent(resource, e, REQUEST_GET)); + throw e; + } catch (Exception e) { + this.transferEventSupport.fireTransferError(transferEvent(resource, e, REQUEST_GET)); + throw new TransferFailedException(String.format("Could not get resource '%s'", resourceName), e); + } + } + + @Override + public final void put(File file, String resourceName) throws TransferFailedException { + Resource resource = new Resource(resourceName); + this.transferEventSupport.fireTransferInitiated(transferEvent(resource, TRANSFER_INITIATED, REQUEST_PUT)); + try { + ReadableContent content = new MavenTransferLoggingFileResource(file, resource); + getDelegate().putRemoteFile(content, resourceName); + } catch (Exception e) { + this.transferEventSupport.fireTransferError(transferEvent(resource, e, REQUEST_PUT)); + throw new TransferFailedException(String.format("Could not write to resource '%s'", resourceName), e); + } + this.transferEventSupport.fireTransferCompleted(transferEvent(resource, TRANSFER_COMPLETED, REQUEST_PUT)); + } + + private RepositoryTransportWagonAdapter getDelegate() { + return CURRENT_DELEGATE.get(); + } + + @Override + public final boolean resourceExists(String resourceName) { + throwNotImplemented("getIfNewer(String resourceName, File file, long timestamp)"); + return false; + } + + @Override + public final boolean getIfNewer(String resourceName, File file, long timestamp) { + throwNotImplemented("getIfNewer(String resourceName, File file, long timestamp)"); + return false; + } + + @Override + public final void putDirectory(File file, String resourceName) { + throwNotImplemented("putDirectory(File file, String resourceName)"); + } + + @Override + public final List getFileList(String resourceName) { + throwNotImplemented("getFileList(String resourceName)"); + return null; + } + + @Override + public final boolean supportsDirectoryCopy() { + return false; + } + + @Override + public final Repository getRepository() { + return this.mutatingRepository; + } + + @Override + public final void openConnection() { + } + + @Override + public final void connect(Repository repository) { + this.mutatingRepository = repository; + this.sessionEventSupport.fireSessionLoggedIn(sessionEvent(SESSION_LOGGED_IN)); + this.sessionEventSupport.fireSessionOpened(sessionEvent(SESSION_OPENED)); + } + + @Override + public final void connect(Repository repository, ProxyInfo proxyInfo) throws ConnectionException, AuthenticationException { + connect(repository); + } + + @Override + public final void connect(Repository repository, ProxyInfoProvider proxyInfoProvider) throws ConnectionException, AuthenticationException { + connect(repository); + } + + @Override + public final void connect(Repository repository, AuthenticationInfo authenticationInfo) throws ConnectionException, AuthenticationException { + connect(repository); + } + + @Override + public final void connect(Repository repository, AuthenticationInfo authenticationInfo, ProxyInfo proxyInfo) throws ConnectionException, AuthenticationException { + connect(repository); + } + + @Override + public final void connect(Repository repository, AuthenticationInfo authenticationInfo, ProxyInfoProvider proxyInfoProvider) throws ConnectionException, AuthenticationException { + connect(repository); + } + + @Override + public final void disconnect() { + this.sessionEventSupport.fireSessionDisconnecting(sessionEvent(SESSION_DISCONNECTING)); + this.sessionEventSupport.fireSessionLoggedOff(sessionEvent(SESSION_LOGGED_OFF)); + this.sessionEventSupport.fireSessionDisconnected(sessionEvent(SESSION_LOGGED_OFF)); + } + + @Override + public final void addSessionListener(SessionListener sessionListener) { + this.sessionEventSupport.addSessionListener(sessionListener); + } + + @Override + public final void removeSessionListener(SessionListener sessionListener) { + this.sessionEventSupport.removeSessionListener(sessionListener); + } + + @Override + public final boolean hasSessionListener(SessionListener sessionListener) { + return this.sessionEventSupport.hasSessionListener(sessionListener); + } + + @Override + public final void addTransferListener(TransferListener transferListener) { + this.transferEventSupport.addTransferListener(transferListener); + } + + @Override + public final void removeTransferListener(TransferListener transferListener) { + this.transferEventSupport.removeTransferListener(transferListener); + } + + @Override + public final boolean hasTransferListener(TransferListener transferListener) { + return this.transferEventSupport.hasTransferListener(transferListener); + } + + @Override + public final boolean isInteractive() { + return false; + } + + @Override + public final void setInteractive(boolean b) { + + } + + @Override + public final void setTimeout(int i) { + + } + + @Override + public final int getTimeout() { + return 0; + } + + @Override + public final void setReadTimeout(int i) { + + } + + @Override + public final int getReadTimeout() { + return 0; + } + + private SessionEvent sessionEvent(int e) { + return new SessionEvent(this, e); + } + + private void throwNotImplemented(String s) { + throw new GradleException("This wagon does not yet support the method:" + s); + } + + private TransferEvent transferEvent(Resource resource, int eventType, int requestType) { + TransferEvent transferEvent = new TransferEvent(this, resource, eventType, requestType); + transferEvent.setTimestamp(new Date().getTime()); + return transferEvent; + } + + private TransferEvent transferEvent(Resource resource, Exception e, int requestType) { + return new TransferEvent(this, resource, e, requestType); + } + + private class MavenTransferLoggingFileResource extends FileReadableContent { + private final Resource resource; + + private MavenTransferLoggingFileResource(File file, Resource resource) { + super(file); + this.resource = resource; + } + + @Override + public InputStream open() { + // Need to do this here, so that the transfer is 'restarted' when HttpClient reopens the resource (DIGEST AUTH only) + transferEventSupport.fireTransferStarted(transferEvent(resource, TRANSFER_STARTED, REQUEST_PUT)); + return new ObservingInputStream(super.open(), resource); + } + + protected class ObservingInputStream extends InputStream { + private final InputStream inputStream; + private final TransferEvent transferEvent; + private final byte[] singleByteBuffer = new byte[1]; + + public ObservingInputStream(InputStream inputStream, Resource resource) { + this.inputStream = inputStream; + this.transferEvent = transferEvent(resource, TransferEvent.TRANSFER_PROGRESS, REQUEST_PUT); + } + + @Override + public void close() throws IOException { + inputStream.close(); + } + + @Override + public int read() throws IOException { + int result = inputStream.read(); + if (result >= 0) { + singleByteBuffer[0] = (byte) result; + logTransfer(singleByteBuffer, 1); + } + return result; + } + + @Override + public int read(byte[] b, int off, int len) throws IOException { + int read = inputStream.read(b, off, len); + if (read > 0) { + logTransfer(b, read); + } + return read; + } + + private void logTransfer(byte[] bytes, int read) { + transferEventSupport.fireTransferProgress(transferEvent, bytes, read); + } + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/maven/org/gradle/api/publish/maven/MavenArtifactSet.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/maven/org/gradle/api/publish/maven/MavenArtifactSet.java new file mode 100644 index 0000000..87d93dd --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/maven/org/gradle/api/publish/maven/MavenArtifactSet.java @@ -0,0 +1,62 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.publish.maven; + +import org.gradle.api.Action; +import org.gradle.api.DomainObjectSet; + +/** + * A Collection of {@link MavenArtifact}s to be included in a {@link MavenPublication}. + * + * Being a {@link DomainObjectSet}, a {@code MavenArtifactSet} provides convenient methods for querying, filtering, and applying actions to the set of {@link MavenArtifact}s. + * + *
+ * plugins {
+ *     id 'maven-publish'
+ * }
+ *
+ * def publication = publishing.publications.create("name", MavenPublication)
+ * def artifacts = publication.artifacts
+ *
+ * artifacts.matching({
+ *     it.classifier == "classy"
+ * }).all({
+ *     it.extension = "ext"
+ * })
+ * 
+ * + * @see DomainObjectSet + */ +public interface MavenArtifactSet extends DomainObjectSet { + /** + * Creates and adds a {@link MavenArtifact} to the set. + * + * The semantics of this method are the same as {@link MavenPublication#artifact(Object)}. + * + * @param source The source of the artifact content. + */ + MavenArtifact artifact(Object source); + + /** + * Creates and adds a {@link MavenArtifact} to the set, which is configured by the associated action. + * + * The semantics of this method are the same as {@link MavenPublication#artifact(Object, Action)}. + * + * @param source The source of the artifact. + * @param config An action or closure to configure the values of the constructed {@link MavenArtifact}. + */ + MavenArtifact artifact(Object source, Action config); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/maven/org/gradle/api/publish/maven/internal/tasks/MavenPomFileGenerator.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/maven/org/gradle/api/publish/maven/internal/tasks/MavenPomFileGenerator.java new file mode 100644 index 0000000..ea587b1 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/maven/org/gradle/api/publish/maven/internal/tasks/MavenPomFileGenerator.java @@ -0,0 +1,409 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.publish.maven.internal.tasks; + +import com.google.common.base.Joiner; +import com.google.common.collect.Iterables; +import org.apache.maven.model.CiManagement; +import org.apache.maven.model.Contributor; +import org.apache.maven.model.Dependency; +import org.apache.maven.model.DependencyManagement; +import org.apache.maven.model.Developer; +import org.apache.maven.model.DistributionManagement; +import org.apache.maven.model.Exclusion; +import org.apache.maven.model.IssueManagement; +import org.apache.maven.model.License; +import org.apache.maven.model.MailingList; +import org.apache.maven.model.Model; +import org.apache.maven.model.Organization; +import org.apache.maven.model.Relocation; +import org.apache.maven.model.Scm; +import org.apache.maven.model.io.xpp3.MavenXpp3Writer; +import org.gradle.api.Action; +import org.gradle.api.UncheckedIOException; +import org.gradle.api.XmlProvider; +import org.gradle.api.artifacts.DependencyArtifact; +import org.gradle.api.artifacts.ExcludeRule; +import org.gradle.api.artifacts.ModuleVersionIdentifier; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.MetaDataParser; +import org.gradle.api.internal.attributes.ImmutableAttributes; +import org.gradle.api.provider.Provider; +import org.gradle.api.publication.maven.internal.VersionRangeMapper; +import org.gradle.api.publish.internal.versionmapping.VersionMappingStrategyInternal; +import org.gradle.api.publish.maven.MavenDependency; +import org.gradle.api.publish.maven.MavenPomCiManagement; +import org.gradle.api.publish.maven.MavenPomContributor; +import org.gradle.api.publish.maven.MavenPomDeveloper; +import org.gradle.api.publish.maven.MavenPomIssueManagement; +import org.gradle.api.publish.maven.MavenPomLicense; +import org.gradle.api.publish.maven.MavenPomMailingList; +import org.gradle.api.publish.maven.MavenPomOrganization; +import org.gradle.api.publish.maven.MavenPomRelocation; +import org.gradle.api.publish.maven.MavenPomScm; +import org.gradle.api.publish.maven.internal.dependencies.MavenDependencyInternal; +import org.gradle.api.publish.maven.internal.publication.MavenPomDistributionManagementInternal; +import org.gradle.api.publish.maven.internal.publication.MavenPomInternal; +import org.gradle.api.publish.maven.internal.publisher.MavenProjectIdentity; +import org.gradle.internal.xml.XmlTransformer; +import org.gradle.util.GUtil; + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.Map; +import java.util.Properties; + +public class MavenPomFileGenerator { + + private static final String POM_FILE_ENCODING = "UTF-8"; + private static final String POM_VERSION = "4.0.0"; + private static final Action ADD_GRADLE_METADATA_MARKER = new Action() { + @Override + public void execute(XmlProvider xmlProvider) { + StringBuilder builder = xmlProvider.asString(); + int idx = builder.indexOf("\n"; + } + + public MavenPomFileGenerator configureFrom(MavenPomInternal pom) { + model.setPackaging(pom.getPackaging()); + model.setName(pom.getName().getOrNull()); + model.setDescription(pom.getDescription().getOrNull()); + model.setUrl(pom.getUrl().getOrNull()); + model.setInceptionYear(pom.getInceptionYear().getOrNull()); + if (pom.getOrganization() != null) { + model.setOrganization(convertOrganization(pom.getOrganization())); + } + if (pom.getScm() != null) { + model.setScm(convertScm(pom.getScm())); + } + if (pom.getIssueManagement() != null) { + model.setIssueManagement(convertIssueManagement(pom.getIssueManagement())); + } + if (pom.getCiManagement() != null) { + model.setCiManagement(convertCiManagement(pom.getCiManagement())); + } + if (pom.getDistributionManagement() != null) { + model.setDistributionManagement(convertDistributionManagement(pom.getDistributionManagement())); + } + for (MavenPomLicense license : pom.getLicenses()) { + model.addLicense(convertLicense(license)); + } + for (MavenPomDeveloper developer : pom.getDevelopers()) { + model.addDeveloper(convertDeveloper(developer)); + } + for (MavenPomContributor contributor : pom.getContributors()) { + model.addContributor(convertContributor(contributor)); + } + for (MavenPomMailingList mailingList : pom.getMailingLists()) { + model.addMailingList(convertMailingList(mailingList)); + } + for (Map.Entry property : pom.getProperties().get().entrySet()) { + model.addProperty(property.getKey(), property.getValue()); + } + return this; + } + + private Organization convertOrganization(MavenPomOrganization source) { + Organization target = new Organization(); + target.setName(source.getName().getOrNull()); + target.setUrl(source.getUrl().getOrNull()); + return target; + } + + private License convertLicense(MavenPomLicense source) { + License target = new License(); + target.setName(source.getName().getOrNull()); + target.setUrl(source.getUrl().getOrNull()); + target.setDistribution(source.getDistribution().getOrNull()); + target.setComments(source.getComments().getOrNull()); + return target; + } + + private Developer convertDeveloper(MavenPomDeveloper source) { + Developer target = new Developer(); + target.setId(source.getId().getOrNull()); + target.setName(source.getName().getOrNull()); + target.setEmail(source.getEmail().getOrNull()); + target.setUrl(source.getUrl().getOrNull()); + target.setOrganization(source.getOrganization().getOrNull()); + target.setOrganizationUrl(source.getOrganizationUrl().getOrNull()); + target.setRoles(new ArrayList(source.getRoles().get())); + target.setTimezone(source.getTimezone().getOrNull()); + target.setProperties(convertProperties(source.getProperties())); + return target; + } + + private Contributor convertContributor(MavenPomContributor source) { + Contributor target = new Contributor(); + target.setName(source.getName().getOrNull()); + target.setEmail(source.getEmail().getOrNull()); + target.setUrl(source.getUrl().getOrNull()); + target.setOrganization(source.getOrganization().getOrNull()); + target.setOrganizationUrl(source.getOrganizationUrl().getOrNull()); + target.setRoles(new ArrayList(source.getRoles().get())); + target.setTimezone(source.getTimezone().getOrNull()); + target.setProperties(convertProperties(source.getProperties())); + return target; + } + + private Properties convertProperties(Provider> source) { + Properties target = new Properties(); + target.putAll(source.getOrElse(Collections.emptyMap())); + return target; + } + + private Scm convertScm(MavenPomScm source) { + Scm target = new Scm(); + target.setConnection(source.getConnection().getOrNull()); + target.setDeveloperConnection(source.getDeveloperConnection().getOrNull()); + target.setUrl(source.getUrl().getOrNull()); + target.setTag(source.getTag().getOrNull()); + return target; + } + + private IssueManagement convertIssueManagement(MavenPomIssueManagement source) { + IssueManagement target = new IssueManagement(); + target.setSystem(source.getSystem().getOrNull()); + target.setUrl(source.getUrl().getOrNull()); + return target; + } + + private CiManagement convertCiManagement(MavenPomCiManagement source) { + CiManagement target = new CiManagement(); + target.setSystem(source.getSystem().getOrNull()); + target.setUrl(source.getUrl().getOrNull()); + return target; + } + + private DistributionManagement convertDistributionManagement(MavenPomDistributionManagementInternal source) { + DistributionManagement target = new DistributionManagement(); + target.setDownloadUrl(source.getDownloadUrl().getOrNull()); + if (source.getRelocation() != null) { + target.setRelocation(convertRelocation(source.getRelocation())); + } + return target; + } + + private Relocation convertRelocation(MavenPomRelocation source) { + Relocation target = new Relocation(); + target.setGroupId(source.getGroupId().getOrNull()); + target.setArtifactId(source.getArtifactId().getOrNull()); + target.setVersion(source.getVersion().getOrNull()); + target.setMessage(source.getMessage().getOrNull()); + return target; + } + + private MailingList convertMailingList(MavenPomMailingList source) { + MailingList target = new MailingList(); + target.setName(source.getName().getOrNull()); + target.setSubscribe(source.getSubscribe().getOrNull()); + target.setUnsubscribe(source.getUnsubscribe().getOrNull()); + target.setPost(source.getPost().getOrNull()); + target.setArchive(source.getArchive().getOrNull()); + target.setOtherArchives(new ArrayList(source.getOtherArchives().get())); + return target; + } + + public void addApiDependencyManagement(MavenDependency apiDependency) { + addDependencyManagement(apiDependency, "compile"); + } + + public void addRuntimeDependencyManagement(MavenDependency dependency) { + addDependencyManagement(dependency, "runtime"); + } + + public void addImportDependencyManagement(MavenDependency dependency) { + addDependencyManagement(dependency, "import"); + } + + public void addRuntimeDependency(MavenDependencyInternal dependency) { + addDependency(dependency, "runtime"); + } + + public void addOptionalDependency(MavenDependencyInternal optionalDependency) { + // For Maven we don't really know if an optional dependency is required for runtime or compile + // so we use the safest: compile + addDependency(optionalDependency, "compile", true); + } + + public void addApiDependency(MavenDependencyInternal apiDependency) { + addDependency(apiDependency, "compile"); + } + + private void addDependency(MavenDependencyInternal mavenDependency, String scope) { + addDependency(mavenDependency, scope, false); + } + + private void addDependency(MavenDependencyInternal mavenDependency, String scope, boolean optional) { + if (mavenDependency.getArtifacts().size() == 0) { + addDependency(mavenDependency, mavenDependency.getArtifactId(), scope, null, null, optional); + } else { + for (DependencyArtifact artifact : mavenDependency.getArtifacts()) { + addDependency(mavenDependency, artifact.getName(), scope, artifact.getType(), artifact.getClassifier(), optional); + } + } + } + + private void addDependency(MavenDependencyInternal dependency, String artifactId, String scope, String type, String classifier, boolean optional) { + Dependency mavenDependency = new Dependency(); + String groupId = dependency.getGroupId(); + String dependencyVersion = dependency.getVersion(); + ImmutableAttributes attributes = attributesForScope(scope); + ModuleVersionIdentifier resolvedVersion = versionMappingStrategy.findStrategyForVariant(attributes).maybeResolveVersion(groupId, artifactId); + mavenDependency.setGroupId(resolvedVersion != null ? resolvedVersion.getGroup() : groupId); + mavenDependency.setArtifactId(resolvedVersion != null ? resolvedVersion.getName() : artifactId); + mavenDependency.setVersion(resolvedVersion != null ? resolvedVersion.getVersion() : mapToMavenSyntax(dependencyVersion)); + mavenDependency.setType(type); + mavenDependency.setScope(scope); + mavenDependency.setClassifier(classifier); + if (optional) { + // Not using setOptional(optional) in order to avoid false in the common case + mavenDependency.setOptional(true); + } + + for (ExcludeRule excludeRule : dependency.getExcludeRules()) { + Exclusion exclusion = new Exclusion(); + exclusion.setGroupId(GUtil.elvis(excludeRule.getGroup(), "*")); + exclusion.setArtifactId(GUtil.elvis(excludeRule.getModule(), "*")); + mavenDependency.addExclusion(exclusion); + } + + model.addDependency(mavenDependency); + } + + private ImmutableAttributes attributesForScope(String scope) { + if ("compile".equals(scope)) { + return compileScopeAttributes; + } else if ("runtime".equals(scope) || "import".equals(scope)) { + return runtimeScopeAttributes; + } + throw new IllegalStateException("Unexpected scope : " + scope); + } + + private void addDependencyManagement(MavenDependency dependency, String scope) { + Dependency mavenDependency = new Dependency(); + String groupId = dependency.getGroupId(); + String artifactId = dependency.getArtifactId(); + ImmutableAttributes attributes = attributesForScope(scope); + ModuleVersionIdentifier resolvedVersion = versionMappingStrategy.findStrategyForVariant(attributes).maybeResolveVersion(groupId, artifactId); + mavenDependency.setGroupId(resolvedVersion != null ? resolvedVersion.getGroup() : groupId); + mavenDependency.setArtifactId(resolvedVersion != null ? resolvedVersion.getName() : artifactId); + mavenDependency.setVersion(resolvedVersion == null ? mapToMavenSyntax(dependency.getVersion()) : resolvedVersion.getVersion()); + String type = dependency.getType(); + if (type != null) { + mavenDependency.setType(type); + } + // Only publish the import scope, others have too different meanings than what Gradle expresses + if ("import".equals(scope)) { + mavenDependency.setScope(scope); + } + + DependencyManagement dependencyManagement = model.getDependencyManagement(); + if (dependencyManagement == null) { + dependencyManagement = new DependencyManagement(); + model.setDependencyManagement(dependencyManagement); + } + dependencyManagement.addDependency(mavenDependency); + } + + private String mapToMavenSyntax(String version) { + return versionRangeMapper.map(version); + } + + public MavenPomFileGenerator withXml(final Action action) { + xmlTransformer.addAction(action); + return this; + } + + public MavenPomFileGenerator writeTo(File file) { + writeTo(file, model, xmlTransformer); + return this; + } + + public MavenPomSpec toSpec() { + return new MavenPomSpec( + model, + xmlTransformer + ); + } + + public static class MavenPomSpec { + + private final Model model; + private final XmlTransformer xmlTransformer; + + public MavenPomSpec(Model model, XmlTransformer xmlTransformer) { + this.model = model; + this.xmlTransformer = xmlTransformer; + } + + public void writeTo(File file) { + MavenPomFileGenerator.writeTo(file, model, xmlTransformer); + } + } + + private static void writeTo(File file, Model model, XmlTransformer xmlTransformer) { + xmlTransformer.transform(file, POM_FILE_ENCODING, writer -> { + try { + new MavenXpp3Writer().write(writer, model); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + }); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/messaging/org/gradle/internal/dispatch/Dispatch.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/messaging/org/gradle/internal/dispatch/Dispatch.java new file mode 100644 index 0000000..a69477e --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/messaging/org/gradle/internal/dispatch/Dispatch.java @@ -0,0 +1,31 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.internal.dispatch; + +/** + * A general purpose sink for a stream of messages. + * + *

Implementations are not required to be thread-safe. + */ +public interface Dispatch { + /** + * Dispatches the next message. Blocks until the messages has been accepted but generally does not wait for the + * message to be processed. Delivery guarantees are implementation specific. + * + * @param message The message. + */ + void dispatch(T message); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/messaging/org/gradle/internal/remote/internal/hub/MethodInvocationSerializer.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/messaging/org/gradle/internal/remote/internal/hub/MethodInvocationSerializer.java new file mode 100644 index 0000000..bbe49fe --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/messaging/org/gradle/internal/remote/internal/hub/MethodInvocationSerializer.java @@ -0,0 +1,158 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.remote.internal.hub; + +import org.gradle.internal.serialize.*; +import org.gradle.internal.dispatch.MethodInvocation; + +import java.io.IOException; +import java.lang.reflect.Method; +import java.util.HashMap; +import java.util.Map; + +public class MethodInvocationSerializer implements StatefulSerializer { + private final ClassLoader classLoader; + private final MethodArgsSerializer methodArgsSerializer; + + public MethodInvocationSerializer(ClassLoader classLoader, MethodArgsSerializer methodArgsSerializer) { + this.classLoader = classLoader; + this.methodArgsSerializer = methodArgsSerializer; + } + + @Override + public ObjectReader newReader(Decoder decoder) { + return new MethodInvocationReader(decoder, classLoader, methodArgsSerializer); + } + + @Override + public ObjectWriter newWriter(Encoder encoder) { + return new MethodInvocationWriter(encoder, methodArgsSerializer); + } + + private static class MethodDetails { + final int methodId; + final Method method; + final Serializer argsSerializer; + + MethodDetails(int methodId, Method method, Serializer argsSerializer) { + this.methodId = methodId; + this.method = method; + this.argsSerializer = argsSerializer; + } + } + + private static class MethodInvocationWriter implements ObjectWriter { + private final Encoder encoder; + private final MethodArgsSerializer methodArgsSerializer; + private final Map methods = new HashMap(); + + MethodInvocationWriter(Encoder encoder, MethodArgsSerializer methodArgsSerializer) { + this.encoder = encoder; + this.methodArgsSerializer = methodArgsSerializer; + } + + @Override + public void write(MethodInvocation value) throws Exception { + if (value.getArguments().length != value.getMethod().getParameterTypes().length) { + throw new IllegalArgumentException(String.format("Mismatched number of parameters to method %s.", value.getMethod())); + } + MethodDetails methodDetails = writeMethod(value.getMethod()); + writeArgs(methodDetails, value); + } + + private void writeArgs(MethodDetails methodDetails, MethodInvocation value) throws Exception { + methodDetails.argsSerializer.write(encoder, value.getArguments()); + } + + private MethodDetails writeMethod(Method method) throws IOException { + MethodDetails methodDetails = methods.get(method); + if (methodDetails == null) { + int methodId = methods.size(); + methodDetails = new MethodDetails(methodId, method, methodArgsSerializer.forTypes(method.getParameterTypes())); + methods.put(method, methodDetails); + encoder.writeSmallInt(methodId); + encoder.writeString(method.getDeclaringClass().getName()); + encoder.writeString(method.getName()); + encoder.writeSmallInt(method.getParameterTypes().length); + for (int i = 0; i < method.getParameterTypes().length; i++) { + Class paramType = method.getParameterTypes()[i]; + encoder.writeString(paramType.getName()); + } + } else { + encoder.writeSmallInt(methodDetails.methodId); + } + return methodDetails; + } + } + + private static class MethodInvocationReader implements ObjectReader { + private static final Map> PRIMITIVE_TYPES; + static { + PRIMITIVE_TYPES = new HashMap>(); + PRIMITIVE_TYPES.put(Integer.TYPE.getName(), Integer.TYPE); + } + + private final Decoder decoder; + private final ClassLoader classLoader; + private final MethodArgsSerializer methodArgsSerializer; + private final Map methods = new HashMap(); + + MethodInvocationReader(Decoder decoder, ClassLoader classLoader, MethodArgsSerializer methodArgsSerializer) { + this.decoder = decoder; + this.classLoader = classLoader; + this.methodArgsSerializer = methodArgsSerializer; + } + + @Override + public MethodInvocation read() throws Exception { + MethodDetails methodDetails = readMethod(); + Object[] args = readArguments(methodDetails); + return new MethodInvocation(methodDetails.method, args); + } + + private Object[] readArguments(MethodDetails methodDetails) throws Exception { + return methodDetails.argsSerializer.read(decoder); + } + + private MethodDetails readMethod() throws ClassNotFoundException, NoSuchMethodException, IOException { + int methodId = decoder.readSmallInt(); + MethodDetails methodDetails = methods.get(methodId); + if (methodDetails == null) { + Class declaringClass = readType(); + String methodName = decoder.readString(); + int paramCount = decoder.readSmallInt(); + Class[] paramTypes = new Class[paramCount]; + for (int i = 0; i < paramTypes.length; i++) { + paramTypes[i] = readType(); + } + Method method = declaringClass.getDeclaredMethod(methodName, paramTypes); + methodDetails = new MethodDetails(methodId, method, methodArgsSerializer.forTypes(method.getParameterTypes())); + methods.put(methodId, methodDetails); + } + return methodDetails; + } + + private Class readType() throws ClassNotFoundException, IOException { + String typeName = decoder.readString(); + Class paramType = PRIMITIVE_TYPES.get(typeName); + if (paramType == null) { + paramType = Class.forName(typeName, false, classLoader); + } + return paramType; + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/messaging/org/gradle/internal/remote/internal/hub/StreamFailureHandler.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/messaging/org/gradle/internal/remote/internal/hub/StreamFailureHandler.java new file mode 100644 index 0000000..42d8426 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/messaging/org/gradle/internal/remote/internal/hub/StreamFailureHandler.java @@ -0,0 +1,27 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.remote.internal.hub; + +/** + * A handler for messages that fail while streaming to the peer, either on the sending side or on the receiving side + */ +public interface StreamFailureHandler { + /** + * Called when notification of a streaming failure is received on an incoming channel. + */ + void handleStreamFailure(Throwable t); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/messaging/org/gradle/internal/remote/internal/inet/TcpOutgoingConnector.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/messaging/org/gradle/internal/remote/internal/inet/TcpOutgoingConnector.java new file mode 100644 index 0000000..ab6d787 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/messaging/org/gradle/internal/remote/internal/inet/TcpOutgoingConnector.java @@ -0,0 +1,109 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.remote.internal.inet; + +import org.gradle.internal.UncheckedException; +import org.gradle.internal.remote.Address; +import org.gradle.internal.remote.internal.ConnectCompletion; +import org.gradle.internal.remote.internal.OutgoingConnector; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.IOException; +import java.net.*; +import java.nio.channels.SocketChannel; +import java.util.List; + +public class TcpOutgoingConnector implements OutgoingConnector { + private static final Logger LOGGER = LoggerFactory.getLogger(TcpOutgoingConnector.class); + private static final int CONNECT_TIMEOUT = 10000; + + @Override + public ConnectCompletion connect(Address destinationAddress) throws org.gradle.internal.remote.internal.ConnectException { + if (!(destinationAddress instanceof InetEndpoint)) { + throw new IllegalArgumentException(String.format("Cannot create a connection to address of unknown type: %s.", destinationAddress)); + } + InetEndpoint address = (InetEndpoint) destinationAddress; + LOGGER.debug("Attempting to connect to {}.", address); + + // Try each address in turn. Not all of them are necessarily reachable (eg when socket option IPV6_V6ONLY + // is on - the default for debian and others), so we will try each of them until we can connect + List candidateAddresses = address.getCandidates(); + + // Now try each address + try { + Exception lastFailure = null; + for (InetAddress candidate : candidateAddresses) { + LOGGER.debug("Trying to connect to address {}.", candidate); + SocketChannel socketChannel; + try { + socketChannel = tryConnect(address, candidate); + } catch (SocketException e) { + LOGGER.debug("Cannot connect to address {}, skipping.", candidate); + lastFailure = e; + continue; + } catch (SocketTimeoutException e) { + LOGGER.debug("Timeout connecting to address {}, skipping.", candidate); + lastFailure = e; + continue; + } + LOGGER.debug("Connected to address {}.", socketChannel.socket().getRemoteSocketAddress()); + return new SocketConnectCompletion(socketChannel); + } + throw new org.gradle.internal.remote.internal.ConnectException(String.format("Could not connect to server %s. Tried addresses: %s.", + destinationAddress, candidateAddresses), lastFailure); + } catch (org.gradle.internal.remote.internal.ConnectException e) { + throw e; + } catch (Exception e) { + throw new RuntimeException(String.format("Could not connect to server %s. Tried addresses: %s.", + destinationAddress, candidateAddresses), e); + } + } + + private SocketChannel tryConnect(InetEndpoint address, InetAddress candidate) throws IOException { + SocketChannel socketChannel = SocketChannel.open(); + + try { + socketChannel.socket().connect(new InetSocketAddress(candidate, address.getPort()), CONNECT_TIMEOUT); + + if (!detectSelfConnect(socketChannel)) { + return socketChannel; + } + socketChannel.close(); + } catch (IOException e) { + socketChannel.close(); + throw e; + } catch (Throwable e) { + socketChannel.close(); + throw UncheckedException.throwAsUncheckedException(e); + } + + throw new java.net.ConnectException(String.format("Socket connected to itself on %s port %s.", candidate, address.getPort())); + } + + boolean detectSelfConnect(SocketChannel socketChannel) { + Socket socket = socketChannel.socket(); + SocketAddress localAddress = socket.getLocalSocketAddress(); + SocketAddress remoteAddress = socket.getRemoteSocketAddress(); + if (localAddress.equals(remoteAddress)) { + LOGGER.debug("Detected that socket was bound to {} while connecting to {}. This looks like the socket connected to itself.", + localAddress, remoteAddress); + return true; + } + return false; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/messaging/org/gradle/internal/serialize/AbstractSerializer.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/messaging/org/gradle/internal/serialize/AbstractSerializer.java new file mode 100644 index 0000000..5caeff5 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/messaging/org/gradle/internal/serialize/AbstractSerializer.java @@ -0,0 +1,40 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.serialize; + +import com.google.common.base.Objects; + +/** + * This abstract class provide a sensible default implementation for {@code Serializer} equality. This equality + * implementation is required to enable cache instance reuse within the same Gradle runtime. Serializers are used + * as cache parameter which need to be compared to determine compatible cache. + */ +public abstract class AbstractSerializer implements Serializer { + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + + return Objects.equal(obj.getClass(), getClass()); + } + + @Override + public int hashCode() { + return Objects.hashCode(getClass()); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/model-core/org/gradle/internal/instantiation/generator/ConstructorSelector.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/model-core/org/gradle/internal/instantiation/generator/ConstructorSelector.java new file mode 100644 index 0000000..d8620b1 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/model-core/org/gradle/internal/instantiation/generator/ConstructorSelector.java @@ -0,0 +1,46 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.instantiation.generator; + +/** + * Encapsulates the differences, due to backwards compatibility, in instantiation for several different types. + */ +interface ConstructorSelector { + /** + * Allows this selector to veto the parameters to use with the given constructor. + */ + void vetoParameters(ClassGenerator.GeneratedConstructor constructor, Object[] parameters); + + /** + * Locates the constructor that should be used to create instances of the given type with the given params. + * + *

The selected constructor does not have to accept the given parameters. It is the caller's responsibility to verify that the constructor can be + * called with the given parameters. + * + *

The selector may or may not allow null parameters. The caller should allow null parameters and delegate to the selector to make this decision. + * + *

The selector may or may not allow instances of non-static inner classes to be created.

+ */ + ClassGenerator.GeneratedConstructor forParams(Class type, Object[] params); + + /** + * Locates the constructor that should be used to create instances of the given type. + * + * @throws UnsupportedOperationException When this selector requires the parameters in order to select a constructor. + */ + ClassGenerator.GeneratedConstructor forType(Class type) throws UnsupportedOperationException; +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/model-core/org/gradle/internal/instantiation/generator/Jsr330ConstructorSelector.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/model-core/org/gradle/internal/instantiation/generator/Jsr330ConstructorSelector.java new file mode 100644 index 0000000..7c1def2 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/model-core/org/gradle/internal/instantiation/generator/Jsr330ConstructorSelector.java @@ -0,0 +1,103 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.instantiation.generator; + +import org.gradle.api.Transformer; +import org.gradle.cache.internal.CrossBuildInMemoryCache; +import org.gradle.internal.Cast; +import org.gradle.internal.logging.text.TreeFormatter; + +import java.lang.reflect.Modifier; + +class Jsr330ConstructorSelector implements ConstructorSelector { + private final CrossBuildInMemoryCache, CachedConstructor> constructorCache; + private final ClassGenerator classGenerator; + + public Jsr330ConstructorSelector(ClassGenerator classGenerator, CrossBuildInMemoryCache, CachedConstructor> constructorCache) { + this.constructorCache = constructorCache; + this.classGenerator = classGenerator; + } + + @Override + public void vetoParameters(ClassGenerator.GeneratedConstructor constructor, Object[] parameters) { + for (Object param : parameters) { + if (param == null) { + TreeFormatter formatter = new TreeFormatter(); + formatter.node("Null value provided in parameters "); + formatter.appendValues(parameters); + throw new IllegalArgumentException(formatter.toString()); + } + } + } + + @Override + public ClassGenerator.GeneratedConstructor forParams(Class type, Object[] params) { + return forType(type); + } + + @Override + public ClassGenerator.GeneratedConstructor forType(final Class type) throws UnsupportedOperationException { + CachedConstructor constructor = constructorCache.get(type, new Transformer>() { + @Override + public CachedConstructor transform(Class aClass) { + try { + validateType(type); + ClassGenerator.GeneratedClass implClass = classGenerator.generate(type); + ClassGenerator.GeneratedConstructor constructor = InjectUtil.selectConstructor(implClass, type); + return CachedConstructor.of(constructor); + } catch (RuntimeException e) { + return CachedConstructor.of(e); + } + } + }); + return Cast.uncheckedCast(constructor.getConstructor()); + } + + private static void validateType(Class type) { + if (!type.isInterface() && type.getEnclosingClass() != null && !Modifier.isStatic(type.getModifiers())) { + TreeFormatter formatter = new TreeFormatter(); + formatter.node(type); + formatter.append(" is a non-static inner class."); + throw new IllegalArgumentException(formatter.toString()); + } + } + + public static class CachedConstructor { + private final ClassGenerator.GeneratedConstructor constructor; + private final RuntimeException error; + + private CachedConstructor(ClassGenerator.GeneratedConstructor constructor, RuntimeException error) { + this.constructor = constructor; + this.error = error; + } + + public ClassGenerator.GeneratedConstructor getConstructor() { + if (error != null) { + throw error; + } + return constructor; + } + + public static CachedConstructor of(ClassGenerator.GeneratedConstructor ctor) { + return new CachedConstructor(ctor, null); + } + + public static CachedConstructor of(RuntimeException err) { + return new CachedConstructor(null, err); + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/model-core/org/gradle/model/ModelElement.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/model-core/org/gradle/model/ModelElement.java new file mode 100644 index 0000000..aecf0fc --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/model-core/org/gradle/model/ModelElement.java @@ -0,0 +1,38 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.model; + +import org.gradle.api.Incubating; +import org.gradle.api.Named; + +/** + * Represents an element in a model. Elements are arranged in a hierarchy. + */ +@Incubating +public interface ModelElement extends Named { + /** + * Returns the name of this element. Each element has a name associated with it, that uniquely identifies the element amongst its siblings. + * Some element have their name generated or automatically assigned, and for these elements the name may not be human consumable. + */ + @Override + String getName(); + + /** + * Returns a human-consumable display name for this element. + */ + String getDisplayName(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/model-core/org/gradle/model/internal/core/EmptyReferenceProjection.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/model-core/org/gradle/model/internal/core/EmptyReferenceProjection.java new file mode 100644 index 0000000..d220b14 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/model-core/org/gradle/model/internal/core/EmptyReferenceProjection.java @@ -0,0 +1,40 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.model.internal.core; + +import com.google.common.base.Optional; +import org.gradle.model.internal.core.rule.describe.ModelRuleDescriptor; +import org.gradle.model.internal.type.ModelType; + +/** + * Projection used to resolve the type of a reference node when the target is {@code null}. + */ +public class EmptyReferenceProjection extends TypeCompatibilityModelProjectionSupport { + public EmptyReferenceProjection(ModelType type) { + super(type); + } + + @Override + protected ModelView toView(MutableModelNode modelNode, ModelRuleDescriptor ruleDescriptor, boolean writable) { + return InstanceModelView.of(modelNode.getPath(), getType(), null); + } + + @Override + public Optional getValueDescription(MutableModelNode mutableModelNode) { + return Optional.absent(); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/model-core/org/gradle/model/internal/inspect/MethodRuleAction.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/model-core/org/gradle/model/internal/inspect/MethodRuleAction.java new file mode 100644 index 0000000..11dc556 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/model-core/org/gradle/model/internal/inspect/MethodRuleAction.java @@ -0,0 +1,31 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.model.internal.inspect; + +import org.gradle.model.internal.core.ModelReference; +import org.gradle.model.internal.core.ModelView; +import org.gradle.model.internal.core.MutableModelNode; + +import java.util.List; + +public interface MethodRuleAction { + ModelReference getSubject(); + + List> getInputs(); + + void execute(ModelRuleInvoker invoker, MutableModelNode modelNode, List> inputs); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/model-core/org/gradle/model/internal/registry/NodeAtState.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/model-core/org/gradle/model/internal/registry/NodeAtState.java new file mode 100644 index 0000000..0144d48 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/model-core/org/gradle/model/internal/registry/NodeAtState.java @@ -0,0 +1,61 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.model.internal.registry; + +import org.gradle.model.internal.core.ModelNode; +import org.gradle.model.internal.core.ModelPath; + +class NodeAtState implements Comparable { + public final ModelPath path; + public final ModelNode.State state; + + public NodeAtState(ModelPath path, ModelNode.State state) { + this.path = path; + this.state = state; + } + + @Override + public String toString() { + return "node " + path + " at state " + state; + } + + @Override + public int compareTo(NodeAtState other) { + int diff = path.compareTo(other.path); + if (diff != 0) { + return diff; + } + return state.compareTo(other.state); + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj == null || obj.getClass() != getClass()) { + return false; + } + NodeAtState other = (NodeAtState) obj; + return path.equals(other.path) && state.equals(other.state); + } + + @Override + public int hashCode() { + return path.hashCode() ^ state.hashCode(); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/model-core/org/gradle/model/internal/typeregistration/BaseInstanceFactory.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/model-core/org/gradle/model/internal/typeregistration/BaseInstanceFactory.java new file mode 100644 index 0000000..258a0fd --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/model-core/org/gradle/model/internal/typeregistration/BaseInstanceFactory.java @@ -0,0 +1,406 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.model.internal.typeregistration; + +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.ImmutableSortedSet; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import org.gradle.internal.Cast; +import org.gradle.internal.MutableReference; +import org.gradle.internal.reflect.Types.TypeVisitor; +import org.gradle.model.Managed; +import org.gradle.model.internal.core.MutableModelNode; +import org.gradle.model.internal.core.rule.describe.ModelRuleDescriptor; +import org.gradle.model.internal.type.ModelType; +import org.gradle.model.internal.type.ModelTypes; + +import javax.annotation.Nullable; +import java.lang.reflect.Modifier; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import static org.gradle.internal.reflect.Types.walkTypeHierarchy; + +public class BaseInstanceFactory implements InstanceFactory { + private final ModelType baseInterface; + private final Map, TypeRegistration> registrations = Maps.newLinkedHashMap(); + private final Map, ImplementationFactory> factories = Maps.newLinkedHashMap(); + + public BaseInstanceFactory(Class baseInterface) { + this.baseInterface = ModelType.of(baseInterface); + } + + @Override + public ModelType getBaseInterface() { + return baseInterface; + } + + public void register(ModelType publicType, Set> internalViews, @Nullable ModelType implementationType, ModelRuleDescriptor definedBy) { + TypeRegistrationBuilder registration = register(publicType, definedBy); + if (implementationType != null) { + registration.withImplementation(implementationType); + } + for (Class internalView : internalViews) { + registration.withInternalView(ModelType.of(internalView)); + } + } + + /** + * Registers a factory to use to create all implementation objects of the given type and its subtypes. The most specific match is used. + */ + public void registerFactory(Class implementationType, ImplementationFactory implementationFactory) { + factories.put(implementationType, implementationFactory); + } + + public TypeRegistrationBuilder register(ModelType publicType, ModelRuleDescriptor source) { + TypeRegistration registration = Cast.uncheckedCast(registrations.get(publicType)); + if (registration == null) { + registration = new TypeRegistration(publicType); + registrations.put(publicType, registration); + } + return new TypeRegistrationBuilderImpl(source, registration); + } + + @Override @Nullable + public ImplementationInfo getImplementationInfo(ModelType publicType) { + ImplementationRegistration implementationRegistration = getImplementationRegistration(publicType); + if (implementationRegistration == null) { + return null; + } + return new ImplementationInfoImpl(publicType, implementationRegistration, getInternalViews(publicType)); + } + + @Override + public ImplementationInfo getManagedSubtypeImplementationInfo(final ModelType publicType) { + if (!isManaged(publicType)) { + throw new IllegalArgumentException(String.format("Type '%s' is not managed", publicType)); + } + final MutableReference> implementationInfo = MutableReference.empty(); + walkTypeHierarchy(publicType.getConcreteClass(), new RegistrationHierarchyVisitor() { + @Override + protected void visitRegistration(TypeRegistration registration) { + if (registration == null || registration.implementationRegistration == null) { + return; + } + ImplementationInfoImpl currentImplementationInfo = implementationInfo.get(); + if (currentImplementationInfo == null || currentImplementationInfo.implementationRegistration.implementationType.isAssignableFrom(registration.implementationRegistration.implementationType)) { + implementationInfo.set(new ImplementationInfoImpl(publicType, registration.implementationRegistration, getInternalViews(publicType))); + } + } + }); + + if (implementationInfo.get() == null) { + throw new IllegalStateException(String.format("Factory registration for '%s' is invalid because it doesn't extend an interface with a default implementation", publicType)); + } + return implementationInfo.get(); + } + + private Set> getInternalViews(ModelType publicType) { + final ImmutableSet.Builder> builder = ImmutableSet.builder(); + walkTypeHierarchy(publicType.getConcreteClass(), new RegistrationHierarchyVisitor() { + @Override + protected void visitRegistration(TypeRegistration registration) { + for (InternalViewRegistration internalViewRegistration : registration.internalViewRegistrations) { + builder.add(internalViewRegistration.getInternalView()); + } + } + }); + return builder.build(); + } + + @Override + public Set> getSupportedTypes() { + ImmutableSortedSet.Builder> supportedTypes = ImmutableSortedSet.orderedBy(ModelTypes.displayOrder()); + for (TypeRegistration registration : registrations.values()) { + if (registration.isConstructible()) { + supportedTypes.add(registration.publicType); + } + } + return supportedTypes.build(); + } + + private TypeRegistration getRegistration(ModelType type) { + return Cast.uncheckedCast(registrations.get(type)); + } + + private ImplementationRegistration getImplementationRegistration(ModelType type) { + TypeRegistration registration = getRegistration(type); + if (registration == null) { + return null; + } + if (registration.implementationRegistration == null) { + throw new IllegalArgumentException( + String.format("Cannot create a '%s' because this type does not have an implementation registered.", type)); + } + return registration.implementationRegistration; + } + + public void validateRegistrations() { + for (TypeRegistration registration : registrations.values()) { + registration.validate(); + } + } + + private static boolean isManaged(ModelType type) { + return type.isAnnotationPresent(Managed.class); + } + + public interface ImplementationFactory { + T create(ModelType publicType, ModelType implementationType, String name, MutableModelNode node); + } + + public interface TypeRegistrationBuilder { + TypeRegistrationBuilder withImplementation(ModelType implementationType); + + TypeRegistrationBuilder withInternalView(ModelType internalView); + } + + private class TypeRegistrationBuilderImpl implements TypeRegistrationBuilder { + private final ModelRuleDescriptor source; + private final TypeRegistration registration; + + public TypeRegistrationBuilderImpl(ModelRuleDescriptor source, TypeRegistration registration) { + this.source = source; + this.registration = registration; + } + + @Override + public TypeRegistrationBuilder withImplementation(ModelType implementationType) { + registration.setImplementation(implementationType, source); + return this; + } + + @Override + public TypeRegistrationBuilder withInternalView(ModelType internalView) { + registration.addInternalView(internalView, source); + return this; + } + } + + private class TypeRegistration { + private final ModelType publicType; + private final boolean managedPublicType; + private ImplementationRegistration implementationRegistration; + private final List> internalViewRegistrations = Lists.newArrayList(); + + public TypeRegistration(ModelType publicType) { + this.publicType = publicType; + this.managedPublicType = isManaged(publicType); + } + + public void setImplementation(ModelType implementationType, ModelRuleDescriptor source) { + if (implementationRegistration != null) { + throw new IllegalStateException(String.format("Cannot register implementation for type '%s' because an implementation for this type was already registered by %s", + publicType, implementationRegistration.getSource())); + } + if (managedPublicType) { + throw new IllegalArgumentException(String.format("Cannot specify default implementation for managed type '%s'", publicType)); + } + if (Modifier.isAbstract(implementationType.getConcreteClass().getModifiers())) { + throw new IllegalArgumentException(String.format("Implementation type '%s' registered for '%s' must not be abstract", implementationType, publicType)); + } + Class implementationClass = implementationType.getConcreteClass(); + ImplementationFactory factory = findFactory(implementationClass); + if (factory == null) { + throw new IllegalArgumentException(String.format("No factory registered to create an instance of implementation class '%s'.", implementationType)); + } + this.implementationRegistration = new ImplementationRegistration(source, implementationType, factory); + } + + public void addInternalView(ModelType internalView, ModelRuleDescriptor source) { + if (!internalView.getConcreteClass().isInterface()) { + throw new IllegalArgumentException(String.format("Internal view '%s' registered for '%s' must be an interface", internalView, publicType)); + } + + if (managedPublicType && !isManaged(internalView)) { + throw new IllegalArgumentException(String.format("Internal view '%s' registered for managed type '%s' must be managed", internalView, publicType)); + } + internalViewRegistrations.add(new InternalViewRegistration(source, internalView)); + } + + public void validate() { + if (managedPublicType) { + validateManaged(); + } else { + validateUnmanaged(); + } + } + + public boolean isConstructible() { + return managedPublicType || implementationRegistration != null; + } + + private void validateManaged() { + ImplementationInfo implementationInfo = getManagedSubtypeImplementationInfo(publicType); + ModelType delegateType = implementationInfo.getDelegateType(); + for (InternalViewRegistration internalViewRegistration : internalViewRegistrations) { + validateManagedInternalView(internalViewRegistration, delegateType); + } + } + + private void validateManagedInternalView(final InternalViewRegistration internalViewRegistration, final ModelType delegateType) { + walkTypeHierarchy(internalViewRegistration.getInternalView().getConcreteClass(), new TypeVisitor() { + @Override + public void visitType(Class type) { + if (!type.isAnnotationPresent(Managed.class) + && !type.isAssignableFrom(delegateType.getConcreteClass())) { + throw new IllegalStateException(String.format("Factory registration for '%s' is invalid because the default implementation type '%s' does not implement unmanaged internal view '%s', " + + "internal view was registered by %s", + publicType, delegateType, ModelType.of(type), + internalViewRegistration.getSource())); + } + } + }); + } + + private void validateUnmanaged() { + if (implementationRegistration == null) { + return; + } + + ModelType implementationType = implementationRegistration.getImplementationType(); + for (InternalViewRegistration internalViewRegistration : internalViewRegistrations) { + ModelType internalView = internalViewRegistration.getInternalView(); + // Managed internal views are allowed not to be implemented by the default implementation + if (isManaged(internalView)) { + continue; + } + if (!internalView.isAssignableFrom(implementationType)) { + throw new IllegalStateException(String.format( + "Factory registration for '%s' is invalid because the implementation type '%s' does not implement internal view '%s', " + + "implementation type was registered by %s, " + + "internal view was registered by %s", + publicType, implementationType, internalView, + implementationRegistration.getSource(), + internalViewRegistration.getSource())); + } + } + } + } + + @Nullable + private ImplementationFactory findFactory(Class implementationClass) { + ImplementationFactory implementationFactory = factories.get(implementationClass); + if (implementationFactory != null) { + return Cast.uncheckedCast(implementationFactory); + } + + Class superclass = implementationClass.getSuperclass(); + if (superclass != null && superclass != Object.class) { + implementationFactory = findFactory(superclass); + factories.put(implementationClass, implementationFactory); + return Cast.uncheckedCast(implementationFactory); + } + + return null; + } + + private static class ImplementationRegistration { + private final ModelRuleDescriptor source; + private final ModelType implementationType; + private final ImplementationFactory factory; + + private ImplementationRegistration(ModelRuleDescriptor source, ModelType implementationType, ImplementationFactory factory) { + this.source = source; + this.implementationType = implementationType; + this.factory = factory; + } + + public ModelRuleDescriptor getSource() { + return source; + } + + public ModelType getImplementationType() { + return implementationType; + } + + public ImplementationFactory getFactory() { + return factory; + } + } + + private static class InternalViewRegistration { + private final ModelRuleDescriptor source; + private final ModelType internalView; + + private InternalViewRegistration(ModelRuleDescriptor source, ModelType internalView) { + this.source = source; + this.internalView = internalView; + } + + public ModelRuleDescriptor getSource() { + return source; + } + + public ModelType getInternalView() { + return internalView; + } + } + + private static class ImplementationInfoImpl implements ImplementationInfo { + private final ModelType publicType; + private final ImplementationRegistration implementationRegistration; + private final Set> internalViews; + + public ImplementationInfoImpl(ModelType publicType, ImplementationRegistration implementationRegistration, Set> internalViews) { + this.publicType = publicType; + this.internalViews = internalViews; + this.implementationRegistration = Cast.uncheckedCast(implementationRegistration); + } + + @Override + public Object create(MutableModelNode modelNode) { + ImplementationFactory implementationFactory = Cast.uncheckedCast(implementationRegistration.factory); + return implementationFactory.create(publicType, implementationRegistration.implementationType, modelNode.getPath().getName(), modelNode); + } + + @Override + public ModelType getDelegateType() { + return implementationRegistration.implementationType; + } + + @Override + public Set> getInternalViews() { + return internalViews; + } + + @Override + public String toString() { + return String.valueOf(publicType); + } + } + + private abstract class RegistrationHierarchyVisitor implements TypeVisitor { + @Override + public void visitType(Class type) { + if (!baseInterface.getConcreteClass().isAssignableFrom(type)) { + return; + } + Class superTypeClassAsBaseType = type.asSubclass(baseInterface.getConcreteClass()); + ModelType superTypeAsBaseType = ModelType.of(superTypeClassAsBaseType); + + TypeRegistration registration = getRegistration(superTypeAsBaseType); + if (registration != null) { + visitRegistration(registration); + } + } + + protected abstract void visitRegistration(TypeRegistration registration); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/persistent-cache/org/gradle/cache/LockOptions.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/persistent-cache/org/gradle/cache/LockOptions.java new file mode 100644 index 0000000..0e7b960 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/persistent-cache/org/gradle/cache/LockOptions.java @@ -0,0 +1,28 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.cache; + +public interface LockOptions { + + FileLockManager.LockMode getMode(); + + boolean isUseCrossVersionImplementation(); + + /** + * Creates a copy of these options with the given mode. + */ + LockOptions withMode(FileLockManager.LockMode mode); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/persistent-cache/org/gradle/cache/internal/btree/StateCheckBlockStore.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/persistent-cache/org/gradle/cache/internal/btree/StateCheckBlockStore.java new file mode 100644 index 0000000..5f9889b --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/persistent-cache/org/gradle/cache/internal/btree/StateCheckBlockStore.java @@ -0,0 +1,87 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.cache.internal.btree; + +public class StateCheckBlockStore implements BlockStore { + private final BlockStore blockStore; + private boolean open; + + public StateCheckBlockStore(BlockStore blockStore) { + this.blockStore = blockStore; + } + + @Override + public void open(Runnable initAction, Factory factory) { + assert !open; + open = true; + blockStore.open(initAction, factory); + } + + public boolean isOpen() { + return open; + } + + @Override + public void close() { + if (!open) { + return; + } + open = false; + blockStore.close(); + } + + @Override + public void clear() { + assert open; + blockStore.clear(); + } + + @Override + public void remove(BlockPayload block) { + assert open; + blockStore.remove(block); + } + + @Override + public T readFirst(Class payloadType) { + assert open; + return blockStore.readFirst(payloadType); + } + + @Override + public T read(BlockPointer pos, Class payloadType) { + assert open; + return blockStore.read(pos, payloadType); + } + + @Override + public void write(BlockPayload block) { + assert open; + blockStore.write(block); + } + + @Override + public void attach(BlockPayload block) { + assert open; + blockStore.attach(block); + } + + @Override + public void flush() { + assert open; + blockStore.flush(); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-base/org/gradle/platform/base/ProjectDependencySpec.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-base/org/gradle/platform/base/ProjectDependencySpec.java new file mode 100644 index 0000000..a05b464 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-base/org/gradle/platform/base/ProjectDependencySpec.java @@ -0,0 +1,45 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.platform.base; + +import org.gradle.api.Incubating; + +import javax.annotation.Nullable; + +/** + * A dependency onto a library published by a project. + */ +@Incubating +public interface ProjectDependencySpec extends DependencySpec { + + /** + * Returns the project path of the project this dependency refers to. + * + * @return the project path + */ + @Nullable + String getProjectPath(); + + /** + * Returns the name of the library this dependency refers to. If null, it should be assumed that the project + * defines a single library. + * + * @return the library name + */ + @Nullable + String getLibraryName(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-base/org/gradle/platform/base/internal/registry/ComponentTypeModelRuleExtractor.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-base/org/gradle/platform/base/internal/registry/ComponentTypeModelRuleExtractor.java new file mode 100644 index 0000000..c88415a --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-base/org/gradle/platform/base/internal/registry/ComponentTypeModelRuleExtractor.java @@ -0,0 +1,212 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.platform.base.internal.registry; + +import com.google.common.collect.ImmutableList; +import org.gradle.language.base.LanguageSourceSet; +import org.gradle.language.base.plugins.ComponentModelBasePlugin; +import org.gradle.language.base.plugins.LanguageBasePlugin; +import org.gradle.model.InvalidModelRuleDeclarationException; +import org.gradle.model.internal.core.ModelActionRole; +import org.gradle.model.internal.core.ModelReference; +import org.gradle.model.internal.core.ModelView; +import org.gradle.model.internal.core.MutableModelNode; +import org.gradle.model.internal.inspect.AbstractExtractedModelRule; +import org.gradle.model.internal.inspect.AbstractMethodRuleAction; +import org.gradle.model.internal.inspect.ExtractedModelRule; +import org.gradle.model.internal.inspect.MethodModelRuleApplicationContext; +import org.gradle.model.internal.inspect.MethodModelRuleExtractionContext; +import org.gradle.model.internal.inspect.MethodRuleDefinition; +import org.gradle.model.internal.inspect.ModelRuleInvoker; +import org.gradle.model.internal.manage.schema.ModelSchema; +import org.gradle.model.internal.manage.schema.ModelSchemaStore; +import org.gradle.model.internal.type.ModelType; +import org.gradle.platform.base.BinarySpec; +import org.gradle.platform.base.ComponentSpec; +import org.gradle.platform.base.ComponentType; +import org.gradle.platform.base.InvalidModelException; +import org.gradle.platform.base.SourceComponentSpec; +import org.gradle.platform.base.TypeBuilder; +import org.gradle.platform.base.VariantComponentSpec; +import org.gradle.platform.base.component.internal.ComponentSpecFactory; +import org.gradle.platform.base.internal.builder.TypeBuilderInternal; +import org.gradle.platform.base.plugins.BinaryBasePlugin; +import org.gradle.platform.base.plugins.ComponentBasePlugin; + +import javax.annotation.Nullable; +import java.util.List; + +import static java.util.Collections.emptyList; + +public class ComponentTypeModelRuleExtractor extends AbstractAnnotationDrivenComponentModelRuleExtractor { + + public static final ModelType COMPONENT_SPEC_FACTORY_CLASS = ModelType.of(ComponentSpecFactory.class); + private static final ModelReference COMPONENT_SPEC_FACTORY_MODEL_REFERENCE = ModelReference.of(COMPONENT_SPEC_FACTORY_CLASS); + private static final ModelType COMPONENT_SPEC_MODEL_TYPE = ModelType.of(ComponentSpec.class); + private static final ModelType LANGUAGE_SOURCE_SET_MODEL_TYPE = ModelType.of(LanguageSourceSet.class); + private static final ModelType BINARY_SPEC_MODEL_TYPE = ModelType.of(BinarySpec.class); + private static final ModelType SOURCE_COMPONENT_SPEC_MODEL_TYPE = ModelType.of(SourceComponentSpec.class); + private static final ModelType VARIANT_COMPONENT_SPEC_MODEL_TYPE = ModelType.of(VariantComponentSpec.class); + + private static class ComponentTypeRegistrationInfo { + private final String modelName; + private final ModelType baseInterface; + private final List> requiredPlugins; + + private ComponentTypeRegistrationInfo(String modelName, ModelType baseInterface, Class requiredPlugins) { + this.modelName = modelName; + this.baseInterface = baseInterface; + this.requiredPlugins = ImmutableList.>of(requiredPlugins); + } + } + + private final ModelSchemaStore schemaStore; + private final ModelReference registryRef; + + public ComponentTypeModelRuleExtractor(ModelSchemaStore schemaStore) { + this.schemaStore = schemaStore; + this.registryRef = COMPONENT_SPEC_FACTORY_MODEL_REFERENCE; + } + + @Nullable + @Override + public ExtractedModelRule registration(MethodRuleDefinition ruleDefinition, MethodModelRuleExtractionContext context) { + validateIsVoidMethod(ruleDefinition, context); + + if (ruleDefinition.getReferences().size() != 1) { + context.add(ruleDefinition, String.format("A method %s must have a single parameter of type %s.", getDescription(), TypeBuilder.class.getName())); + return null; + } + + ModelReference subjectReference = ruleDefinition.getSubjectReference(); + ModelType subjectType = subjectReference.getType(); + Class rawSubjectType = subjectType.getRawClass(); + if (!rawSubjectType.equals(TypeBuilder.class)) { + context.add(ruleDefinition, String.format("A method %s must have a single parameter of type %s.", getDescription(), TypeBuilder.class.getName())); + return null; + } + + List> typeVariables = subjectType.getTypeVariables(); + if (typeVariables.size() != 1) { + context.add(ruleDefinition, String.format("Parameter of type %s must declare a type parameter.", rawSubjectType.getName())); + return null; + } + + ModelType builtType = typeVariables.get(0); + if (builtType.isWildcard()) { + context.add(ruleDefinition, String.format("Type '%s' cannot be a wildcard type (i.e. cannot use ? super, ? extends etc.).", builtType.toString())); + return null; + } + + ComponentTypeRegistrationInfo info = componentTypeRegistrationInfoFor(builtType); + if (info == null) { + context.add(ruleDefinition, String.format("Type '%s' is not a subtype of '%s'.", builtType.toString(), COMPONENT_SPEC_MODEL_TYPE.toString())); + return null; + } + + return new ExtractedTypeRule(ruleDefinition, info, builtType.asSubtype(info.baseInterface)); + } + + private ComponentTypeRegistrationInfo componentTypeRegistrationInfoFor(ModelType builtType) { + if (LANGUAGE_SOURCE_SET_MODEL_TYPE.isAssignableFrom(builtType)) { + return new ComponentTypeRegistrationInfo("language", LANGUAGE_SOURCE_SET_MODEL_TYPE, LanguageBasePlugin.class); + } + if (BINARY_SPEC_MODEL_TYPE.isAssignableFrom(builtType)) { + return new ComponentTypeRegistrationInfo("binary", BINARY_SPEC_MODEL_TYPE, BinaryBasePlugin.class); + } + if (COMPONENT_SPEC_MODEL_TYPE.isAssignableFrom(builtType)) { + Class requiredPlugin = SOURCE_COMPONENT_SPEC_MODEL_TYPE.isAssignableFrom(builtType) || VARIANT_COMPONENT_SPEC_MODEL_TYPE.isAssignableFrom(builtType) + ? ComponentModelBasePlugin.class + : ComponentBasePlugin.class; + return new ComponentTypeRegistrationInfo("component", COMPONENT_SPEC_MODEL_TYPE, requiredPlugin); + } + return null; + } + + private ModelType determineImplementationType(TypeBuilderInternal builder) { + validateInternalViewsAreInterfaces(builder); + + Class implementation = builder.getDefaultImplementation(); + if (implementation == null) { + return null; + } + + return ModelType.of(implementation); + } + + private void validateInternalViewsAreInterfaces(TypeBuilderInternal builder) { + for (Class internalView : builder.getInternalViews()) { + if (!internalView.isInterface()) { + throw new InvalidModelException(String.format("Internal view %s must be an interface.", internalView.getName())); + } + } + } + + private class ExtractedTypeRule extends AbstractExtractedModelRule { + private final ComponentTypeRegistrationInfo info; + private final ModelType modelType; + + public ExtractedTypeRule(MethodRuleDefinition ruleDefinition, ComponentTypeRegistrationInfo info, ModelType modelType) { + super(ruleDefinition); + this.info = info; + this.modelType = modelType; + } + + @Override + public List> getRuleDependencies() { + return info.requiredPlugins; + } + + @Override + public void apply(final MethodModelRuleApplicationContext context, MutableModelNode target) { + context.getRegistry().configure( + ModelActionRole.Mutate, + context.contextualize(new TypeRegistrationAction())); + } + + private class TypeRegistrationAction extends AbstractMethodRuleAction { + public TypeRegistrationAction() { + super(registryRef, getRuleDefinition().getDescriptor()); + } + + @Override + public List> getInputs() { + return emptyList(); + } + + @Override + protected void execute(ModelRuleInvoker invoker, ComponentSpecFactory registry, List> inputs) { + try { + ModelSchema schema = schemaStore.getSchema(modelType); + TypeBuilderInternal builder = new DefaultTypeBuilder(getAnnotationType(), schema); + invoker.invoke(builder); + ModelType implModelType = determineImplementationType(builder); + registry.register(modelType, builder.getInternalViews(), implModelType, getDescriptor()); + } catch (InvalidModelException e) { + throw invalidModelRule(getRuleDefinition(), info.modelName, e); + } + } + + private InvalidModelRuleDeclarationException invalidModelRule(MethodRuleDefinition ruleDefinition, String modelName, InvalidModelException e) { + StringBuilder sb = new StringBuilder(); + ruleDefinition.getDescriptor().describeTo(sb); + sb.append(String.format(" is not a valid %s model rule method.", modelName)); + return new InvalidModelRuleDeclarationException(sb.toString(), e); + } + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-jvm/org/gradle/jvm/JvmComponentSpec.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-jvm/org/gradle/jvm/JvmComponentSpec.java new file mode 100644 index 0000000..0fb0b31 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-jvm/org/gradle/jvm/JvmComponentSpec.java @@ -0,0 +1,28 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.jvm; + +import org.gradle.api.Incubating; +import org.gradle.platform.base.ComponentSpec; + +/** + * Definition of a software component that is to be built by Gradle to run a on JVM platform. + */ +@Incubating +@Deprecated +public interface JvmComponentSpec extends ComponentSpec { +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-jvm/org/gradle/jvm/internal/DefaultJvmBinarySpec.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-jvm/org/gradle/jvm/internal/DefaultJvmBinarySpec.java new file mode 100644 index 0000000..c0fed0c --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-jvm/org/gradle/jvm/internal/DefaultJvmBinarySpec.java @@ -0,0 +1,101 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.jvm.internal; + +import com.google.common.collect.Iterables; +import com.google.common.collect.Lists; +import org.gradle.jvm.platform.JavaPlatform; +import org.gradle.jvm.toolchain.JavaToolChain; +import org.gradle.language.base.DependentSourceSet; +import org.gradle.language.base.LanguageSourceSet; +import org.gradle.platform.base.BinarySpec; +import org.gradle.platform.base.DependencySpec; +import org.gradle.platform.base.SourceComponentSpec; +import org.gradle.platform.base.binary.BaseBinarySpec; + +import javax.annotation.Nullable; +import java.io.File; +import java.util.Collection; +import java.util.List; + +import static org.gradle.util.CollectionUtils.findSingle; + +public class DefaultJvmBinarySpec extends BaseBinarySpec implements JvmBinarySpecInternal { + private final DefaultJvmAssembly assembly = new DefaultJvmAssembly(getIdentifier().child("assembly")); + + @Override + public JavaToolChain getToolChain() { + return assembly.getToolChain(); + } + + @Override + public void setToolChain(JavaToolChain toolChain) { + assembly.setToolChain(toolChain); + } + + @Override + public JavaPlatform getTargetPlatform() { + return assembly.getTargetPlatform(); + } + + @Override + public void setTargetPlatform(JavaPlatform platform) { + assembly.setTargetPlatform(platform); + } + + @Override + public File getClassesDir() { + return findSingle(assembly.getClassDirectories()); + } + + @Override + public void setClassesDir(File classesDir) { + replaceSingleDirectory(assembly.getClassDirectories(), classesDir); + } + + @Override + public File getResourcesDir() { + return findSingle(assembly.getResourceDirectories()); + } + + @Override + public void setResourcesDir(File resourcesDir) { + replaceSingleDirectory(assembly.getResourceDirectories(), resourcesDir); + } + + public JvmAssembly getAssembly() { + return assembly; + } + + @SuppressWarnings("unchecked") + public static List collectDependencies(final BinarySpec binary, @Nullable final SourceComponentSpec owner, final Collection... specificDependencies) { + List dependencies = Lists.newArrayList(); + if (specificDependencies!=null) { + for (Collection deps : specificDependencies) { + dependencies.addAll(deps); + } + } + Collection binarySources = binary.getSources().values(); + Iterable sourceSets = owner != null ? Iterables.concat(owner.getSources().values(), binarySources) : binarySources; + for (LanguageSourceSet sourceSet : sourceSets) { + if (sourceSet instanceof DependentSourceSet) { + dependencies.addAll(((DependentSourceSet) sourceSet).getDependencies().getDependencies()); + } + } + return dependencies; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-jvm/org/gradle/jvm/toolchain/internal/JabbaInstallationSupplier.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-jvm/org/gradle/jvm/toolchain/internal/JabbaInstallationSupplier.java new file mode 100644 index 0000000..2b8252e --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-jvm/org/gradle/jvm/toolchain/internal/JabbaInstallationSupplier.java @@ -0,0 +1,50 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.jvm.toolchain.internal; + +import org.gradle.api.Transformer; +import org.gradle.api.provider.Provider; +import org.gradle.api.provider.ProviderFactory; + +import javax.inject.Inject; +import java.io.File; +import java.util.Collections; +import java.util.Set; + +public class JabbaInstallationSupplier extends AutoDetectingInstallationSupplier { + + private Provider jabbaHomeDir; + + @Inject + public JabbaInstallationSupplier(ProviderFactory factory) { + super(factory); + jabbaHomeDir = getEnvironmentProperty("JABBA_HOME"); + } + + @Override + protected Set findCandidates() { + return jabbaHomeDir.map(findJavaCandidates()).getOrElse(Collections.emptySet()); + } + + private Transformer, String> findJavaCandidates() { + return jabbaHome -> { + final File root = new File(jabbaHome, "jdk"); + return FileBasedInstallationFactory.fromDirectory(root, "jabba"); + }; + } + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-native/org/gradle/nativeplatform/platform/internal/DefaultNativePlatform.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-native/org/gradle/nativeplatform/platform/internal/DefaultNativePlatform.java new file mode 100644 index 0000000..94327da --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-native/org/gradle/nativeplatform/platform/internal/DefaultNativePlatform.java @@ -0,0 +1,115 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.nativeplatform.platform.internal; + +import net.rubygrapefruit.platform.SystemInfo; +import org.gradle.internal.nativeintegration.NativeIntegrationUnavailableException; +import org.gradle.internal.nativeintegration.services.NativeServices; +import org.gradle.internal.os.OperatingSystem; + +public class DefaultNativePlatform implements NativePlatformInternal { + private final String name; + private ArchitectureInternal architecture; + private OperatingSystemInternal operatingSystem; + + public DefaultNativePlatform(String name) { + this(name, getCurrentOperatingSystem(), getCurrentArchitecture()); + } + + public DefaultNativePlatform(String name, OperatingSystemInternal operatingSystem, ArchitectureInternal architecture) { + this.name = name; + this.architecture = architecture; + this.operatingSystem = operatingSystem; + } + + public static DefaultOperatingSystem getCurrentOperatingSystem() { + return new DefaultOperatingSystem(System.getProperty("os.name"), OperatingSystem.current()); + } + + public static ArchitectureInternal getCurrentArchitecture() { + String architectureName; + try { + architectureName = NativeServices.getInstance().get(SystemInfo.class).getArchitectureName(); + } catch (NativeIntegrationUnavailableException e) { + architectureName = System.getProperty("os.arch"); + } + return Architectures.forInput(architectureName); + } + + public static DefaultNativePlatform host() { + return new HostPlatform(); + } + + @Override + public String getName() { + return name; + } + + @Override + public String toString() { + return getDisplayName(); + } + + @Override + public String getDisplayName() { + return String.format("platform '%s'", name); + } + + @Override + public ArchitectureInternal getArchitecture() { + return architecture; + } + + @Override + public void architecture(String name) { + architecture = Architectures.forInput(name); + } + + @Override + public OperatingSystemInternal getOperatingSystem() { + return operatingSystem; + } + + @Override + public void operatingSystem(String name) { + operatingSystem = new DefaultOperatingSystem(name); + } + + public DefaultNativePlatform withArchitecture(ArchitectureInternal architecture) { + return new DefaultNativePlatform(name, operatingSystem, architecture); + } + + private static class HostPlatform extends DefaultNativePlatform { + HostPlatform() { + super("host:" + DefaultNativePlatform.getCurrentArchitecture().getName(), DefaultNativePlatform.getCurrentOperatingSystem(), DefaultNativePlatform.getCurrentArchitecture()); + } + + HostPlatform(ArchitectureInternal architecture) { + super("host:" + architecture.getName(), DefaultNativePlatform.getCurrentOperatingSystem(), architecture); + } + + @Override + public String getDisplayName() { + return String.format("host %s %s", getOperatingSystem(), getArchitecture()); + } + + @Override + public DefaultNativePlatform withArchitecture(ArchitectureInternal architecture) { + return new HostPlatform(architecture); + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-native/org/gradle/nativeplatform/toolchain/Gcc.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-native/org/gradle/nativeplatform/toolchain/Gcc.java new file mode 100644 index 0000000..5f75582 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-native/org/gradle/nativeplatform/toolchain/Gcc.java @@ -0,0 +1,26 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.nativeplatform.toolchain; + +import org.gradle.api.Incubating; + +/** + * The GNU GCC tool chain. + */ +@Incubating +public interface Gcc extends GccCompatibleToolChain { +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-native/org/gradle/nativeplatform/toolchain/internal/gcc/GccCompilerArgsTransformer.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-native/org/gradle/nativeplatform/toolchain/internal/gcc/GccCompilerArgsTransformer.java new file mode 100644 index 0000000..cad060d --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-native/org/gradle/nativeplatform/toolchain/internal/gcc/GccCompilerArgsTransformer.java @@ -0,0 +1,91 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.nativeplatform.toolchain.internal.gcc; + +import com.google.common.collect.Lists; +import org.gradle.nativeplatform.platform.NativePlatform; +import org.gradle.nativeplatform.toolchain.internal.ArgsTransformer; +import org.gradle.nativeplatform.toolchain.internal.MacroArgsConverter; +import org.gradle.nativeplatform.toolchain.internal.NativeCompileSpec; + +import java.io.File; +import java.util.Collections; +import java.util.List; + +/** + * Maps common options for C/C++ compiling with GCC + */ +abstract class GccCompilerArgsTransformer implements ArgsTransformer { + @Override + public List transform(T spec) { + List args = Lists.newArrayList(); + addToolSpecificArgs(spec, args); + addMacroArgs(spec, args); + addUserArgs(spec, args); + addIncludeArgs(spec, args); + return args; + } + + protected void addToolSpecificArgs(T spec, List args) { + Collections.addAll(args, "-x", getLanguage()); + args.add("-c"); + if (spec.isPositionIndependentCode()) { + if (!spec.getTargetPlatform().getOperatingSystem().isWindows()) { + args.add("-fPIC"); + } + } + if (spec.isDebuggable()) { + args.add("-g"); + } + if (spec.isOptimized()) { + args.add("-O3"); + } + } + + protected void addIncludeArgs(T spec, List args) { + if (!needsStandardIncludes(spec.getTargetPlatform())) { + args.add("-nostdinc"); + } + + for (File file : spec.getIncludeRoots()) { + args.add("-I"); + args.add(file.getAbsolutePath()); + } + + for (File file : spec.getSystemIncludeRoots()) { + args.add("-isystem"); + args.add(file.getAbsolutePath()); + } + } + + protected void addMacroArgs(T spec, List args) { + for (String macroArg : new MacroArgsConverter().transform(spec.getMacros())) { + args.add("-D" + macroArg); + } + } + + protected void addUserArgs(T spec, List args) { + args.addAll(spec.getAllArgs()); + } + + protected boolean needsStandardIncludes(NativePlatform targetPlatform) { + return targetPlatform.getOperatingSystem().isMacOsX(); + } + + protected abstract String getLanguage(); + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-native/org/gradle/nativeplatform/toolchain/internal/msvcpp/DefaultVisualCppPlatformToolChain.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-native/org/gradle/nativeplatform/toolchain/internal/msvcpp/DefaultVisualCppPlatformToolChain.java new file mode 100644 index 0000000..d4af0aa --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-native/org/gradle/nativeplatform/toolchain/internal/msvcpp/DefaultVisualCppPlatformToolChain.java @@ -0,0 +1,79 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.nativeplatform.toolchain.internal.msvcpp; + +import org.gradle.internal.reflect.Instantiator; +import org.gradle.nativeplatform.platform.NativePlatform; +import org.gradle.nativeplatform.toolchain.CommandLineToolConfiguration; +import org.gradle.nativeplatform.toolchain.VisualCppPlatformToolChain; +import org.gradle.nativeplatform.toolchain.internal.ToolType; +import org.gradle.nativeplatform.toolchain.internal.tools.CommandLineToolConfigurationInternal; +import org.gradle.nativeplatform.toolchain.internal.tools.DefaultCommandLineToolConfiguration; + +import java.util.HashMap; +import java.util.Map; + +public class DefaultVisualCppPlatformToolChain implements VisualCppPlatformToolChain { + private final NativePlatform platform; + protected final Map tools; + + public DefaultVisualCppPlatformToolChain(NativePlatform platform, Instantiator instantiator) { + this.platform = platform; + tools = new HashMap(); + tools.put(ToolType.C_COMPILER, instantiator.newInstance(DefaultCommandLineToolConfiguration.class, ToolType.C_COMPILER)); + tools.put(ToolType.CPP_COMPILER, instantiator.newInstance(DefaultCommandLineToolConfiguration.class, ToolType.CPP_COMPILER)); + tools.put(ToolType.LINKER, instantiator.newInstance(DefaultCommandLineToolConfiguration.class, ToolType.LINKER)); + tools.put(ToolType.STATIC_LIB_ARCHIVER, instantiator.newInstance(DefaultCommandLineToolConfiguration.class, ToolType.STATIC_LIB_ARCHIVER)); + tools.put(ToolType.ASSEMBLER, instantiator.newInstance(DefaultCommandLineToolConfiguration.class, ToolType.ASSEMBLER)); + tools.put(ToolType.WINDOW_RESOURCES_COMPILER, instantiator.newInstance(DefaultCommandLineToolConfiguration.class, ToolType.WINDOW_RESOURCES_COMPILER)); + } + + @Override + public CommandLineToolConfiguration getcCompiler() { + return tools.get(ToolType.C_COMPILER); + } + + @Override + public CommandLineToolConfiguration getCppCompiler() { + return tools.get(ToolType.CPP_COMPILER); + } + + @Override + public CommandLineToolConfiguration getRcCompiler() { + return tools.get(ToolType.WINDOW_RESOURCES_COMPILER); + } + + @Override + public CommandLineToolConfiguration getAssembler() { + return tools.get(ToolType.ASSEMBLER); + } + + @Override + public CommandLineToolConfiguration getLinker() { + return tools.get(ToolType.LINKER); + } + + @Override + public CommandLineToolConfiguration getStaticLibArchiver() { + return tools.get(ToolType.STATIC_LIB_ARCHIVER); + } + + @Override + public NativePlatform getPlatform() { + return platform; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-native/org/gradle/nativeplatform/toolchain/plugins/GccCompilerPlugin.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-native/org/gradle/nativeplatform/toolchain/plugins/GccCompilerPlugin.java new file mode 100644 index 0000000..63013f4 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-native/org/gradle/nativeplatform/toolchain/plugins/GccCompilerPlugin.java @@ -0,0 +1,79 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.nativeplatform.toolchain.plugins; + +import org.gradle.api.Incubating; +import org.gradle.api.NamedDomainObjectFactory; +import org.gradle.api.NonNullApi; +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.internal.file.FileResolver; +import org.gradle.internal.operations.BuildOperationExecutor; +import org.gradle.internal.os.OperatingSystem; +import org.gradle.internal.reflect.Instantiator; +import org.gradle.internal.service.ServiceRegistry; +import org.gradle.internal.work.WorkerLeaseService; +import org.gradle.model.Defaults; +import org.gradle.model.RuleSource; +import org.gradle.nativeplatform.internal.CompilerOutputFileNamingSchemeFactory; +import org.gradle.nativeplatform.plugins.NativeComponentPlugin; +import org.gradle.nativeplatform.toolchain.Gcc; +import org.gradle.nativeplatform.toolchain.internal.NativeToolChainRegistryInternal; +import org.gradle.nativeplatform.toolchain.internal.gcc.GccToolChain; +import org.gradle.nativeplatform.toolchain.internal.gcc.metadata.SystemLibraryDiscovery; +import org.gradle.nativeplatform.toolchain.internal.metadata.CompilerMetaDataProviderFactory; +import org.gradle.process.internal.ExecActionFactory; + +/** + * A {@link Plugin} which makes the GNU GCC/G++ compiler available for compiling C/C++ code. + */ +@Incubating +@NonNullApi +public class GccCompilerPlugin implements Plugin { + + @Override + public void apply(Project project) { + project.getPluginManager().apply(NativeComponentPlugin.class); + } + + static class Rules extends RuleSource { + @Defaults + public static void addToolChain(NativeToolChainRegistryInternal toolChainRegistry, ServiceRegistry serviceRegistry) { + final FileResolver fileResolver = serviceRegistry.get(FileResolver.class); + final ExecActionFactory execActionFactory = serviceRegistry.get(ExecActionFactory.class); + final CompilerOutputFileNamingSchemeFactory compilerOutputFileNamingSchemeFactory = serviceRegistry.get(CompilerOutputFileNamingSchemeFactory.class); + + final Instantiator instantiator = serviceRegistry.get(Instantiator.class); + + final BuildOperationExecutor buildOperationExecutor = serviceRegistry.get(BuildOperationExecutor.class); + + final CompilerMetaDataProviderFactory metaDataProviderFactory = serviceRegistry.get(CompilerMetaDataProviderFactory.class); + + final WorkerLeaseService workerLeaseService = serviceRegistry.get(WorkerLeaseService.class); + final SystemLibraryDiscovery standardLibraryDiscovery = serviceRegistry.get(SystemLibraryDiscovery.class); + + toolChainRegistry.registerFactory(Gcc.class, new NamedDomainObjectFactory() { + @Override + public Gcc create(String name) { + return instantiator.newInstance(GccToolChain.class, instantiator, name, buildOperationExecutor, OperatingSystem.current(), fileResolver, execActionFactory, compilerOutputFileNamingSchemeFactory, metaDataProviderFactory, standardLibraryDiscovery, workerLeaseService); + } + }); + toolChainRegistry.registerDefaultToolChain(GccToolChain.DEFAULT_NAME, Gcc.class); + } + + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-play/org/gradle/language/routes/package-info.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-play/org/gradle/language/routes/package-info.java new file mode 100644 index 0000000..a4a7ff0 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-play/org/gradle/language/routes/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Language support classes for routes + */ +package org.gradle.language.routes; \ No newline at end of file diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-play/org/gradle/language/twirl/TwirlImports.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-play/org/gradle/language/twirl/TwirlImports.java new file mode 100644 index 0000000..5ec2c69 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-play/org/gradle/language/twirl/TwirlImports.java @@ -0,0 +1,28 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.twirl; + +import org.gradle.api.Incubating; + +/** + * Represents the available sets of default imports that can be used when compiling Twirl templates. + */ +@Incubating +@Deprecated +public enum TwirlImports { + SCALA, JAVA +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-play/org/gradle/play/internal/run/PlayApplicationRunnerFactory.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-play/org/gradle/play/internal/run/PlayApplicationRunnerFactory.java new file mode 100644 index 0000000..605d3c6 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/platform-play/org/gradle/play/internal/run/PlayApplicationRunnerFactory.java @@ -0,0 +1,43 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.play.internal.run; + +import org.gradle.api.internal.file.FileCollectionFactory; +import org.gradle.internal.fingerprint.FileCollectionFingerprinter; +import org.gradle.play.internal.platform.PlayMajorVersion; +import org.gradle.play.platform.PlayPlatform; +import org.gradle.process.internal.worker.WorkerProcessFactory; + +public class PlayApplicationRunnerFactory { + public static PlayApplicationRunner create(PlayPlatform playPlatform, WorkerProcessFactory workerFactory, FileCollectionFingerprinter fingerprinter, FileCollectionFactory fileCollectionFactory) { + return new PlayApplicationRunner(workerFactory, createPlayRunAdapter(playPlatform), fingerprinter, fileCollectionFactory); + } + + public static VersionedPlayRunAdapter createPlayRunAdapter(PlayPlatform playPlatform) { + switch (PlayMajorVersion.forPlatform(playPlatform)) { + case PLAY_2_4_X: + return new PlayRunAdapterV24X(); + case PLAY_2_5_X: + return new PlayRunAdapterV25X(); + case PLAY_2_6_X: + return new PlayRunAdapterV26X(); + case PLAY_2_3_X: + default: + return new PlayRunAdapterV23X(); + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/plugin-use/org/gradle/plugin/management/internal/autoapply/DefaultAutoAppliedPluginHandler.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/plugin-use/org/gradle/plugin/management/internal/autoapply/DefaultAutoAppliedPluginHandler.java new file mode 100644 index 0000000..e130949 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/plugin-use/org/gradle/plugin/management/internal/autoapply/DefaultAutoAppliedPluginHandler.java @@ -0,0 +1,105 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.plugin.management.internal.autoapply; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterables; +import org.gradle.api.Project; +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.artifacts.Dependency; +import org.gradle.api.artifacts.ModuleVersionSelector; +import org.gradle.api.initialization.Settings; +import org.gradle.api.initialization.dsl.ScriptHandler; +import org.gradle.api.plugins.PluginContainer; +import org.gradle.plugin.management.internal.PluginRequestInternal; +import org.gradle.plugin.management.internal.PluginRequests; + +public class DefaultAutoAppliedPluginHandler implements AutoAppliedPluginHandler { + + private final AutoAppliedPluginRegistry registry; + + public DefaultAutoAppliedPluginHandler(AutoAppliedPluginRegistry registry) { + this.registry = registry; + } + + @Override + public PluginRequests mergeWithAutoAppliedPlugins(PluginRequests initialRequests, Object pluginTarget) { + if (pluginTarget instanceof Project) { + Project project = (Project) pluginTarget; + + PluginRequests autoAppliedPlugins = registry.getAutoAppliedPlugins(project); + if (autoAppliedPlugins.isEmpty()) { + return initialRequests; + } + return mergePluginRequests(autoAppliedPlugins, initialRequests, project.getPlugins(), project.getBuildscript()); + } else if (pluginTarget instanceof Settings) { + Settings settings = (Settings) pluginTarget; + + PluginRequests autoAppliedPlugins = registry.getAutoAppliedPlugins(settings); + if (autoAppliedPlugins.isEmpty()) { + return initialRequests; + } + return mergePluginRequests(autoAppliedPlugins, initialRequests, settings.getPlugins(), settings.getBuildscript()); + } else { + // No auto-applied plugins available + return initialRequests; + } + + } + + PluginRequests mergePluginRequests(PluginRequests autoAppliedPlugins, PluginRequests initialRequests, PluginContainer pluginContainer, ScriptHandler scriptHandler) { + PluginRequests filteredAutoAppliedPlugins = filterAlreadyAppliedOrRequested(autoAppliedPlugins, initialRequests, pluginContainer, scriptHandler); + return filteredAutoAppliedPlugins.mergeWith(initialRequests); + } + + private PluginRequests filterAlreadyAppliedOrRequested(PluginRequests autoAppliedPlugins, final PluginRequests initialRequests, final PluginContainer pluginContainer, final ScriptHandler scriptHandler) { + //noinspection StaticPseudoFunctionalStyleMethod + return PluginRequests.of(ImmutableList.copyOf(Iterables.filter(autoAppliedPlugins, autoAppliedPlugin -> !isAlreadyAppliedOrRequested(autoAppliedPlugin, initialRequests, pluginContainer, scriptHandler)))); + } + + private static boolean isAlreadyAppliedOrRequested(PluginRequestInternal autoAppliedPlugin, PluginRequests requests, PluginContainer pluginContainer, ScriptHandler scriptHandler) { + return isAlreadyApplied(autoAppliedPlugin, pluginContainer) || isAlreadyRequestedInPluginsBlock(autoAppliedPlugin, requests) || isAlreadyRequestedInBuildScriptBlock(autoAppliedPlugin, scriptHandler); + } + + private static boolean isAlreadyApplied(PluginRequestInternal autoAppliedPlugin, PluginContainer pluginContainer) { + return pluginContainer.hasPlugin(autoAppliedPlugin.getId().getId()); + } + + private static boolean isAlreadyRequestedInPluginsBlock(PluginRequestInternal autoAppliedPlugin, PluginRequests requests) { + for (PluginRequestInternal request : requests) { + if (autoAppliedPlugin.getId().equals(request.getId())) { + return true; + } + } + return false; + } + + private static boolean isAlreadyRequestedInBuildScriptBlock(PluginRequestInternal autoAppliedPlugin, ScriptHandler scriptHandler) { + ModuleVersionSelector module = autoAppliedPlugin.getModule(); + if (module == null) { + return false; + } + + Configuration classpathConfiguration = scriptHandler.getConfigurations().getByName(ScriptHandler.CLASSPATH_CONFIGURATION); + for (Dependency dependency : classpathConfiguration.getDependencies()) { + if (module.getGroup().equals(dependency.getGroup()) && module.getName().equals(dependency.getName())) { + return true; + } + } + + return false; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/plugins/org/gradle/api/internal/java/DefaultJavaSourceSet.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/plugins/org/gradle/api/internal/java/DefaultJavaSourceSet.java new file mode 100644 index 0000000..83a9caa --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/plugins/org/gradle/api/internal/java/DefaultJavaSourceSet.java @@ -0,0 +1,62 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.java; + +import org.gradle.api.file.SourceDirectorySet; +import org.gradle.api.internal.tasks.AbstractTaskDependency; +import org.gradle.api.internal.tasks.TaskDependencyResolveContext; +import org.gradle.api.tasks.TaskDependency; +import org.gradle.jvm.Classpath; +import org.gradle.language.base.internal.AbstractLanguageSourceSet; +import org.gradle.language.java.JavaSourceSet; +import org.gradle.platform.base.DependencySpecContainer; +import org.gradle.platform.base.internal.ComponentSpecIdentifier; +import org.gradle.platform.base.internal.DefaultDependencySpecContainer; + +public class DefaultJavaSourceSet extends AbstractLanguageSourceSet implements JavaSourceSet { + private final Classpath compileClasspath; + + public DefaultJavaSourceSet(ComponentSpecIdentifier componentIdentifier, SourceDirectorySet source, Classpath compileClasspath) { + super(componentIdentifier, JavaSourceSet.class, source); + this.compileClasspath = compileClasspath; + } + + @Override + protected String getLanguageName() { + return "Java"; + } + + @Override + public Classpath getCompileClasspath() { + return compileClasspath; + } + + @Override + public DependencySpecContainer getDependencies() { + return new DefaultDependencySpecContainer(); + } + + @Override + public TaskDependency getBuildDependencies() { + return new AbstractTaskDependency() { + @Override + public void visitDependencies(TaskDependencyResolveContext context) { + context.add(compileClasspath); + context.add(getSource()); + } + }; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/plugins/org/gradle/api/plugins/BasePluginConvention.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/plugins/org/gradle/api/plugins/BasePluginConvention.java new file mode 100644 index 0000000..99c88b7 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/plugins/org/gradle/api/plugins/BasePluginConvention.java @@ -0,0 +1,96 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.plugins; + +import org.gradle.api.file.DirectoryProperty; +import org.gradle.api.internal.project.ProjectInternal; + +import java.io.File; + +/** + *

A {@link Convention} used for the BasePlugin.

+ */ +public abstract class BasePluginConvention { + /** + * Returns the directory to generate TAR and ZIP archives into. + * + *

+ * This property has been replaced by distsDirectory. + *

+ * + * @return The directory. Never returns null. + */ + @Deprecated + public abstract File getDistsDir(); + + /** + * Returns the directory to generate TAR and ZIP archives into. + * + * @return The directory. Never returns null. + * + * @since 6.0 + */ + public abstract DirectoryProperty getDistsDirectory(); + + /** + * Returns the directory to generate JAR and WAR archives into. + * + *

+ * This property has been replaced by libsDirectory. + *

+ * + * @return The directory. Never returns null. + */ + @Deprecated + public abstract File getLibsDir(); + + /** + * Returns the directory to generate JAR and WAR archives into. + * + * @return The directory. Never returns null. + * + * @since 6.0 + */ + public abstract DirectoryProperty getLibsDirectory(); + + @Deprecated + public abstract ProjectInternal getProject(); + + @Deprecated + public abstract void setProject(ProjectInternal project); + + /** + * The name for the distributions directory. This in interpreted relative to the project' build directory. + */ + public abstract String getDistsDirName(); + + public abstract void setDistsDirName(String distsDirName); + + /** + * The name for the libs directory. This in interpreted relative to the project' build directory. + */ + public abstract String getLibsDirName(); + + public abstract void setLibsDirName(String libsDirName); + + /** + * The base name to use for archive files. + */ + public abstract String getArchivesBaseName(); + + public abstract void setArchivesBaseName(String archivesBaseName); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/plugins/org/gradle/api/plugins/JavaPluginConvention.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/plugins/org/gradle/api/plugins/JavaPluginConvention.java new file mode 100644 index 0000000..e06341b --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/plugins/org/gradle/api/plugins/JavaPluginConvention.java @@ -0,0 +1,183 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.plugins; + +import groovy.lang.Closure; +import org.gradle.api.Action; +import org.gradle.api.JavaVersion; +import org.gradle.api.internal.project.ProjectInternal; +import org.gradle.api.java.archives.Manifest; +import org.gradle.api.tasks.SourceSetContainer; + +import java.io.File; + +/** + * Is mixed into the project when applying the {@link org.gradle.api.plugins.JavaBasePlugin} or the + * {@link org.gradle.api.plugins.JavaPlugin}. + */ +public abstract class JavaPluginConvention { + /** + * Configures the source sets of this project. + * + *

The given closure is executed to configure the {@link SourceSetContainer}. The {@link SourceSetContainer} + * is passed to the closure as its delegate. + *

+ * See the example below how {@link org.gradle.api.tasks.SourceSet} 'main' is accessed and how the {@link org.gradle.api.file.SourceDirectorySet} 'java' + * is configured to exclude some package from compilation. + * + *

+     * plugins {
+     *     id 'java'
+     * }
+     *
+     * sourceSets {
+     *   main {
+     *     java {
+     *       exclude 'some/unwanted/package/**'
+     *     }
+     *   }
+     * }
+     * 
+ * + * @param closure The closure to execute. + * @return NamedDomainObjectContainer<org.gradle.api.tasks.SourceSet> + */ + public abstract Object sourceSets(Closure closure); + + /** + * Returns a file pointing to the root directory supposed to be used for all docs. + */ + public abstract File getDocsDir(); + + /** + * Returns a file pointing to the root directory of the test results. + */ + public abstract File getTestResultsDir(); + + /** + * Returns a file pointing to the root directory to be used for reports. + */ + public abstract File getTestReportDir(); + + /** + * Returns the source compatibility used for compiling Java sources. + */ + public abstract JavaVersion getSourceCompatibility(); + + /** + * Sets the source compatibility used for compiling Java sources. + * + * @param value The value for the source compatibility as defined by {@link JavaVersion#toVersion(Object)} + */ + public abstract void setSourceCompatibility(Object value); + + /** + * Sets the source compatibility used for compiling Java sources. + * + * @param value The value for the source compatibility + */ + public abstract void setSourceCompatibility(JavaVersion value); + + /** + * Returns the target compatibility used for compiling Java sources. + */ + public abstract JavaVersion getTargetCompatibility(); + + /** + * Sets the target compatibility used for compiling Java sources. + * + * @param value The value for the target compatibility as defined by {@link JavaVersion#toVersion(Object)} + */ + public abstract void setTargetCompatibility(Object value); + + /** + * Sets the target compatibility used for compiling Java sources. + * + * @param value The value for the target compatibility + */ + public abstract void setTargetCompatibility(JavaVersion value); + + /** + * Creates a new instance of a {@link Manifest}. + */ + public abstract Manifest manifest(); + + /** + * Creates and configures a new instance of a {@link Manifest}. The given closure configures + * the new manifest instance before it is returned. + * + * @param closure The closure to use to configure the manifest. + */ + public abstract Manifest manifest(Closure closure); + + /** + * Creates and configures a new instance of a {@link Manifest}. + * + * @param action The action to use to configure the manifest. + * @since 3.5 + */ + public abstract Manifest manifest(Action action); + + /** + * The name of the docs directory. Can be a name or a path relative to the build dir. + */ + public abstract String getDocsDirName(); + + public abstract void setDocsDirName(String docsDirName); + + /** + * The name of the test results directory. Can be a name or a path relative to the build dir. + */ + public abstract String getTestResultsDirName(); + + public abstract void setTestResultsDirName(String testResultsDirName); + + /** + * The name of the test reports directory. Can be a name or a path relative to {@link org.gradle.api.reporting.ReportingExtension#getBaseDir}. + */ + public abstract String getTestReportDirName(); + + public abstract void setTestReportDirName(String testReportDirName); + + /** + * The source sets container. + */ + public abstract SourceSetContainer getSourceSets(); + + public abstract ProjectInternal getProject(); + + /** + * If this method is called, Gradle will not automatically try to fetch + * dependencies which have a JVM version compatible with this module. + * This should be used whenever the default behavior is not + * applicable, in particular when for some reason it's not possible to split + * a module and that this module only has some classes which require dependencies + * on higher versions. + * + * @since 5.3 + */ + public abstract void disableAutoTargetJvm(); + + /** + * Tells if automatic JVM targeting is enabled. When disabled, Gradle + * will not automatically try to get dependencies corresponding to the + * same (or compatible) level as the target compatibility of this module. + * + * @since 5.3 + */ + public abstract boolean getAutoTargetJvmDisabled(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/plugins/org/gradle/api/plugins/internal/DefaultApplicationPluginConvention.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/plugins/org/gradle/api/plugins/internal/DefaultApplicationPluginConvention.java new file mode 100644 index 0000000..67d6276 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/plugins/org/gradle/api/plugins/internal/DefaultApplicationPluginConvention.java @@ -0,0 +1,102 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.plugins.internal; + +import org.gradle.api.Project; +import org.gradle.api.file.CopySpec; +import org.gradle.api.plugins.ApplicationPluginConvention; +import org.gradle.api.reflect.HasPublicType; +import org.gradle.api.reflect.TypeOf; + +import java.util.ArrayList; + +import static org.gradle.api.reflect.TypeOf.typeOf; + +public class DefaultApplicationPluginConvention extends ApplicationPluginConvention implements HasPublicType { + private String applicationName; + private String mainClassName; + private Iterable applicationDefaultJvmArgs = new ArrayList(); + private String executableDir = "bin"; + private CopySpec applicationDistribution; + + private final Project project; + + public DefaultApplicationPluginConvention(Project project) { + this.project = project; + applicationDistribution = project.copySpec(); + } + + @Override + public TypeOf getPublicType() { + return typeOf(ApplicationPluginConvention.class); + } + + @Override + public String getApplicationName() { + return applicationName; + } + + @Override + public void setApplicationName(String applicationName) { + this.applicationName = applicationName; + } + + @Override + public String getMainClassName() { + return mainClassName; + } + + @Override + public void setMainClassName(String mainClassName) { + this.mainClassName = mainClassName; + } + + @Override + public Iterable getApplicationDefaultJvmArgs() { + return applicationDefaultJvmArgs; + } + + @Override + public void setApplicationDefaultJvmArgs(Iterable applicationDefaultJvmArgs) { + this.applicationDefaultJvmArgs = applicationDefaultJvmArgs; + } + + @Override + public String getExecutableDir() { + return executableDir; + } + + @Override + public void setExecutableDir(String executableDir) { + this.executableDir = executableDir; + } + + @Override + public CopySpec getApplicationDistribution() { + return applicationDistribution; + } + + @Override + public void setApplicationDistribution(CopySpec applicationDistribution) { + this.applicationDistribution = applicationDistribution; + } + + @Override + public Project getProject() { + return project; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/plugins/org/gradle/api/tasks/GroovySourceSet.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/plugins/org/gradle/api/tasks/GroovySourceSet.java new file mode 100644 index 0000000..c51ff8b --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/plugins/org/gradle/api/tasks/GroovySourceSet.java @@ -0,0 +1,63 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.tasks; + +import groovy.lang.Closure; +import org.gradle.api.Action; +import org.gradle.api.file.SourceDirectorySet; + +import javax.annotation.Nullable; + +/** + * A {@code GroovySourceSetConvention} defines the properties and methods added to a {@link SourceSet} by the {@link + * org.gradle.api.plugins.GroovyPlugin}. + */ +public interface GroovySourceSet { + /** + * Returns the source to be compiled by the Groovy compiler for this source set. Any Java source present in this set + * will be passed to the Groovy compiler for joint compilation. + * + * @return The Groovy/Java source. Never returns null. + */ + SourceDirectorySet getGroovy(); + + /** + * Configures the Groovy source for this set. + * + *

The given closure is used to configure the {@link SourceDirectorySet} which contains the Groovy source. + * + * @param configureClosure The closure to use to configure the Groovy source. + * @return this + */ + GroovySourceSet groovy(@Nullable Closure configureClosure); + + /** + * Configures the Groovy source for this set. + * + *

The given action is used to configure the {@link SourceDirectorySet} which contains the Groovy source. + * + * @param configureAction The action to use to configure the Groovy source. + * @return this + */ + GroovySourceSet groovy(Action configureAction); + + /** + * All Groovy source for this source set. + * + * @return the Groovy source. Never returns null. + */ + SourceDirectorySet getAllGroovy(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/resources-gcs/org/gradle/internal/resource/transport/gcp/gcs/ResourceMapper.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/resources-gcs/org/gradle/internal/resource/transport/gcp/gcs/ResourceMapper.java new file mode 100644 index 0000000..51a6ae8 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/resources-gcs/org/gradle/internal/resource/transport/gcp/gcs/ResourceMapper.java @@ -0,0 +1,41 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.resource.transport.gcp.gcs; + +import com.google.api.services.storage.model.StorageObject; +import org.gradle.internal.resource.metadata.DefaultExternalResourceMetaData; +import org.gradle.internal.resource.metadata.ExternalResourceMetaData; + +import java.net.URI; + +final class ResourceMapper { + + static ExternalResourceMetaData toExternalResourceMetaData(URI uri, StorageObject storageObject) { + return new DefaultExternalResourceMetaData( + uri, + storageObject.getUpdated().getValue(), + storageObject.getSize().longValue(), + storageObject.getContentType(), + storageObject.getEtag(), + null // we cannot use md5 instead of sha1 here because cache will get corrupted due to its expectation of sha1 hashes + ); + } + + private ResourceMapper() { + throw new AssertionError("No instances"); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/resources-http/org/gradle/authentication/http/package-info.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/resources-http/org/gradle/authentication/http/package-info.java new file mode 100644 index 0000000..9cad86a --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/resources-http/org/gradle/authentication/http/package-info.java @@ -0,0 +1,22 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Classes related to transport authentication protocols for HTTP. + * + * @since 2.7 + */ +package org.gradle.authentication.http; diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/resources-http/org/gradle/internal/resource/transport/http/DefaultHttpSettings.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/resources-http/org/gradle/internal/resource/transport/http/DefaultHttpSettings.java new file mode 100644 index 0000000..d2b984e --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/resources-http/org/gradle/internal/resource/transport/http/DefaultHttpSettings.java @@ -0,0 +1,197 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.internal.resource.transport.http; + + +import com.google.common.base.Preconditions; +import com.google.common.base.Supplier; +import com.google.common.base.Suppliers; +import org.apache.http.conn.ssl.DefaultHostnameVerifier; +import org.gradle.authentication.Authentication; +import org.gradle.internal.UncheckedException; +import org.gradle.internal.verifier.HttpRedirectVerifier; + +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSession; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import java.security.GeneralSecurityException; +import java.security.cert.X509Certificate; +import java.util.Collection; + +public class DefaultHttpSettings implements HttpSettings { + private final Collection authenticationSettings; + private final SslContextFactory sslContextFactory; + private final HostnameVerifier hostnameVerifier; + private final HttpRedirectVerifier redirectVerifier; + private final boolean followRedirects; + + + private HttpProxySettings proxySettings; + private HttpProxySettings secureProxySettings; + private HttpTimeoutSettings timeoutSettings; + + public static Builder builder() { + return new Builder(); + } + + private DefaultHttpSettings(Collection authenticationSettings, SslContextFactory sslContextFactory, HostnameVerifier hostnameVerifier, HttpRedirectVerifier redirectVerifier, boolean followRedirects) { + this.followRedirects = followRedirects; + Preconditions.checkNotNull(authenticationSettings, "authenticationSettings"); + Preconditions.checkNotNull(sslContextFactory, "sslContextFactory"); + Preconditions.checkNotNull(hostnameVerifier, "hostnameVerifier"); + Preconditions.checkNotNull(redirectVerifier, "redirectVerifier"); + + this.authenticationSettings = authenticationSettings; + this.sslContextFactory = sslContextFactory; + this.hostnameVerifier = hostnameVerifier; + this.redirectVerifier = redirectVerifier; + } + + @Override + public HttpProxySettings getProxySettings() { + if (proxySettings == null) { + proxySettings = new JavaSystemPropertiesHttpProxySettings(); + } + return proxySettings; + } + + @Override + public HttpProxySettings getSecureProxySettings() { + if (secureProxySettings == null) { + secureProxySettings = new JavaSystemPropertiesSecureHttpProxySettings(); + } + return secureProxySettings; + } + + @Override + public HttpTimeoutSettings getTimeoutSettings() { + if (timeoutSettings == null) { + timeoutSettings = new JavaSystemPropertiesHttpTimeoutSettings(); + } + return timeoutSettings; + } + + @Override + public boolean isFollowRedirects() { + return followRedirects; + } + + @Override + public HttpRedirectVerifier getRedirectVerifier() { + return redirectVerifier; + } + + @Override + public Collection getAuthenticationSettings() { + return authenticationSettings; + } + + @Override + public SslContextFactory getSslContextFactory() { + return sslContextFactory; + } + + @Override + public HostnameVerifier getHostnameVerifier() { + return hostnameVerifier; + } + + public static class Builder { + private Collection authenticationSettings; + private SslContextFactory sslContextFactory; + private HostnameVerifier hostnameVerifier; + private HttpRedirectVerifier redirectVerifier; + private boolean followRedirects = true; + + public Builder withAuthenticationSettings(Collection authenticationSettings) { + this.authenticationSettings = authenticationSettings; + return this; + } + + public Builder withSslContextFactory(SslContextFactory sslContextFactory) { + this.sslContextFactory = sslContextFactory; + this.hostnameVerifier = new DefaultHostnameVerifier(null); + return this; + } + + public Builder withRedirectVerifier(HttpRedirectVerifier redirectVerifier) { + this.redirectVerifier = redirectVerifier; + return this; + } + + public Builder allowUntrustedConnections() { + this.sslContextFactory = ALL_TRUSTING_SSL_CONTEXT_FACTORY; + this.hostnameVerifier = ALL_TRUSTING_HOSTNAME_VERIFIER; + return this; + } + + public Builder followRedirects(boolean followRedirects) { + this.followRedirects = followRedirects; + return this; + } + + public HttpSettings build() { + return new DefaultHttpSettings(authenticationSettings, sslContextFactory, hostnameVerifier, redirectVerifier, followRedirects); + } + } + + private static final HostnameVerifier ALL_TRUSTING_HOSTNAME_VERIFIER = new HostnameVerifier() { + @Override + public boolean verify(String hostname, SSLSession session) { + return true; + } + }; + + private static final SslContextFactory ALL_TRUSTING_SSL_CONTEXT_FACTORY = new SslContextFactory() { + private final Supplier sslContextSupplier = Suppliers.memoize(new Supplier() { + @Override + public SSLContext get() { + try { + SSLContext sslcontext = SSLContext.getInstance("TLS"); + sslcontext.init(null, allTrustingTrustManager, null); + return sslcontext; + } catch (GeneralSecurityException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + }); + + @Override + public SSLContext createSslContext() { + return sslContextSupplier.get(); + } + + private final TrustManager[] allTrustingTrustManager = new TrustManager[]{ + new X509TrustManager() { + @Override + public X509Certificate[] getAcceptedIssuers() { + return null; + } + + @Override + public void checkClientTrusted(X509Certificate[] certs, String authType) { + } + + @Override + public void checkServerTrusted(X509Certificate[] certs, String authType) { + } + } + }; + }; + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/resources/org/gradle/internal/resource/local/AbstractLocallyAvailableResourceFinder.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/resources/org/gradle/internal/resource/local/AbstractLocallyAvailableResourceFinder.java new file mode 100644 index 0000000..5875377 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/resources/org/gradle/internal/resource/local/AbstractLocallyAvailableResourceFinder.java @@ -0,0 +1,44 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.resource.local; + +import org.gradle.api.Transformer; +import org.gradle.internal.Factory; +import org.gradle.internal.hash.ChecksumService; + +import java.io.File; +import java.util.List; + +public class AbstractLocallyAvailableResourceFinder implements LocallyAvailableResourceFinder { + + private final Transformer>, C> producer; + private final ChecksumService checksumService; + + public AbstractLocallyAvailableResourceFinder(Transformer>, C> producer, ChecksumService checksumService) { + this.producer = producer; + this.checksumService = checksumService; + } + + @Override + public LocallyAvailableResourceCandidates findCandidates(C criterion) { + return new LazyLocallyAvailableResourceCandidates(producer.transform(criterion), checksumService); + } + + public ChecksumService getChecksumService() { + return checksumService; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/security/org/gradle/security/internal/KeyringFilePublicKeyService.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/security/org/gradle/security/internal/KeyringFilePublicKeyService.java new file mode 100644 index 0000000..25c91e9 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/security/org/gradle/security/internal/KeyringFilePublicKeyService.java @@ -0,0 +1,99 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.security.internal; + +import com.google.common.collect.ImmutableListMultimap; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMultimap; +import com.google.common.collect.Maps; +import com.google.common.collect.Multimap; +import org.bouncycastle.openpgp.PGPPublicKey; +import org.bouncycastle.openpgp.PGPPublicKeyRing; +import org.gradle.api.logging.Logger; +import org.gradle.api.logging.Logging; + +import java.io.File; +import java.io.IOException; +import java.io.UncheckedIOException; +import java.util.Arrays; +import java.util.Iterator; +import java.util.List; +import java.util.Map; + +public class KeyringFilePublicKeyService implements PublicKeyService { + private final static Logger LOGGER = Logging.getLogger(KeyringFilePublicKeyService.class); + + private final Map keyToKeyring; + private final Multimap longIdToPublicKeys; + + public KeyringFilePublicKeyService(File keyRingFile) { + try { + List keyrings = SecuritySupport.loadKeyRingFile(keyRingFile); + Map keyToKeyringBuilder = Maps.newHashMap(); + ImmutableMultimap.Builder longIdLongPGPPublicKeyBuilder = ImmutableListMultimap.builder(); + + for (PGPPublicKeyRing keyring : keyrings) { + Iterator it = keyring.getPublicKeys(); + while (it.hasNext()) { + PGPPublicKey key = it.next(); + Fingerprint fingerprint = Fingerprint.of(key); + keyToKeyringBuilder.put(fingerprint, keyring); + longIdLongPGPPublicKeyBuilder.put(key.getKeyID(), keyring); + } + } + keyToKeyring = ImmutableMap.copyOf(keyToKeyringBuilder); + longIdToPublicKeys = longIdLongPGPPublicKeyBuilder.build(); + LOGGER.info("Loaded {} keys from {}", keyToKeyring.size(), keyRingFile); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + @Override + public void close() { + + } + + @Override + public void findByLongId(long keyId, PublicKeyResultBuilder builder) { + for (PGPPublicKeyRing keyring : longIdToPublicKeys.get(keyId)) { + builder.keyRing(keyring); + Iterator pkIt = keyring.getPublicKeys(); + while (pkIt.hasNext()) { + PGPPublicKey key = pkIt.next(); + if (key.getKeyID() == keyId) { + builder.publicKey(key); + } + } + } + } + + @Override + public void findByFingerprint(byte[] bytes, PublicKeyResultBuilder builder) { + Fingerprint fingerprint = Fingerprint.wrap(bytes); + PGPPublicKeyRing keyring = keyToKeyring.get(fingerprint); + if (keyring != null) { + builder.keyRing(keyring); + Iterator pkIt = keyring.getPublicKeys(); + while (pkIt.hasNext()) { + PGPPublicKey key = pkIt.next(); + if (Arrays.equals(key.getFingerprint(), bytes)) { + builder.publicKey(key); + } + } + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/snapshots/org/gradle/internal/snapshot/ValueSnapshot.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/snapshots/org/gradle/internal/snapshot/ValueSnapshot.java new file mode 100644 index 0000000..29391f9 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/snapshots/org/gradle/internal/snapshot/ValueSnapshot.java @@ -0,0 +1,34 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.snapshot; + +import org.gradle.internal.hash.Hashable; + +import javax.annotation.Nullable; + +/** + * An immutable snapshot of the state of some Java object or object graph. + * + *

Implementations are not required to be able to recreate the object, and should retain as little state as possible. + * In particular, implementations should not hold on to user ClassLoaders.

+ */ +public interface ValueSnapshot extends Hashable { + /** + * Takes a snapshot of the given value, using this as a candidate snapshot. If the value is the same as the value represented by this snapshot, this snapshot must be returned. + */ + ValueSnapshot snapshot(@Nullable Object value, ValueSnapshotter snapshotter); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/snapshots/org/gradle/internal/snapshot/package-info.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/snapshots/org/gradle/internal/snapshot/package-info.java new file mode 100644 index 0000000..5607d06 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/snapshots/org/gradle/internal/snapshot/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@NonNullApi +package org.gradle.internal.snapshot; + +import org.gradle.api.NonNullApi; diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/snapshots/org/gradle/internal/vfs/impl/DefaultSnapshotHierarchy.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/snapshots/org/gradle/internal/vfs/impl/DefaultSnapshotHierarchy.java new file mode 100644 index 0000000..e5987a0 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/snapshots/org/gradle/internal/vfs/impl/DefaultSnapshotHierarchy.java @@ -0,0 +1,152 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.vfs.impl; + +import com.google.common.annotations.VisibleForTesting; +import org.gradle.internal.snapshot.CaseSensitivity; +import org.gradle.internal.snapshot.FileSystemNode; +import org.gradle.internal.snapshot.MetadataSnapshot; +import org.gradle.internal.snapshot.ReadOnlyFileSystemNode; +import org.gradle.internal.snapshot.SnapshotHierarchy; +import org.gradle.internal.snapshot.SnapshotUtil; +import org.gradle.internal.snapshot.VfsRelativePath; + +import java.util.Optional; + +import static org.gradle.internal.snapshot.SnapshotUtil.getSnapshotFromChild; +import static org.gradle.internal.snapshot.SnapshotUtil.invalidateSingleChild; +import static org.gradle.internal.snapshot.SnapshotUtil.storeSingleChild; + +public class DefaultSnapshotHierarchy implements SnapshotHierarchy { + + @VisibleForTesting + final FileSystemNode rootNode; + private final CaseSensitivity caseSensitivity; + + public static SnapshotHierarchy from(FileSystemNode rootNode, CaseSensitivity caseSensitivity) { + return new DefaultSnapshotHierarchy(rootNode, caseSensitivity); + } + + private DefaultSnapshotHierarchy(FileSystemNode rootNode, CaseSensitivity caseSensitivity) { + this.rootNode = rootNode; + this.caseSensitivity = caseSensitivity; + } + + public static SnapshotHierarchy empty(CaseSensitivity caseSensitivity) { + switch (caseSensitivity) { + case CASE_SENSITIVE: + return EmptySnapshotHierarchy.CASE_SENSITIVE; + case CASE_INSENSITIVE: + return EmptySnapshotHierarchy.CASE_INSENSITIVE; + default: + throw new AssertionError("Unknown case sensitivity: " + caseSensitivity); + } + } + + @Override + public Optional getMetadata(String absolutePath) { + VfsRelativePath relativePath = VfsRelativePath.of(absolutePath); + String pathToParent = rootNode.getPathToParent(); + if (!relativePath.hasPrefix(pathToParent, caseSensitivity)) { + return Optional.empty(); + } + return getSnapshotFromChild(rootNode, relativePath, caseSensitivity); + } + + @Override + public boolean hasDescendantsUnder(String absolutePath) { + return getNodeForLocation(absolutePath).hasDescendants(); + } + + @Override + public SnapshotHierarchy store(String absolutePath, MetadataSnapshot snapshot, NodeDiffListener diffListener) { + VfsRelativePath relativePath = VfsRelativePath.of(absolutePath); + return new DefaultSnapshotHierarchy(storeSingleChild(rootNode, relativePath, caseSensitivity, snapshot, diffListener), caseSensitivity); + } + + @Override + public SnapshotHierarchy invalidate(String absolutePath, NodeDiffListener diffListener) { + VfsRelativePath relativePath = VfsRelativePath.of(absolutePath); + return invalidateSingleChild(rootNode, relativePath, caseSensitivity, diffListener) + .map(newRootNode -> new DefaultSnapshotHierarchy(newRootNode, caseSensitivity)) + .orElse(empty()); + } + + @Override + public SnapshotHierarchy empty() { + return empty(caseSensitivity); + } + + @Override + public void visitSnapshotRoots(SnapshotVisitor snapshotVisitor) { + rootNode.accept(snapshotVisitor); + } + + @Override + public void visitSnapshotRoots(String absolutePath, SnapshotVisitor snapshotVisitor) { + getNodeForLocation(absolutePath).accept(snapshotVisitor); + } + + private ReadOnlyFileSystemNode getNodeForLocation(String absolutePath) { + return SnapshotUtil.getNodeFromChild(rootNode, VfsRelativePath.of(absolutePath), caseSensitivity).orElse(ReadOnlyFileSystemNode.EMPTY); + } + + private enum EmptySnapshotHierarchy implements SnapshotHierarchy { + CASE_SENSITIVE(CaseSensitivity.CASE_SENSITIVE), + CASE_INSENSITIVE(CaseSensitivity.CASE_INSENSITIVE); + + private final CaseSensitivity caseSensitivity; + + EmptySnapshotHierarchy(CaseSensitivity caseInsensitive) { + this.caseSensitivity = caseInsensitive; + } + + @Override + public Optional getMetadata(String absolutePath) { + return Optional.empty(); + } + + @Override + public boolean hasDescendantsUnder(String absolutePath) { + return false; + } + + @Override + public SnapshotHierarchy store(String absolutePath, MetadataSnapshot snapshot, NodeDiffListener diffListener) { + VfsRelativePath relativePath = VfsRelativePath.of(absolutePath); + FileSystemNode rootNode = snapshot.asFileSystemNode(relativePath.getAsString()); + diffListener.nodeAdded(rootNode); + return from(rootNode, caseSensitivity); + } + + @Override + public SnapshotHierarchy invalidate(String absolutePath, NodeDiffListener diffListener) { + return this; + } + + @Override + public SnapshotHierarchy empty() { + return this; + } + + @Override + public void visitSnapshotRoots(SnapshotVisitor snapshotVisitor) {} + + @Override + public void visitSnapshotRoots(String absolutePath, SnapshotVisitor snapshotVisitor) {} + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/test-kit/org/gradle/testkit/runner/internal/io/SynchronizedOutputStream.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/test-kit/org/gradle/testkit/runner/internal/io/SynchronizedOutputStream.java new file mode 100644 index 0000000..d580aa3 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/test-kit/org/gradle/testkit/runner/internal/io/SynchronizedOutputStream.java @@ -0,0 +1,54 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.testkit.runner.internal.io; + +import java.io.IOException; +import java.io.OutputStream; + +public class SynchronizedOutputStream extends OutputStream { + + private final OutputStream delegate; + + public SynchronizedOutputStream(OutputStream delegate) { + this.delegate = delegate; + } + + @Override + public synchronized void write(int b) throws IOException { + delegate.write(b); + } + + @Override + public synchronized void write(byte[] b) throws IOException { + delegate.write(b); + } + + @Override + public synchronized void write(byte[] b, int off, int len) throws IOException { + delegate.write(b, off, len); + } + + @Override + public synchronized void flush() throws IOException { + delegate.flush(); + } + + @Override + public synchronized void close() throws IOException { + delegate.close(); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/testing-base/org/gradle/api/internal/tasks/testing/DefaultTestTaskReports.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/testing-base/org/gradle/api/internal/tasks/testing/DefaultTestTaskReports.java new file mode 100644 index 0000000..c5bd62b --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/testing-base/org/gradle/api/internal/tasks/testing/DefaultTestTaskReports.java @@ -0,0 +1,51 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.testing; + +import org.gradle.api.Task; +import org.gradle.api.internal.CollectionCallbackActionDecorator; +import org.gradle.api.reporting.ConfigurableReport; +import org.gradle.api.reporting.DirectoryReport; +import org.gradle.api.reporting.Report; +import org.gradle.api.reporting.internal.TaskGeneratedSingleDirectoryReport; +import org.gradle.api.reporting.internal.TaskReportContainer; +import org.gradle.api.tasks.testing.JUnitXmlReport; +import org.gradle.api.tasks.testing.TestTaskReports; + +import javax.inject.Inject; + +public class DefaultTestTaskReports extends TaskReportContainer implements TestTaskReports { + + @Inject + public DefaultTestTaskReports(Task task, CollectionCallbackActionDecorator callbackActionDecorator) { + super(ConfigurableReport.class, task, callbackActionDecorator); + + add(DefaultJUnitXmlReport.class, "junitXml", task); + add(TaskGeneratedSingleDirectoryReport.class, "html", task, "index.html"); + } + + @Override + public DirectoryReport getHtml() { + return (DirectoryReport) getByName("html"); + } + + @Override + public JUnitXmlReport getJunitXml() { + return (JUnitXmlReport) getByName("junitXml"); + } + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/testing-base/org/gradle/api/internal/tasks/testing/worker/TestEventSerializer.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/testing-base/org/gradle/api/internal/tasks/testing/worker/TestEventSerializer.java new file mode 100644 index 0000000..bed3a97 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/testing-base/org/gradle/api/internal/tasks/testing/worker/TestEventSerializer.java @@ -0,0 +1,237 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.testing.worker; + +import org.gradle.api.internal.tasks.testing.*; +import org.gradle.api.tasks.testing.TestOutputEvent; +import org.gradle.api.tasks.testing.TestResult; +import org.gradle.internal.id.CompositeIdGenerator; +import org.gradle.internal.serialize.*; + +public class TestEventSerializer { + public static SerializerRegistry create() { + BaseSerializerFactory factory = new BaseSerializerFactory(); + DefaultSerializerRegistry registry = new DefaultSerializerRegistry(); + registry.register(DefaultTestClassRunInfo.class, new DefaultTestClassRunInfoSerializer()); + registry.register(CompositeIdGenerator.CompositeId.class, new IdSerializer()); + registry.register(DefaultTestSuiteDescriptor.class, new DefaultTestSuiteDescriptorSerializer()); + registry.register(WorkerTestClassProcessor.WorkerTestSuiteDescriptor.class, new WorkerTestSuiteDescriptorSerializer()); + registry.register(DefaultTestClassDescriptor.class, new DefaultTestClassDescriptorSerializer()); + registry.register(DefaultTestMethodDescriptor.class, new DefaultTestMethodDescriptorSerializer()); + registry.register(DefaultTestDescriptor.class, new DefaultTestDescriptorSerializer()); + registry.register(TestStartEvent.class, new TestStartEventSerializer()); + registry.register(TestCompleteEvent.class, new TestCompleteEventSerializer()); + registry.register(DefaultTestOutputEvent.class, new DefaultTestOutputEventSerializer()); + registry.register(Throwable.class, factory.getSerializerFor(Throwable.class)); + return registry; + } + + private static class NullableSerializer implements Serializer { + private final Serializer serializer; + + private NullableSerializer(Serializer serializer) { + this.serializer = serializer; + } + + @Override + public T read(Decoder decoder) throws Exception { + if (!decoder.readBoolean()) { + return null; + } + return serializer.read(decoder); + } + + @Override + public void write(Encoder encoder, T value) throws Exception { + encoder.writeBoolean(value != null); + if (value != null) { + serializer.write(encoder, value); + } + } + } + + private static class IdSerializer implements Serializer { + @Override + public CompositeIdGenerator.CompositeId read(Decoder decoder) throws Exception { + return new CompositeIdGenerator.CompositeId(decoder.readLong(), decoder.readLong()); + } + + @Override + public void write(Encoder encoder, CompositeIdGenerator.CompositeId value) throws Exception { + encoder.writeLong((Long) value.getScope()); + encoder.writeLong((Long) value.getId()); + } + } + + private static class DefaultTestClassRunInfoSerializer implements Serializer { + @Override + public DefaultTestClassRunInfo read(Decoder decoder) throws Exception { + return new DefaultTestClassRunInfo(decoder.readString()); + } + + @Override + public void write(Encoder encoder, DefaultTestClassRunInfo value) throws Exception { + encoder.writeString(value.getTestClassName()); + } + } + + private static class TestStartEventSerializer implements Serializer { + final Serializer idSerializer = new NullableSerializer(new IdSerializer()); + + @Override + public TestStartEvent read(Decoder decoder) throws Exception { + long time = decoder.readLong(); + Object id = idSerializer.read(decoder); + return new TestStartEvent(time, id); + } + + @Override + public void write(Encoder encoder, TestStartEvent value) throws Exception { + encoder.writeLong(value.getStartTime()); + idSerializer.write(encoder, (CompositeIdGenerator.CompositeId) value.getParentId()); + } + } + + private static class TestCompleteEventSerializer implements Serializer { + private final Serializer typeSerializer = new NullableSerializer(new BaseSerializerFactory().getSerializerFor(TestResult.ResultType.class)); + + @Override + public TestCompleteEvent read(Decoder decoder) throws Exception { + long endTime = decoder.readLong(); + TestResult.ResultType result = typeSerializer.read(decoder); + return new TestCompleteEvent(endTime, result); + } + + @Override + public void write(Encoder encoder, TestCompleteEvent value) throws Exception { + encoder.writeLong(value.getEndTime()); + typeSerializer.write(encoder, value.getResultType()); + } + } + + private static class DefaultTestOutputEventSerializer implements Serializer { + private final Serializer destinationSerializer = new BaseSerializerFactory().getSerializerFor(TestOutputEvent.Destination.class); + + @Override + public DefaultTestOutputEvent read(Decoder decoder) throws Exception { + TestOutputEvent.Destination destination = destinationSerializer.read(decoder); + String message = decoder.readString(); + return new DefaultTestOutputEvent(destination, message); + } + + @Override + public void write(Encoder encoder, DefaultTestOutputEvent value) throws Exception { + destinationSerializer.write(encoder, value.getDestination()); + encoder.writeString(value.getMessage()); + } + } + + private static class DefaultTestSuiteDescriptorSerializer implements Serializer { + final Serializer idSerializer = new IdSerializer(); + + @Override + public DefaultTestSuiteDescriptor read(Decoder decoder) throws Exception { + Object id = idSerializer.read(decoder); + String name = decoder.readString(); + return new DefaultTestSuiteDescriptor(id, name); + } + + @Override + public void write(Encoder encoder, DefaultTestSuiteDescriptor value) throws Exception { + idSerializer.write(encoder, (CompositeIdGenerator.CompositeId) value.getId()); + encoder.writeString(value.getName()); + } + } + + private static class WorkerTestSuiteDescriptorSerializer implements Serializer { + final Serializer idSerializer = new IdSerializer(); + + @Override + public WorkerTestClassProcessor.WorkerTestSuiteDescriptor read(Decoder decoder) throws Exception { + Object id = idSerializer.read(decoder); + String name = decoder.readString(); + return new WorkerTestClassProcessor.WorkerTestSuiteDescriptor(id, name); + } + + @Override + public void write(Encoder encoder, WorkerTestClassProcessor.WorkerTestSuiteDescriptor value) throws Exception { + idSerializer.write(encoder, (CompositeIdGenerator.CompositeId) value.getId()); + encoder.writeString(value.getName()); + } + } + + private static class DefaultTestClassDescriptorSerializer implements Serializer { + final Serializer idSerializer = new IdSerializer(); + + @Override + public DefaultTestClassDescriptor read(Decoder decoder) throws Exception { + Object id = idSerializer.read(decoder); + String name = decoder.readString(); + String displayName = decoder.readString(); + return new DefaultTestClassDescriptor(id, name, displayName); + } + + @Override + public void write(Encoder encoder, DefaultTestClassDescriptor value) throws Exception { + idSerializer.write(encoder, (CompositeIdGenerator.CompositeId) value.getId()); + encoder.writeString(value.getName()); + encoder.writeString(value.getDisplayName()); + } + } + + private static class DefaultTestDescriptorSerializer implements Serializer { + final Serializer idSerializer = new IdSerializer(); + + @Override + public DefaultTestDescriptor read(Decoder decoder) throws Exception { + Object id = idSerializer.read(decoder); + String className = decoder.readString(); + String classDisplayName = decoder.readString(); + String name = decoder.readString(); + String displayName = decoder.readString(); + return new DefaultTestDescriptor(id, className, name, classDisplayName, displayName); + } + + @Override + public void write(Encoder encoder, DefaultTestDescriptor value) throws Exception { + idSerializer.write(encoder, (CompositeIdGenerator.CompositeId) value.getId()); + encoder.writeString(value.getClassName()); + encoder.writeString(value.getClassDisplayName()); + encoder.writeString(value.getName()); + encoder.writeString(value.getDisplayName()); + } + } + + private static class DefaultTestMethodDescriptorSerializer implements Serializer { + final Serializer idSerializer = new IdSerializer(); + + @Override + public DefaultTestMethodDescriptor read(Decoder decoder) throws Exception { + Object id = idSerializer.read(decoder); + String className = decoder.readString(); + String name = decoder.readString(); + return new DefaultTestMethodDescriptor(id, className, name); + } + + @Override + public void write(Encoder encoder, DefaultTestMethodDescriptor value) throws Exception { + idSerializer.write(encoder, (CompositeIdGenerator.CompositeId) value.getId()); + encoder.writeString(value.getClassName()); + encoder.writeString(value.getName()); + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/testing-base/org/gradle/api/internal/tasks/testing/worker/WorkerTestClassProcessor.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/testing-base/org/gradle/api/internal/tasks/testing/worker/WorkerTestClassProcessor.java new file mode 100644 index 0000000..68be3d1 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/testing-base/org/gradle/api/internal/tasks/testing/worker/WorkerTestClassProcessor.java @@ -0,0 +1,41 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.testing.worker; + +import org.gradle.api.internal.tasks.testing.DefaultTestSuiteDescriptor; +import org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor; +import org.gradle.api.internal.tasks.testing.TestClassProcessor; +import org.gradle.internal.time.Clock; + +public class WorkerTestClassProcessor extends SuiteTestClassProcessor { + + public WorkerTestClassProcessor(TestClassProcessor processor, Object workerSuiteId, String workerDisplayName, + Clock clock) { + super(new WorkerTestSuiteDescriptor(workerSuiteId, workerDisplayName), processor, clock); + } + + public static class WorkerTestSuiteDescriptor extends DefaultTestSuiteDescriptor { + public WorkerTestSuiteDescriptor(Object id, String name) { + super(id, name); + } + + @Override + public String toString() { + return getName(); + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/testing-native/org/gradle/nativeplatform/test/internal/NativeTestSuiteBinaryRenderer.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/testing-native/org/gradle/nativeplatform/test/internal/NativeTestSuiteBinaryRenderer.java new file mode 100644 index 0000000..dea9875 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/testing-native/org/gradle/nativeplatform/test/internal/NativeTestSuiteBinaryRenderer.java @@ -0,0 +1,64 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.nativeplatform.test.internal; + +import org.gradle.api.tasks.diagnostics.internal.text.TextReportBuilder; +import org.gradle.model.internal.manage.schema.ModelSchemaStore; +import org.gradle.nativeplatform.NativeBinarySpec; +import org.gradle.nativeplatform.NativeComponentSpec; +import org.gradle.nativeplatform.internal.AbstractNativeBinaryRenderer; +import org.gradle.nativeplatform.test.NativeTestSuiteBinarySpec; +import org.gradle.nativeplatform.test.NativeTestSuiteSpec; + +import javax.inject.Inject; + +public class NativeTestSuiteBinaryRenderer extends AbstractNativeBinaryRenderer { + @Inject + public NativeTestSuiteBinaryRenderer(ModelSchemaStore schemaStore) { + super(schemaStore); + } + + @Override + public Class getTargetType() { + return NativeTestSuiteBinarySpec.class; + } + + @Override + protected void renderTasks(NativeTestSuiteBinarySpec binary, TextReportBuilder builder) { + builder.item("install using task", binary.getTasks().getInstall().getPath()); + builder.item("run using task", binary.getTasks().getRun().getPath()); + } + + @Override + protected void renderOutputs(NativeTestSuiteBinarySpec binary, TextReportBuilder builder) { + builder.item("executable file", binary.getExecutableFile()); + } + + @Override + protected void renderDetails(NativeTestSuiteBinarySpec binary, TextReportBuilder builder) { + NativeTestSuiteSpec testSuite = binary.getTestSuite(); + NativeComponentSpec testedComponent = testSuite.getTestedComponent(); + if (testedComponent!=null) { + builder.item("component under test", testedComponent.getDisplayName()); + } + NativeBinarySpec testedBinary = binary.getTestedBinary(); + if (testedBinary != null) { + builder.item("binary under test", testedBinary.getDisplayName()); + } + super.renderDetails(binary, builder); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/testing-native/org/gradle/nativeplatform/test/xctest/SwiftXCTestBinary.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/testing-native/org/gradle/nativeplatform/test/xctest/SwiftXCTestBinary.java new file mode 100644 index 0000000..36fa776 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/testing-native/org/gradle/nativeplatform/test/xctest/SwiftXCTestBinary.java @@ -0,0 +1,66 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.nativeplatform.test.xctest; + +import org.gradle.api.file.Directory; +import org.gradle.api.file.RegularFile; +import org.gradle.api.provider.Provider; +import org.gradle.language.swift.SwiftBinary; +import org.gradle.nativeplatform.tasks.AbstractLinkTask; +import org.gradle.nativeplatform.test.TestComponent; +import org.gradle.nativeplatform.test.xctest.tasks.XCTest; + +/** + * An test binary built from Swift source. + * + * @since 4.4 + */ +public interface SwiftXCTestBinary extends SwiftBinary, TestComponent { + /** + * Returns the executable test file for this binary. + * + * @since 4.5 + */ + Provider getExecutableFile(); + + /** + * Returns the installation directory for this binary. + * + * @since 4.4 + */ + Provider getInstallDirectory(); + + /** + * Returns the script for running this binary. + * + * @since 4.4 + */ + Provider getRunScriptFile(); + + /** + * Returns the link task for this binary. + * + * @since 4.5 + */ + Provider getLinkTask(); + + /** + * {@inheritDoc} + */ + @Override + Provider getRunTask(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api-builders/org/gradle/tooling/internal/provider/runner/SubtreeFilteringBuildOperationListener.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api-builders/org/gradle/tooling/internal/provider/runner/SubtreeFilteringBuildOperationListener.java new file mode 100644 index 0000000..6b8fe74 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api-builders/org/gradle/tooling/internal/provider/runner/SubtreeFilteringBuildOperationListener.java @@ -0,0 +1,106 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.provider.runner; + +import com.google.common.collect.Sets; +import org.gradle.internal.build.event.BuildEventSubscriptions; +import org.gradle.internal.operations.BuildOperationDescriptor; +import org.gradle.internal.operations.BuildOperationListener; +import org.gradle.internal.operations.OperationFinishEvent; +import org.gradle.internal.operations.OperationIdentifier; +import org.gradle.internal.operations.OperationProgressEvent; +import org.gradle.internal.operations.OperationStartEvent; +import org.gradle.tooling.events.OperationType; +import org.gradle.tooling.internal.protocol.events.InternalOperationFinishedProgressEvent; +import org.gradle.tooling.internal.protocol.events.InternalOperationStartedProgressEvent; + +import java.util.Set; + +/** + * Build operation listener responsible for a certain operation type that is detected by + * checking for a specific details class. + * + *

If the operation type is not requested, all events in the corresponding subtree + * are skipped, i.e. neither reported to the consumer nor passed on to the delegate. + * + * @since 5.1 + */ +abstract class SubtreeFilteringBuildOperationListener implements BuildOperationListener { + + protected final ProgressEventConsumer eventConsumer; + private final BuildOperationListener delegate; + private final Class detailsClass; + + // BuildOperationListener dispatch is not serialized + private final Set skipEvents = Sets.newConcurrentHashSet(); + private final boolean enabled; + + SubtreeFilteringBuildOperationListener(ProgressEventConsumer eventConsumer, BuildEventSubscriptions clientSubscriptions, BuildOperationListener delegate, OperationType operationType, Class detailsClass) { + this.eventConsumer = eventConsumer; + this.delegate = delegate; + this.detailsClass = detailsClass; + this.enabled = clientSubscriptions.isRequested(operationType); + } + + protected boolean isEnabled() { + return enabled; + } + + @Override + public void started(BuildOperationDescriptor buildOperation, OperationStartEvent startEvent) { + OperationIdentifier parentId = buildOperation.getParentId(); + if (parentId != null && skipEvents.contains(parentId)) { + skipEvents.add(buildOperation.getId()); + return; + } + + if (detailsClass.isInstance(buildOperation.getDetails())) { + if (enabled) { + D details = detailsClass.cast(buildOperation.getDetails()); + eventConsumer.started(toStartedEvent(buildOperation, startEvent, details)); + } else { + // Discard this operation and all children + skipEvents.add(buildOperation.getId()); + } + } else { + delegate.started(buildOperation, startEvent); + } + } + + @Override + public void progress(OperationIdentifier buildOperationId, OperationProgressEvent progressEvent) { + } + + @Override + public void finished(BuildOperationDescriptor buildOperation, OperationFinishEvent finishEvent) { + if (skipEvents.remove(buildOperation.getId())) { + return; + } + + if (detailsClass.isInstance(buildOperation.getDetails())) { + D details = detailsClass.cast(buildOperation.getDetails()); + eventConsumer.finished(toFinishedEvent(buildOperation, finishEvent, details)); + } else { + delegate.finished(buildOperation, finishEvent); + } + } + + protected abstract InternalOperationStartedProgressEvent toStartedEvent(BuildOperationDescriptor buildOperation, OperationStartEvent startEvent, D details); + + protected abstract InternalOperationFinishedProgressEvent toFinishedEvent(BuildOperationDescriptor buildOperation, OperationFinishEvent finishEvent, D details); + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api-builders/org/gradle/tooling/internal/provider/runner/TestIgnoringBuildOperationListener.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api-builders/org/gradle/tooling/internal/provider/runner/TestIgnoringBuildOperationListener.java new file mode 100644 index 0000000..091f8d8 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api-builders/org/gradle/tooling/internal/provider/runner/TestIgnoringBuildOperationListener.java @@ -0,0 +1,57 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.provider.runner; + +import org.gradle.api.internal.tasks.testing.operations.ExecuteTestBuildOperationType; +import org.gradle.internal.operations.BuildOperationDescriptor; +import org.gradle.internal.operations.BuildOperationListener; +import org.gradle.internal.operations.OperationFinishEvent; +import org.gradle.internal.operations.OperationIdentifier; +import org.gradle.internal.operations.OperationProgressEvent; +import org.gradle.internal.operations.OperationStartEvent; + +/** + * Build operation listener that filters test related build operations before forwarding to a delegate. + * + * @since 4.4 + */ +class TestIgnoringBuildOperationListener implements BuildOperationListener { + private final BuildOperationListener delegate; + + public TestIgnoringBuildOperationListener(BuildOperationListener delegate) { + this.delegate = delegate; + } + + @Override + public void started(BuildOperationDescriptor buildOperation, OperationStartEvent startEvent) { + if (!(buildOperation.getDetails() instanceof ExecuteTestBuildOperationType.Details)) { + delegate.started(buildOperation, startEvent); + } + } + + @Override + public void progress(OperationIdentifier buildOperationId, OperationProgressEvent progressEvent) { + } + + @Override + public void finished(BuildOperationDescriptor buildOperation, OperationFinishEvent finishEvent) { + if (!(buildOperation.getDetails() instanceof ExecuteTestBuildOperationType.Details)) { + delegate.finished(buildOperation, finishEvent); + } + } + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/events/internal/DefaultStatusEvent.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/events/internal/DefaultStatusEvent.java new file mode 100644 index 0000000..66d52dd --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/events/internal/DefaultStatusEvent.java @@ -0,0 +1,52 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.events.internal; + +import org.gradle.tooling.events.OperationDescriptor; +import org.gradle.tooling.events.StatusEvent; + +/** + * Base implementation of the {@code StatusEvent} interface. + */ +public class DefaultStatusEvent extends BaseProgressEvent implements StatusEvent { + + private final long total; + private final long progress; + private final String unit; + + public DefaultStatusEvent(long eventTime, String displayName, OperationDescriptor descriptor, long total, long progress, String unit) { + super(eventTime, displayName, descriptor); + this.total = total; + this.progress = progress; + this.unit = unit; + } + + @Override + public long getProgress() { + return progress; + } + + @Override + public long getTotal() { + return total; + } + + @Override + public String getUnit() { + return unit; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/consumer/DefaultTestLauncher.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/consumer/DefaultTestLauncher.java new file mode 100644 index 0000000..01d4750 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/consumer/DefaultTestLauncher.java @@ -0,0 +1,198 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.consumer; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableSet; +import org.gradle.api.Transformer; +import org.gradle.tooling.ResultHandler; +import org.gradle.tooling.TestExecutionException; +import org.gradle.tooling.TestLauncher; +import org.gradle.tooling.events.test.TestOperationDescriptor; +import org.gradle.tooling.events.test.internal.DefaultDebugOptions; +import org.gradle.tooling.internal.consumer.async.AsyncConsumerActionExecutor; +import org.gradle.tooling.internal.consumer.connection.ConsumerAction; +import org.gradle.tooling.internal.consumer.connection.ConsumerConnection; +import org.gradle.tooling.internal.consumer.parameters.ConsumerOperationParameters; +import org.gradle.tooling.internal.protocol.test.InternalJvmTestRequest; +import org.gradle.util.CollectionUtils; + +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public class DefaultTestLauncher extends AbstractLongRunningOperation implements TestLauncher { + + private final AsyncConsumerActionExecutor connection; + private final Set operationDescriptors = new LinkedHashSet(); + private final Set testClassNames = new LinkedHashSet(); + private final Set internalJvmTestRequests = new LinkedHashSet(); + private final DefaultDebugOptions debugOptions = new DefaultDebugOptions(); + private final Map> tasksAndTests = new HashMap>(); + + public DefaultTestLauncher(AsyncConsumerActionExecutor connection, ConnectionParameters parameters) { + super(parameters); + operationParamsBuilder.setTasks(Collections.emptyList()); + operationParamsBuilder.setEntryPoint("TestLauncher API"); + this.connection = connection; + } + + @Override + protected DefaultTestLauncher getThis() { + return this; + } + + @Override + public TestLauncher withTests(TestOperationDescriptor... testDescriptors) { + withTests(Arrays.asList(testDescriptors)); + return this; + } + + @Override + public TestLauncher withTests(Iterable descriptors) { + operationDescriptors.addAll(CollectionUtils.toList(descriptors)); + return this; + } + + @Override + public TestLauncher withJvmTestClasses(String... classNames) { + withJvmTestClasses(Arrays.asList(classNames)); + return this; + } + + @Override + public TestLauncher withJvmTestClasses(Iterable testClasses) { + List newRequests = CollectionUtils.collect(testClasses, new Transformer() { + @Override + public InternalJvmTestRequest transform(String testClass) { + return new DefaultInternalJvmTestRequest(testClass, null); + } + }); + internalJvmTestRequests.addAll(newRequests); + testClassNames.addAll(CollectionUtils.toList(testClasses)); + return this; + } + + @Override + public TestLauncher withJvmTestMethods(String testClass, String... methods) { + withJvmTestMethods(testClass, Arrays.asList(methods)); + return this; + } + + @Override + public TestLauncher withJvmTestMethods(final String testClass, Iterable methods) { + List newRequests = CollectionUtils.collect(methods, new Transformer() { + @Override + public InternalJvmTestRequest transform(String methodName) { + return new DefaultInternalJvmTestRequest(testClass, methodName); + } + }); + this.internalJvmTestRequests.addAll(newRequests); + this.testClassNames.add(testClass); + return this; + } + + @Override + public TestLauncher withTaskAndTestClasses(String task, Iterable testClasses) { + List tests = CollectionUtils.collect(testClasses, new Transformer() { + @Override + public InternalJvmTestRequest transform(String testClass) { + return new DefaultInternalJvmTestRequest(testClass, null); + } + }); + + addTests(task, tests); + return this; + } + + @Override + public TestLauncher withTaskAndTestMethods(String task, final String testClass, Iterable methods) { + List tests = CollectionUtils.collect(methods, new Transformer() { + @Override + public InternalJvmTestRequest transform(String methodName) { + return new DefaultInternalJvmTestRequest(testClass, methodName); + } + }); + addTests(task, tests); + return this; + } + + private void addTests(String task, List tests) { + List existing = tasksAndTests.get(task); + if (existing == null) { + tasksAndTests.put(task, tests); + } else { + existing.addAll(tests); + tasksAndTests.put(task, existing); + } + } + + @Override + public TestLauncher debugTestsOn(int port) { + this.debugOptions.setPort(port); + return this; + } + + @Override + public void run() { + BlockingResultHandler handler = new BlockingResultHandler(Void.class); + run(handler); + handler.getResult(); + } + + @Override + public void run(final ResultHandler handler) { + if (operationDescriptors.isEmpty() && internalJvmTestRequests.isEmpty() && tasksAndTests.isEmpty()) { + throw new TestExecutionException("No test declared for execution."); + } + for (Map.Entry> entry : tasksAndTests.entrySet()) { + if (entry.getValue().isEmpty()) { + throw new TestExecutionException("No test for task " + entry.getKey() + " declared for execution."); + } + } + final ConsumerOperationParameters operationParameters = getConsumerOperationParameters(); + final TestExecutionRequest testExecutionRequest = new TestExecutionRequest(operationDescriptors, ImmutableList.copyOf(testClassNames), ImmutableSet.copyOf(internalJvmTestRequests), debugOptions, ImmutableMap.copyOf(tasksAndTests)); + connection.run(new ConsumerAction() { + @Override + public ConsumerOperationParameters getParameters() { + return operationParameters; + } + + @Override + public Void run(ConsumerConnection connection) { + connection.runTests(testExecutionRequest, getParameters()); + return null; + } + }, new ResultHandlerAdapter(handler)); + } + + private class ResultHandlerAdapter extends org.gradle.tooling.internal.consumer.ResultHandlerAdapter { + public ResultHandlerAdapter(ResultHandler handler) { + super(handler, new ExceptionTransformer(new Transformer() { + @Override + public String transform(Throwable throwable) { + return String.format("Could not execute tests using %s.", connection.getDisplayName()); + } + })); + } + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/consumer/ExceptionTransformer.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/consumer/ExceptionTransformer.java new file mode 100644 index 0000000..3cde162 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/consumer/ExceptionTransformer.java @@ -0,0 +1,62 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.consumer; + +import org.gradle.api.Transformer; +import org.gradle.internal.event.ListenerNotificationException; +import org.gradle.tooling.*; +import org.gradle.tooling.exceptions.UnsupportedBuildArgumentException; +import org.gradle.tooling.exceptions.UnsupportedOperationConfigurationException; +import org.gradle.tooling.internal.protocol.BuildExceptionVersion1; +import org.gradle.tooling.internal.protocol.InternalBuildCancelledException; +import org.gradle.tooling.internal.protocol.exceptions.InternalUnsupportedBuildArgumentException; +import org.gradle.tooling.internal.protocol.test.InternalTestExecutionException; + +public class ExceptionTransformer implements Transformer { + private final Transformer connectionFailureProvider; + + public ExceptionTransformer(Transformer connectionFailureProvider) { + this.connectionFailureProvider = connectionFailureProvider; + } + + @Override + public GradleConnectionException transform(Throwable failure) { + if (failure instanceof InternalUnsupportedBuildArgumentException) { + return new UnsupportedBuildArgumentException(connectionFailureMessage(failure) + + "\n" + failure.getMessage(), failure); + } else if (failure instanceof UnsupportedOperationConfigurationException) { + return new UnsupportedOperationConfigurationException(connectionFailureMessage(failure) + + "\n" + failure.getMessage(), failure.getCause()); + } else if (failure instanceof GradleConnectionException) { + return (GradleConnectionException) failure; + } else if (failure instanceof InternalBuildCancelledException) { + return new BuildCancelledException(connectionFailureMessage(failure), failure.getCause()); + } else if (failure instanceof InternalTestExecutionException) { + return new TestExecutionException(connectionFailureMessage(failure), failure.getCause()); + } else if (failure instanceof BuildExceptionVersion1) { + return new BuildException(connectionFailureMessage(failure), failure.getCause()); + } else if (failure instanceof ListenerNotificationException) { + return new ListenerFailedException(connectionFailureMessage(failure), ((ListenerNotificationException) failure).getCauses()); + } else { + return new GradleConnectionException(connectionFailureMessage(failure), failure); + } + } + + private String connectionFailureMessage(Throwable failure) { + return connectionFailureProvider.transform(failure); + } +}; diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/consumer/converters/IdeaModuleDependencyTargetNameMixin.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/consumer/converters/IdeaModuleDependencyTargetNameMixin.java new file mode 100644 index 0000000..0eeec2d --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/consumer/converters/IdeaModuleDependencyTargetNameMixin.java @@ -0,0 +1,38 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.consumer.converters; + +import org.gradle.tooling.model.idea.IdeaDependency; + +/** + * This is used for compatibility with clients <2.14 + */ +public class IdeaModuleDependencyTargetNameMixin { + private final IdeaDependency ideaModuleDependency; + + public IdeaModuleDependencyTargetNameMixin(IdeaDependency ideaModuleDependency) { + this.ideaModuleDependency = ideaModuleDependency; + } + + public String getTargetModuleName() { + if (ideaModuleDependency instanceof BackwardsCompatibleIdeaModuleDependency) { + BackwardsCompatibleIdeaModuleDependency dependency = (BackwardsCompatibleIdeaModuleDependency) ideaModuleDependency; + return dependency.getDependencyModule().getName(); + } + return null; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/consumer/loader/DefaultToolingImplementationLoader.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/consumer/loader/DefaultToolingImplementationLoader.java new file mode 100644 index 0000000..39d9637 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/consumer/loader/DefaultToolingImplementationLoader.java @@ -0,0 +1,122 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.tooling.internal.consumer.loader; + +import org.gradle.api.JavaVersion; +import org.gradle.initialization.BuildCancellationToken; +import org.gradle.internal.Factory; +import org.gradle.internal.classloader.FilteringClassLoader; +import org.gradle.internal.classloader.VisitableURLClassLoader; +import org.gradle.internal.classpath.ClassPath; +import org.gradle.internal.logging.progress.ProgressLoggerFactory; +import org.gradle.internal.service.DefaultServiceLocator; +import org.gradle.internal.service.ServiceLocator; +import org.gradle.tooling.GradleConnectionException; +import org.gradle.tooling.UnsupportedVersionException; +import org.gradle.tooling.internal.adapter.ProtocolToModelAdapter; +import org.gradle.tooling.internal.consumer.ConnectionParameters; +import org.gradle.tooling.internal.consumer.Distribution; +import org.gradle.tooling.internal.consumer.connection.AbstractConsumerConnection; +import org.gradle.tooling.internal.consumer.connection.ConsumerConnection; +import org.gradle.tooling.internal.consumer.connection.NoToolingApiConnection; +import org.gradle.tooling.internal.consumer.connection.NotifyDaemonsAboutChangedPathsConsumerConnection; +import org.gradle.tooling.internal.consumer.connection.ParameterAcceptingConsumerConnection; +import org.gradle.tooling.internal.consumer.connection.ParameterValidatingConsumerConnection; +import org.gradle.tooling.internal.consumer.connection.PhasedActionAwareConsumerConnection; +import org.gradle.tooling.internal.consumer.connection.StopWhenIdleConsumerConnection; +import org.gradle.tooling.internal.consumer.connection.TestExecutionConsumerConnection; +import org.gradle.tooling.internal.consumer.connection.UnsupportedOlderVersionConnection; +import org.gradle.tooling.internal.consumer.converters.ConsumerTargetTypeProvider; +import org.gradle.tooling.internal.consumer.versioning.ModelMapping; +import org.gradle.tooling.internal.consumer.versioning.VersionDetails; +import org.gradle.tooling.internal.protocol.ConnectionVersion4; +import org.gradle.tooling.internal.protocol.InternalBuildProgressListener; +import org.gradle.tooling.internal.protocol.InternalInvalidatableVirtualFileSystemConnection; +import org.gradle.tooling.internal.protocol.InternalParameterAcceptingConnection; +import org.gradle.tooling.internal.protocol.InternalPhasedActionConnection; +import org.gradle.tooling.internal.protocol.InternalStopWhenIdleConnection; +import org.gradle.tooling.internal.protocol.test.InternalTestExecutionConnection; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; + +/** + * Loads the tooling API implementation of the Gradle version that will run the build (the "provider"). + * Adapts the rather clunky cross-version interface to the more readable interface of the TAPI client. + */ +public class DefaultToolingImplementationLoader implements ToolingImplementationLoader { + private static final Logger LOGGER = LoggerFactory.getLogger(DefaultToolingImplementationLoader.class); + private final ClassLoader classLoader; + + public DefaultToolingImplementationLoader() { + this(DefaultToolingImplementationLoader.class.getClassLoader()); + } + + DefaultToolingImplementationLoader(ClassLoader classLoader) { + this.classLoader = classLoader; + } + + @Override + public ConsumerConnection create(Distribution distribution, ProgressLoggerFactory progressLoggerFactory, InternalBuildProgressListener progressListener, ConnectionParameters connectionParameters, BuildCancellationToken cancellationToken) { + LOGGER.debug("Using tooling provider from {}", distribution.getDisplayName()); + ClassLoader serviceClassLoader = createImplementationClassLoader(distribution, progressLoggerFactory, progressListener, connectionParameters.getGradleUserHomeDir(), cancellationToken); + ServiceLocator serviceLocator = new DefaultServiceLocator(serviceClassLoader); + try { + Factory factory = serviceLocator.findFactory(ConnectionVersion4.class); + if (factory == null) { + return new NoToolingApiConnection(distribution); + } + ConnectionVersion4 connection = factory.create(); + + ProtocolToModelAdapter adapter = new ProtocolToModelAdapter(new ConsumerTargetTypeProvider()); + ModelMapping modelMapping = new ModelMapping(); + if (connection instanceof InternalStopWhenIdleConnection) { + return createConnection(new StopWhenIdleConsumerConnection(connection, modelMapping, adapter), connectionParameters); + } else if (connection instanceof InternalInvalidatableVirtualFileSystemConnection) { + return createConnection(new NotifyDaemonsAboutChangedPathsConsumerConnection(connection, modelMapping, adapter), connectionParameters); + } else if (connection instanceof InternalPhasedActionConnection) { + return createConnection(new PhasedActionAwareConsumerConnection(connection, modelMapping, adapter), connectionParameters); + } else if (connection instanceof InternalParameterAcceptingConnection) { + return createConnection(new ParameterAcceptingConsumerConnection(connection, modelMapping, adapter), connectionParameters); + } else if (connection instanceof InternalTestExecutionConnection) { + return createConnection(new TestExecutionConsumerConnection(connection, modelMapping, adapter), connectionParameters); + } else { + return new UnsupportedOlderVersionConnection(connection, adapter); + } + } catch (UnsupportedVersionException e) { + throw e; + } catch (Throwable t) { + throw new GradleConnectionException(String.format("Could not create an instance of Tooling API implementation using the specified %s.", distribution.getDisplayName()), t); + } + } + + private ConsumerConnection createConnection(AbstractConsumerConnection adaptedConnection, ConnectionParameters connectionParameters) { + adaptedConnection.configure(connectionParameters); + VersionDetails versionDetails = adaptedConnection.getVersionDetails(); + return new ParameterValidatingConsumerConnection(versionDetails, adaptedConnection); + } + + private ClassLoader createImplementationClassLoader(Distribution distribution, ProgressLoggerFactory progressLoggerFactory, InternalBuildProgressListener progressListener, File userHomeDir, BuildCancellationToken cancellationToken) { + ClassPath implementationClasspath = distribution.getToolingImplementationClasspath(progressLoggerFactory, progressListener, userHomeDir, cancellationToken); + LOGGER.debug("Using tooling provider classpath: {}", implementationClasspath); + FilteringClassLoader.Spec filterSpec = new FilteringClassLoader.Spec(); + filterSpec.allowPackage("org.gradle.tooling.internal.protocol"); + filterSpec.allowClass(JavaVersion.class); + FilteringClassLoader filteringClassLoader = new FilteringClassLoader(classLoader, filterSpec); + return new VisitableURLClassLoader("tooling-implementation-loader", filteringClassLoader, implementationClasspath); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/protocol/InternalBuildAction.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/protocol/InternalBuildAction.java new file mode 100644 index 0000000..ace066d --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/protocol/InternalBuildAction.java @@ -0,0 +1,42 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.protocol; + +import java.io.Serializable; + +/** + *

DO NOT CHANGE THIS INTERFACE - it is part of the cross-version protocol. + * + *

Consumer compatibility: This interface is implemented by all consumer versions from 1.8-rc-1.

+ *

Provider compatibility: This interface is consumed by all provider versions from 1.8-rc-1 to 4.3. It is also used by later providers when the consumer does not + * implement newer interfaces. + *

+ * + * @since 1.8-rc-1 + * @deprecated 4.4. Use {@link InternalBuildActionVersion2} instead. + */ +@Deprecated +public interface InternalBuildAction extends InternalProtocolInterface, Serializable { + /** + * Performs some action against a build and returns a result. + * + * @since 1.8-rc-1 + * @deprecated 4.4. Use {@link InternalBuildActionVersion2#execute(InternalBuildControllerVersion2)} instead. + */ + @Deprecated + T execute(InternalBuildController buildController); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/protocol/InternalPhasedAction.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/protocol/InternalPhasedAction.java new file mode 100644 index 0000000..e6ad24b --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/protocol/InternalPhasedAction.java @@ -0,0 +1,43 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.protocol; + +import javax.annotation.Nullable; +import java.io.Serializable; + +/** + *

DO NOT CHANGE THIS INTERFACE - it is part of the cross-version protocol. + * + *

Consumer compatibility: This interface is implemented by all consumer versions from 4.8.

+ *

Provider compatibility: This interface is consumed by all provider versions from 4.8.

+ * + * @since 4.8 + */ +public interface InternalPhasedAction extends InternalProtocolInterface, Serializable { + + /** + * Internal version of the action to be run after projects are loaded. + */ + @Nullable + InternalBuildActionVersion2 getProjectsLoadedAction(); + + /** + * Internal version of the action to be run after tasks are run. + */ + @Nullable + InternalBuildActionVersion2 getBuildFinishedAction(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/protocol/events/InternalOperationStartedProgressEvent.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/protocol/events/InternalOperationStartedProgressEvent.java new file mode 100644 index 0000000..fa39ec8 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/protocol/events/InternalOperationStartedProgressEvent.java @@ -0,0 +1,25 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.protocol.events; + +/** + * DO NOT CHANGE THIS INTERFACE. It is part of the cross-version protocol. + * + * @since 2.5 + */ +public interface InternalOperationStartedProgressEvent extends InternalProgressEvent { +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/protocol/events/InternalScriptPluginIdentifier.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/protocol/events/InternalScriptPluginIdentifier.java new file mode 100644 index 0000000..9f67251 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/protocol/events/InternalScriptPluginIdentifier.java @@ -0,0 +1,33 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.protocol.events; + +import java.net.URI; + +/** + * DO NOT CHANGE THIS INTERFACE. It is part of the cross-version protocol. + * + * @since 5.1 + */ +public interface InternalScriptPluginIdentifier extends InternalPluginIdentifier { + + /** + * Returns the URI of the script file of this plugin. + */ + URI getUri(); + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/protocol/events/InternalTaskDescriptor.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/protocol/events/InternalTaskDescriptor.java new file mode 100644 index 0000000..cead936 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/internal/protocol/events/InternalTaskDescriptor.java @@ -0,0 +1,31 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.protocol.events; + +/** + * DO NOT CHANGE THIS INTERFACE. It is part of the cross-version protocol. + * + * @since 2.5 + */ +public interface InternalTaskDescriptor extends InternalOperationDescriptor { + /** + * Returns the path of the task. + * + * @return The path of the task + */ + String getTaskPath(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/model/Element.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/model/Element.java new file mode 100644 index 0000000..5d6165b --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/model/Element.java @@ -0,0 +1,44 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.model; + +import javax.annotation.Nullable; + +/** + * Described model element. + * + * @since 1.0-milestone-5 + */ +public interface Element extends Model { + + /** + * Returns the name of the element. Note that the name is not a unique identifier. + * + * @return The name of the element. + * @since 1.0-milestone-5 + */ + String getName(); + + /** + * Returns the description of the element, or {@code null} if it has no description. + * + * @return The description of the element, or {@code null} if it has no description. + * @since 1.0-milestone-5 + */ + @Nullable + String getDescription(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/model/ExternalDependency.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/model/ExternalDependency.java new file mode 100644 index 0000000..99d0fd5 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/model/ExternalDependency.java @@ -0,0 +1,66 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.tooling.model; + +import javax.annotation.Nullable; +import java.io.File; + +/** + * Represents an external artifact dependency. + */ +public interface ExternalDependency extends Dependency { + /** + * Returns the file for this dependency. + * + * @return The file for this dependency. + */ + File getFile(); + + /** + * Returns the source directory or archive for this dependency, or {@code null} if no source is available. + * + * @return The source directory or archive for this dependency, or {@code null} if no source is available. + */ + @Nullable + File getSource(); + + /** + * Returns the Javadoc directory or archive for this dependency, or {@code null} if no Javadoc is available. + * + * @return the Javadoc directory or archive for this dependency, or {@code null} if no Javadoc is available. + */ + @Nullable + File getJavadoc(); + + /** + * Marks this dependency as exported. + * + * @return whether this dependency needs to be exported. + * @since 2.5 + */ + boolean isExported(); + + /** + * Returns the Gradle module information for this dependency, or {@code null} if the dependency does not + * originate from a remote repository. + * + * @return The Gradle module information for this dependency, or {@code null} if the dependency does not + * originate from a remote repository. + * @since 1.1 + */ + @Nullable + GradleModuleVersion getGradleModuleVersion(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/model/GradleModuleVersion.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/model/GradleModuleVersion.java new file mode 100644 index 0000000..aa654be --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/model/GradleModuleVersion.java @@ -0,0 +1,41 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.model; + +/** + * Informs about a module version, i.e. group, name, version. + * + * @since 1.1 + */ +public interface GradleModuleVersion { + + /** + * The group of the module, for example 'org.gradle'. + */ + String getGroup(); + + /** + * The name of the module, for example 'gradle-tooling-api'. + */ + String getName(); + + /** + * The version, for example '1.0'. + */ + String getVersion(); + +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/model/cpp/CppBinary.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/model/cpp/CppBinary.java new file mode 100644 index 0000000..42519db --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/model/cpp/CppBinary.java @@ -0,0 +1,49 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.model.cpp; + +/** + * Represents a C++ binary. + * + * @since 4.10 + */ +public interface CppBinary { + /** + * Returns the name of this binary. This is used to disambiguate the binaries of a project. Each binary has a unique name within its project. However, these names are not unique across multiple projects. + */ + String getName(); + + /** + * Returns the variant name of this binary. This is used to disambiguate the binaries of a component. Each binary has a unique variant name within its component. However, these names are not unique across multiple projects or components. + */ + String getVariantName(); + + /** + * Returns the base name of this binary. This is used to calculate output file names. + */ + String getBaseName(); + + /** + * Returns the compilation details. + */ + CompilationDetails getCompilationDetails(); + + /** + * Returns the linkage details. + */ + LinkageDetails getLinkageDetails(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/model/cpp/MacroDirective.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/model/cpp/MacroDirective.java new file mode 100644 index 0000000..9838d2b --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/model/cpp/MacroDirective.java @@ -0,0 +1,37 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.model.cpp; + +import javax.annotation.Nullable; + +/** + * Represent a macro directive. + * + * @since 4.10 + */ +public interface MacroDirective { + /** + * Returns the name of the macro. + */ + String getName(); + + /** + * Returns the value of the macro, if any. + */ + @Nullable + String getValue(); +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/model/idea/IdeaModuleIdentifier.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/model/idea/IdeaModuleIdentifier.java new file mode 100644 index 0000000..9295033 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/model/idea/IdeaModuleIdentifier.java @@ -0,0 +1,24 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.tooling.model.idea; + +/** + * Identifies an Idea module. + * + * @since 2.14 + */ +public interface IdeaModuleIdentifier { +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/model/package-info.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/model/package-info.java new file mode 100644 index 0000000..0ee0633 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-api/org/gradle/tooling/model/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The general-purpose tooling model types, provided by the tooling API. + */ +package org.gradle.tooling.model; \ No newline at end of file diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-native/org/gradle/language/cpp/internal/tooling/DefaultCppProjectModel.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-native/org/gradle/language/cpp/internal/tooling/DefaultCppProjectModel.java new file mode 100644 index 0000000..795206d --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-native/org/gradle/language/cpp/internal/tooling/DefaultCppProjectModel.java @@ -0,0 +1,45 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.cpp.internal.tooling; + +import org.gradle.tooling.internal.gradle.DefaultProjectIdentifier; + +import java.io.Serializable; + +public class DefaultCppProjectModel implements Serializable { + private final DefaultProjectIdentifier projectIdentifier; + private final DefaultCppComponentModel mainComponent; + private final DefaultCppComponentModel testComponent; + + public DefaultCppProjectModel(DefaultProjectIdentifier projectIdentifier, DefaultCppComponentModel mainComponent, DefaultCppComponentModel testComponent) { + this.projectIdentifier = projectIdentifier; + this.mainComponent = mainComponent; + this.testComponent = testComponent; + } + + public DefaultProjectIdentifier getProjectIdentifier() { + return projectIdentifier; + } + + public DefaultCppComponentModel getMainComponent() { + return mainComponent; + } + + public DefaultCppComponentModel getTestComponent() { + return testComponent; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-native/org/gradle/language/cpp/internal/tooling/DefaultCppStaticLibraryModel.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-native/org/gradle/language/cpp/internal/tooling/DefaultCppStaticLibraryModel.java new file mode 100644 index 0000000..0de80f2 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/tooling-native/org/gradle/language/cpp/internal/tooling/DefaultCppStaticLibraryModel.java @@ -0,0 +1,25 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.cpp.internal.tooling; + +import org.gradle.tooling.internal.protocol.cpp.InternalCppStaticLibrary; + +public class DefaultCppStaticLibraryModel extends DefaultCppBinaryModel implements InternalCppStaticLibrary { + public DefaultCppStaticLibraryModel(String name, String variantName, String baseName, DefaultCompilationDetails compilationDetails, DefaultLinkageDetails linkageDetails) { + super(name, variantName, baseName, compilationDetails, linkageDetails); + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/workers/org/gradle/workers/IsolationMode.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/workers/org/gradle/workers/IsolationMode.java new file mode 100644 index 0000000..3e2a205 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/workers/org/gradle/workers/IsolationMode.java @@ -0,0 +1,41 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.workers; + +/** + * Isolation mode for workers. + * + * @since 4.0 + */ +public enum IsolationMode { + /** + * Let Gradle decide, this is the default. + */ + AUTO, + /** + * Don't attempt to isolate the work, use in-process workers. + */ + NONE, + /** + * Isolate the work in it's own classloader, use in-process workers. + */ + CLASSLOADER, + /** + * Isolate the work in a separate process, use out-of-process workers. + */ + PROCESS +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/workers/org/gradle/workers/internal/DefaultClassLoaderWorkerSpec.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/workers/org/gradle/workers/internal/DefaultClassLoaderWorkerSpec.java new file mode 100644 index 0000000..b92f836 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/workers/org/gradle/workers/internal/DefaultClassLoaderWorkerSpec.java @@ -0,0 +1,37 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.workers.internal; + +import org.gradle.api.file.ConfigurableFileCollection; +import org.gradle.api.model.ObjectFactory; +import org.gradle.workers.ClassLoaderWorkerSpec; + +import javax.inject.Inject; + +public class DefaultClassLoaderWorkerSpec extends DefaultWorkerSpec implements ClassLoaderWorkerSpec { + private final ConfigurableFileCollection classpath; + + @Inject + public DefaultClassLoaderWorkerSpec(ObjectFactory objectFactory) { + this.classpath = objectFactory.fileCollection(); + } + + @Override + public ConfigurableFileCollection getClasspath() { + return classpath; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/workers/org/gradle/workers/internal/DefaultWorkerServer.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/workers/org/gradle/workers/internal/DefaultWorkerServer.java new file mode 100644 index 0000000..dc68f97 --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/workers/org/gradle/workers/internal/DefaultWorkerServer.java @@ -0,0 +1,78 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.workers.internal; + +import org.gradle.api.specs.Spec; +import org.gradle.internal.Cast; +import org.gradle.internal.instantiation.InstantiatorFactory; +import org.gradle.internal.isolated.IsolationScheme; +import org.gradle.internal.reflect.Instantiator; +import org.gradle.internal.service.ServiceLookup; +import org.gradle.internal.service.ServiceRegistry; +import org.gradle.workers.WorkAction; +import org.gradle.workers.WorkParameters; + +import java.util.Collection; + +public class DefaultWorkerServer implements Worker { + private final ServiceRegistry internalServices; + private final InstantiatorFactory instantiatorFactory; + private final IsolationScheme, WorkParameters> isolationScheme; + private final Collection> additionalWhitelistedServices; + + public DefaultWorkerServer(ServiceRegistry internalServices, InstantiatorFactory instantiatorFactory, IsolationScheme, WorkParameters> isolationScheme, Collection> additionalWhitelistedServices) { + this.internalServices = internalServices; + this.instantiatorFactory = instantiatorFactory; + this.isolationScheme = isolationScheme; + this.additionalWhitelistedServices = additionalWhitelistedServices; + } + + @Override + public DefaultWorkResult execute(SimpleActionExecutionSpec spec) { + try { + Class> implementationClass = Cast.uncheckedCast(spec.getImplementationClass()); + // Exceptions to services available for injection + Spec> whiteListPolicy; + if (spec.isInternalServicesRequired()) { + whiteListPolicy = element -> true; + } else { + whiteListPolicy = element -> false; + } + ServiceLookup instantiationServices = isolationScheme.servicesForImplementation(spec.getParameters(), internalServices, additionalWhitelistedServices, whiteListPolicy); + Instantiator instantiator = instantiatorFactory.inject(instantiationServices); + WorkAction execution; + if (ProvidesWorkResult.class.isAssignableFrom(implementationClass)) { + execution = instantiator.newInstance(implementationClass, spec.getParameters(), instantiator); + } else { + execution = instantiator.newInstance(implementationClass); + } + execution.execute(); + if (execution instanceof ProvidesWorkResult) { + return ((ProvidesWorkResult) execution).getWorkResult(); + } else { + return DefaultWorkResult.SUCCESS; + } + } catch (Throwable t) { + return new DefaultWorkResult(true, t); + } + } + + @Override + public String toString() { + return "DefaultWorkerServer{}"; + } +} diff --git a/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/workers/org/gradle/workers/internal/ForkedWorkerRequirement.java b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/workers/org/gradle/workers/internal/ForkedWorkerRequirement.java new file mode 100644 index 0000000..34af07c --- /dev/null +++ b/wrapper/dists/gradle-6.7.1-all/2moa8rlfac5eqlcfgk98k0deb/gradle-6.7.1/src/workers/org/gradle/workers/internal/ForkedWorkerRequirement.java @@ -0,0 +1,32 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.workers.internal; + +import java.io.File; + +public class ForkedWorkerRequirement extends IsolatedClassLoaderWorkerRequirement { + private final DaemonForkOptions forkOptions; + + public ForkedWorkerRequirement(File workerDirectory, DaemonForkOptions forkOptions) { + super(workerDirectory, forkOptions.getClassLoaderStructure()); + this.forkOptions = forkOptions; + } + + public DaemonForkOptions getForkOptions() { + return forkOptions; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/dsl/org.gradle.api.invocation.Gradle.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/dsl/org.gradle.api.invocation.Gradle.html new file mode 100644 index 0000000..efbe96c --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/dsl/org.gradle.api.invocation.Gradle.html @@ -0,0 +1,159 @@ + +Gradle - Gradle DSL Version 7.2

Gradle

API Documentation:Gradle

Represents an invocation of Gradle. + +

You can obtain a Gradle instance by calling Project.getGradle().

Properties

PropertyDescription
gradle

Returns this Gradle instance. + +This method is useful in init scripts to explicitly access Gradle +properties and methods. For example, using gradle.parent can express your intent better than using +parent. This property also allows you to access Gradle properties from a scope where the property +may be hidden, such as, for example, from a method or closure.

gradleHomeDir

The Gradle home directory, if any. + +This directory is the directory containing the Gradle distribution executing this build. +

gradleUserHomeDir

The Gradle user home directory. + +This directory is used to cache downloaded resources, compiled build scripts and so on.

gradleVersion

The current Gradle version.

includedBuilds

The included builds for this build.

parent

The parent build of this build, if any.

pluginManager

The plugin manager for this plugin aware object.

plugins

The container of plugins that have been applied to this object. +

rootProject

The root project of this build.

startParameter

The StartParameter used to start this build.

taskGraph

The TaskExecutionGraph for this build.

Methods

MethodDescription
addBuildListener(buildListener)

Adds a BuildListener to this Build instance. + +The listener is notified of events which occur during the execution of the build.

addListener(listener)

Adds the given listener to this build. The listener may implement any of the given listener interfaces: + +

addProjectEvaluationListener(listener)

Adds a listener to this build, to receive notifications as projects are evaluated.

afterProject(closure)

Adds a closure to be called immediately after a project is evaluated. + +The project is passed to the closure as the first parameter. The project evaluation failure, if any, +is passed as the second parameter. Both parameters are optional.

afterProject(action)

Adds an action to be called immediately after a project is evaluated.

allprojects(action)

Adds an action to execute against all projects of this build. + +The action is executed immediately against all projects which are +already available. It is also executed as subsequent projects are added to this build.

apply(closure)

Applies zero or more plugins or scripts. +

apply(options)

Applies a plugin or script, using the given options provided as a map. Does nothing if the plugin has already been applied. +

apply(action)

Applies zero or more plugins or scripts. +

beforeProject(closure)

Adds a closure to be called immediately before a project is evaluated. The project is passed to the closure as a +parameter.

beforeProject(action)

Adds an action to be called immediately before a project is evaluated.

buildFinished(closure)

Adds a closure to be called when the build is completed. + +All selected tasks have been executed. +A BuildResult instance is passed to the closure as a parameter.

buildFinished(action)

Adds an action to be called when the build is completed. + +All selected tasks have been executed.

includedBuild(name)

Returns the included build with the specified name for this build.

projectsEvaluated(closure)

Adds a closure to be called when all projects for the build have been evaluated. + +The project objects are fully configured and are ready to use to populate the task graph. +This Gradle instance is passed to the closure as a parameter.

projectsEvaluated(action)

Adds an action to be called when all projects for the build have been evaluated. + +The project objects are fully configured and are ready to use to populate the task graph.

projectsLoaded(closure)

Adds a closure to be called when the projects for the build have been created from the settings. + +None of the projects have been evaluated. This Gradle instance is passed to the closure as a parameter. +

projectsLoaded(action)

Adds an action to be called when the projects for the build have been created from the settings. + +None of the projects have been evaluated.

removeListener(listener)

Removes the given listener from this build.

removeProjectEvaluationListener(listener)

Removes the given listener from this build.

rootProject(action)

Adds an action to execute against the root project of this build. + +If the root project is already available, the action +is executed immediately. Otherwise, the action is executed when the root project becomes available.

settingsEvaluated(closure)

Adds a closure to be called when the build settings have been loaded and evaluated. + +The settings object is fully configured and is ready to use to load the build projects. The +Settings object is passed to the closure as a parameter.

settingsEvaluated(action)

Adds an action to be called when the build settings have been loaded and evaluated. + +The settings object is fully configured and is ready to use to load the build projects.

useLogger(logger)

Uses the given object as a logger. + +The logger object may implement any of the listener interfaces supported by +Gradle.addListener(java.lang.Object). +

Script blocks

No script blocks

Property details

Gradle gradle (read-only)

Returns this Gradle instance. + +This method is useful in init scripts to explicitly access Gradle +properties and methods. For example, using gradle.parent can express your intent better than using +parent. This property also allows you to access Gradle properties from a scope where the property +may be hidden, such as, for example, from a method or closure.

File gradleHomeDir (read-only)

The Gradle home directory, if any. + +This directory is the directory containing the Gradle distribution executing this build. +

+When using the “Gradle Daemon”, this may not be the same Gradle distribution that the build was started with. +If an existing daemon process is running that is deemed compatible (e.g. has the desired JVM characteristics) +then this daemon may be used instead of starting a new process and it may have been started from a different “gradle home”. +However, it is guaranteed to be the same version of Gradle. For more information on the Gradle Daemon, please consult the +User Manual.

File gradleUserHomeDir (read-only)

The Gradle user home directory. + +This directory is used to cache downloaded resources, compiled build scripts and so on.

String gradleVersion (read-only)

The current Gradle version.

Collection<IncludedBuild> includedBuilds (read-only)

The included builds for this build.

Gradle parent (read-only)

The parent build of this build, if any.

PluginManager pluginManager (read-only)

The plugin manager for this plugin aware object.

PluginContainer plugins (read-only)

The container of plugins that have been applied to this object. +

+While not deprecated, it is preferred to use the methods of this interface or the PluginAware.getPluginManager() than use the plugin container. +

+Use one of the 'apply' methods on this interface or on the PluginAware.getPluginManager() to apply plugins instead of applying via the plugin container. +

+Use PluginManager.hasPlugin(java.lang.String) or similar to query for the application of plugins instead of doing so via the plugin container.

Project rootProject (read-only)

The root project of this build.

StartParameter startParameter (read-only)

The StartParameter used to start this build.

TaskExecutionGraph taskGraph (read-only)

The TaskExecutionGraph for this build.

Method details

void addBuildListener(BuildListener buildListener)

Adds a BuildListener to this Build instance. + +The listener is notified of events which occur during the execution of the build.

void addListener(Object listener)

Adds the given listener to this build. The listener may implement any of the given listener interfaces: + +

ProjectEvaluationListener addProjectEvaluationListener(ProjectEvaluationListener listener)

Adds a listener to this build, to receive notifications as projects are evaluated.

void afterProject(Closure closure)

Adds a closure to be called immediately after a project is evaluated. + +The project is passed to the closure as the first parameter. The project evaluation failure, if any, +is passed as the second parameter. Both parameters are optional.

void afterProject(Action<? super Project> action)

Adds an action to be called immediately after a project is evaluated.

void allprojects(Action<? super Project> action)

Adds an action to execute against all projects of this build. + +The action is executed immediately against all projects which are +already available. It is also executed as subsequent projects are added to this build.

void apply(Closure closure)

Applies zero or more plugins or scripts. +

+The given closure is used to configure an ObjectConfigurationAction, which “builds” the plugin application. +

+This method differs from PluginAware.apply(java.util.Map) in that it allows methods of the configuration action to be invoked more than once.

void apply(Map<String, ?> options)

Applies a plugin or script, using the given options provided as a map. Does nothing if the plugin has already been applied. +

+The given map is applied as a series of method calls to a newly created ObjectConfigurationAction. +That is, each key in the map is expected to be the name of a method ObjectConfigurationAction and the value to be compatible arguments to that method. + +

The following options are available:

  • from: A script to apply. Accepts any path supported by Project.uri(java.lang.Object).
  • plugin: The id or implementation class of the plugin to apply.
  • to: The target delegate object or objects. The default is this plugin aware object. Use this to configure objects other than this object.

void apply(Action<? super ObjectConfigurationAction> action)

Applies zero or more plugins or scripts. +

+The given closure is used to configure an ObjectConfigurationAction, which “builds” the plugin application. +

+This method differs from PluginAware.apply(java.util.Map) in that it allows methods of the configuration action to be invoked more than once.

void beforeProject(Closure closure)

Adds a closure to be called immediately before a project is evaluated. The project is passed to the closure as a +parameter.

void beforeProject(Action<? super Project> action)

Adds an action to be called immediately before a project is evaluated.

void buildFinished(Closure closure)

Adds a closure to be called when the build is completed. + +All selected tasks have been executed. +A BuildResult instance is passed to the closure as a parameter.

void buildFinished(Action<? super BuildResult> action)

Adds an action to be called when the build is completed. + +All selected tasks have been executed.

IncludedBuild includedBuild(String name)

Returns the included build with the specified name for this build.

void projectsEvaluated(Closure closure)

Adds a closure to be called when all projects for the build have been evaluated. + +The project objects are fully configured and are ready to use to populate the task graph. +This Gradle instance is passed to the closure as a parameter.

void projectsEvaluated(Action<? super Gradle> action)

Adds an action to be called when all projects for the build have been evaluated. + +The project objects are fully configured and are ready to use to populate the task graph.

void projectsLoaded(Closure closure)

Adds a closure to be called when the projects for the build have been created from the settings. + +None of the projects have been evaluated. This Gradle instance is passed to the closure as a parameter. +

+An example of hooking into the projectsLoaded to configure buildscript classpath from the init script. +

+//init.gradle
+gradle.projectsLoaded {
+  rootProject.buildscript {
+    repositories {
+      //...
+    }
+    dependencies {
+      //...
+    }
+  }
+}
+

void projectsLoaded(Action<? super Gradle> action)

Adds an action to be called when the projects for the build have been created from the settings. + +None of the projects have been evaluated.

void removeListener(Object listener)

Removes the given listener from this build.

void removeProjectEvaluationListener(ProjectEvaluationListener listener)

Removes the given listener from this build.

void rootProject(Action<? super Project> action)

Adds an action to execute against the root project of this build. + +If the root project is already available, the action +is executed immediately. Otherwise, the action is executed when the root project becomes available.

void settingsEvaluated(Closure closure)

Adds a closure to be called when the build settings have been loaded and evaluated. + +The settings object is fully configured and is ready to use to load the build projects. The +Settings object is passed to the closure as a parameter.

void settingsEvaluated(Action<? super Settings> action)

Adds an action to be called when the build settings have been loaded and evaluated. + +The settings object is fully configured and is ready to use to load the build projects.

void useLogger(Object logger)

Uses the given object as a logger. + +The logger object may implement any of the listener interfaces supported by +Gradle.addListener(java.lang.Object). +

+Each listener interface has exactly one associated logger. When you call this +method with a logger of a given listener type, the new logger will replace whichever logger is currently +associated with the listener type. This allows you to selectively replace the standard logging which Gradle +provides with your own implementation, for certain types of events.

\ No newline at end of file diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/dsl/org.gradle.nativeplatform.NativeLibrarySpec.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/dsl/org.gradle.nativeplatform.NativeLibrarySpec.html new file mode 100644 index 0000000..0bd3cd8 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/dsl/org.gradle.nativeplatform.NativeLibrarySpec.html @@ -0,0 +1,15 @@ + +NativeLibrarySpec - Gradle DSL Version 7.2

NativeLibrarySpec

API Documentation:NativeLibrarySpec

Note: This class is incubating and may change in a future version of Gradle.

Definition of a native library component that is to be built by Gradle.

Properties

PropertyDescription
api
Incubating

Converts this library to a native library requirement that uses the api library linkage.

baseName
Incubating

The name that is used to construct the output file names when building this component.

binaries
Incubating

The variants produced for this component spec.

displayName
Incubating

Returns a human-consumable display name for this element.

shared
Incubating

Converts this library to a native library requirement that uses the shared library variant. This is the default.

static
Incubating

Converts this library to a native library requirement that uses the static library variant.

Methods

MethodDescription
targetBuildTypes(buildTypeSelectors)
Incubating

Specifies the names of one or more BuildTypes that this component should be built for.

targetFlavors(flavorSelectors)
Incubating

Specifies the names of one or more Flavors that this component should be built for.

targetPlatform(targetPlatform)
Incubating

Specifies a platform that this component should be built be for.

Script blocks

No script blocks

Property details

NativeLibraryRequirement api (read-only)

Note: This property is incubating and may change in a future version of Gradle.

Converts this library to a native library requirement that uses the api library linkage.

String baseName

Note: This property is incubating and may change in a future version of Gradle.

The name that is used to construct the output file names when building this component.

ModelMap<BinarySpec> binaries (read-only)

Note: This property is incubating and may change in a future version of Gradle.

The variants produced for this component spec.

String displayName (read-only)

Note: This property is incubating and may change in a future version of Gradle.

Returns a human-consumable display name for this element.

NativeLibraryRequirement shared (read-only)

Note: This property is incubating and may change in a future version of Gradle.

Converts this library to a native library requirement that uses the shared library variant. This is the default.

NativeLibraryRequirement static (read-only)

Note: This property is incubating and may change in a future version of Gradle.

Converts this library to a native library requirement that uses the static library variant.

Method details

void targetBuildTypes(String... buildTypeSelectors)

Note: This method is incubating and may change in a future version of Gradle.

Specifies the names of one or more BuildTypes that this component should be built for.

void targetFlavors(String... flavorSelectors)

Note: This method is incubating and may change in a future version of Gradle.

Specifies the names of one or more Flavors that this component should be built for.

void targetPlatform(String targetPlatform)

Note: This method is incubating and may change in a future version of Gradle.

Specifies a platform that this component should be built be for.

\ No newline at end of file diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/dsl/org.gradle.nativeplatform.test.NativeTestSuiteSpec.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/dsl/org.gradle.nativeplatform.test.NativeTestSuiteSpec.html new file mode 100644 index 0000000..e0c1534 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/dsl/org.gradle.nativeplatform.test.NativeTestSuiteSpec.html @@ -0,0 +1,15 @@ + +NativeTestSuiteSpec - Gradle DSL Version 7.2

NativeTestSuiteSpec

API Documentation:NativeTestSuiteSpec

Note: This class is incubating and may change in a future version of Gradle.

A component representing a suite of tests that will be executed together.

Properties

PropertyDescription
baseName
Incubating

The name that is used to construct the output file names when building this component.

displayName
Incubating

Returns a human-consumable display name for this element.

Methods

No methods

Script blocks

No script blocks

Property details

String baseName

Note: This property is incubating and may change in a future version of Gradle.

The name that is used to construct the output file names when building this component.

String displayName (read-only)

Note: This property is incubating and may change in a future version of Gradle.

Returns a human-consumable display name for this element.

\ No newline at end of file diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/BuildCancelledException.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/BuildCancelledException.html new file mode 100644 index 0000000..7f248f8 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/BuildCancelledException.html @@ -0,0 +1,315 @@ + + + + + +BuildCancelledException (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class BuildCancelledException

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Serializable
    +
    +
    +
    public class BuildCancelledException
    +extends GradleException
    +

    A BuildCancelledException is thrown when a build is interrupted due to cancellation request.

    +
    +
    Since:
    +
    2.1
    +
    See Also:
    +
    Serialized Form
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        BuildCancelledException

        +
        public BuildCancelledException()
        +
      • +
      + + + +
        +
      • +

        BuildCancelledException

        +
        public BuildCancelledException​(String message)
        +
      • +
      + + + +
        +
      • +

        BuildCancelledException

        +
        public BuildCancelledException​(String message,
        +                               Throwable cause)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/NamedDomainObjectList.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/NamedDomainObjectList.html new file mode 100644 index 0000000..2dd0fb2 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/NamedDomainObjectList.html @@ -0,0 +1,389 @@ + + + + + +NamedDomainObjectList (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface NamedDomainObjectList<T>

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        withType

        +
        <S extends TNamedDomainObjectList<S> withType​(Class<S> type)
        +
        Returns a collection containing the objects in this collection of the given type. The returned collection is + live, so that when matching objects are later added to this collection, they are also visible in the filtered + collection.
        +
        +
        Specified by:
        +
        withType in interface DomainObjectCollection<T>
        +
        Specified by:
        +
        withType in interface NamedDomainObjectCollection<T>
        +
        Parameters:
        +
        type - The type of objects to find.
        +
        Returns:
        +
        The matching objects. Returns an empty collection if there are no such objects in this collection.
        +
        +
      • +
      + + + +
        +
      • +

        matching

        +
        NamedDomainObjectList<T> matching​(Spec<? super T> spec)
        +
        Returns a collection which contains the objects in this collection which meet the given specification. The + returned collection is live, so that when matching objects are added to this collection, they are also visible in + the filtered collection.
        +
        +
        Specified by:
        +
        matching in interface DomainObjectCollection<T>
        +
        Specified by:
        +
        matching in interface NamedDomainObjectCollection<T>
        +
        Parameters:
        +
        spec - The specification to use.
        +
        Returns:
        +
        The collection of matching objects. Returns an empty collection if there are no such objects in this + collection.
        +
        +
      • +
      + + + +
        +
      • +

        matching

        +
        NamedDomainObjectList<T> matching​(Closure spec)
        +
        Returns a collection which contains the objects in this collection which meet the given closure specification. The + returned collection is live, so that when matching objects are added to this collection, they are also visible in + the filtered collection.
        +
        +
        Specified by:
        +
        matching in interface DomainObjectCollection<T>
        +
        Specified by:
        +
        matching in interface NamedDomainObjectCollection<T>
        +
        Parameters:
        +
        spec - The specification to use. The closure gets a collection element as an argument.
        +
        Returns:
        +
        The collection of matching objects. Returns an empty collection if there are no such objects in this + collection.
        +
        +
      • +
      + + + +
        +
      • +

        findAll

        +
        List<T> findAll​(Closure spec)
        +
        Returns a collection which contains the objects in this collection which meet the given closure specification.
        +
        +
        Specified by:
        +
        findAll in interface DomainObjectCollection<T>
        +
        Parameters:
        +
        spec - The specification to use. The closure gets a collection element as an argument.
        +
        Returns:
        +
        The collection of matching objects. Returns an empty collection if there are no such objects in this + collection.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/artifacts/CapabilityResolutionDetails.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/artifacts/CapabilityResolutionDetails.html new file mode 100644 index 0000000..7c0c980 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/artifacts/CapabilityResolutionDetails.html @@ -0,0 +1,358 @@ + + + + + +CapabilityResolutionDetails (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface CapabilityResolutionDetails

+
+
+
+
    +
  • +
    +
    public interface CapabilityResolutionDetails
    +
    Gives access to the resolution details of a single capability conflict. + This class may be used to resolve a capability conflict by either selecting + explicitly one of the candidates, or selecting the one with the highest + version of the capability.
    +
    +
    Since:
    +
    5.6
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getCapability

        +
        Capability getCapability()
        +
        Returns the capability in conflict
        +
      • +
      + + + + + + + +
        +
      • +

        select

        +
        CapabilityResolutionDetails select​(ComponentVariantIdentifier candidate)
        +
        Selects a particular candidate to solve the conflict. It is recommended to + provide a human-readable explanation to the choice by calling the because(String) method
        +
        +
        Parameters:
        +
        candidate - the selected candidate
        +
        Returns:
        +
        this details instance
        +
        Since:
        +
        6.0
        +
        +
      • +
      + + + +
        +
      • +

        select

        +
        CapabilityResolutionDetails select​(Object notation)
        +
        Selects a particular candidate to solve the conflict. It is recommended to + provide a human-readable explanation to the choice by calling the because(String) method
        +
        +
        Parameters:
        +
        notation - the selected candidate
        +
        Returns:
        +
        this details instance
        +
        +
      • +
      + + + +
        +
      • +

        selectHighestVersion

        +
        CapabilityResolutionDetails selectHighestVersion()
        +
        Automatically selects the candidate module which has the highest version of the + capability. A reason is automatically added so calling because(String) would override + the automatic selection description.
        +
        +
        Returns:
        +
        this details instance
        +
        +
      • +
      + + + +
        +
      • +

        because

        +
        CapabilityResolutionDetails because​(String reason)
        +
        Describes why a particular candidate is selected.
        +
        +
        Parameters:
        +
        reason - the reason why a candidate is selected.
        +
        Returns:
        +
        this details instance
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/artifacts/dsl/ArtifactHandler.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/artifacts/dsl/ArtifactHandler.html new file mode 100644 index 0000000..f0b1deb --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/artifacts/dsl/ArtifactHandler.html @@ -0,0 +1,357 @@ + + + + + +ArtifactHandler (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface ArtifactHandler

+
+
+
+
    +
  • +
    +
    public interface ArtifactHandler
    +
    This class is for defining artifacts to be published and adding them to configurations. Creating publish artifacts + does not mean to create an archive. What is created is a domain object which represents a file to be published + and information on how it should be published (e.g. the name). + +

    To create an publish artifact and assign it to a configuration you can use the following syntax:

    + + <configurationName> <artifact-notation>, <artifact-notation> ... + + or + + <configurationName> <artifact-notation> { ... some code to configure the artifact } + +

    The notation can be one of the following types:

    + +
      + +
    • PublishArtifact.
    • + +
    • AbstractArchiveTask. The information for publishing the artifact is extracted from the archive task (e.g. name, extension, ...). The task will be executed if the artifact is required.
    • + +
    • A RegularFile or Directory.
    • + +
    • A Provider of File, RegularFile or Directory. The information for publishing the artifact is extracted from the file or directory name. When the provider represents an output of a particular task, that task will be executed if the artifact is required.
    • + +
    • File. The information for publishing the artifact is extracted from the file name.
    • + +
    • Map. The map should contain a 'file' key. This is converted to an artifact as described above. You can also specify other properties of the artifact using entries in the map. +
    • + +
    + +

    In each case, a ConfigurablePublishArtifact instance is created for the artifact, to allow artifact properties to be configured. You can also override the default values for artifact properties by using a closure to configure the properties of the artifact instance

    + +

    Examples

    +

    An example showing how to associate an archive task with a configuration via the artifact handler. + This way the archive can be published or referred in other projects via the configuration. +

    + configurations {
    +   //declaring new configuration that will be used to associate with artifacts
    +   schema
    + }
    +
    + task schemaJar(type: Jar) {
    +   //some imaginary task that creates a jar artifact with some schema
    + }
    +
    + //associating the task that produces the artifact with the configuration
    + artifacts {
    +   //configuration name and the task:
    +   schema schemaJar
    + }
    + 
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        add

        +
        PublishArtifact add​(String configurationName,
        +                    Object artifactNotation)
        +
        Adds an artifact to the given configuration.
        +
        +
        Parameters:
        +
        configurationName - The name of the configuration.
        +
        artifactNotation - The artifact notation, in one of the notations described above.
        +
        Returns:
        +
        The artifact.
        +
        +
      • +
      + + + +
        +
      • +

        add

        +
        PublishArtifact add​(String configurationName,
        +                    Object artifactNotation,
        +                    Closure configureClosure)
        +
        Adds an artifact to the given configuration.
        +
        +
        Parameters:
        +
        configurationName - The name of the configuration.
        +
        artifactNotation - The artifact notation, in one of the notations described above.
        +
        configureClosure - The closure to execute to configure the artifact.
        +
        Returns:
        +
        The artifact.
        +
        +
      • +
      + + + +
        +
      • +

        add

        +
        PublishArtifact add​(String configurationName,
        +                    Object artifactNotation,
        +                    Action<? super ConfigurablePublishArtifact> configureAction)
        +
        Adds an artifact to the given configuration.
        +
        +
        Parameters:
        +
        configurationName - The name of the configuration.
        +
        artifactNotation - The artifact notation, in one of the notations described above.
        +
        configureAction - The action to execute to configure the artifact.
        +
        Returns:
        +
        The artifact.
        +
        Since:
        +
        3.3.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/artifacts/maven/PomModuleDescriptor.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/artifacts/maven/PomModuleDescriptor.html new file mode 100644 index 0000000..b28b861 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/artifacts/maven/PomModuleDescriptor.html @@ -0,0 +1,245 @@ + + + + + +PomModuleDescriptor (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface PomModuleDescriptor

+
+
+
+
    +
  • +
    +
    public interface PomModuleDescriptor
    +
    The metadata about a Maven POM that acts as an input to a component metadata rule.
    +
    +
    Since:
    +
    6.3
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getPackaging

        +
        String getPackaging()
        +
        Returns the packaging for this POM.
        +
        +
        Returns:
        +
        the packaging type
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/artifacts/query/ArtifactResolutionQuery.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/artifacts/query/ArtifactResolutionQuery.html new file mode 100644 index 0000000..d40e8d6 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/artifacts/query/ArtifactResolutionQuery.html @@ -0,0 +1,388 @@ + + + + + +ArtifactResolutionQuery (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface ArtifactResolutionQuery

+
+
+
+
    +
  • +
    +
    public interface ArtifactResolutionQuery
    +
    A builder to construct a query that can resolve selected software artifacts of the specified components. + +
    + plugins {
    +     id 'java'
    + }
    +
    + task resolveCompileSources {
    +     doLast {
    +         def componentIds = configurations.compileClasspath.incoming.resolutionResult.allDependencies.collect { it.selected.id }
    +
    +         def result = dependencies.createArtifactResolutionQuery()
    +                                  .forComponents(componentIds)
    +                                  .withArtifacts(JvmLibrary, SourcesArtifact, JavadocArtifact)
    +                                  .execute()
    +
    +         for (component in result.resolvedComponents) {
    +             component.getArtifacts(SourcesArtifact).each { println "Source artifact for ${component.id}: ${it.file}" }
    +         }
    +     }
    + }
    + 
    +
    +
    Since:
    +
    2.0
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        forComponents

        +
        ArtifactResolutionQuery forComponents​(Iterable<? extends ComponentIdentifier> componentIds)
        +
        Specifies the set of components to include in the result.
        +
        +
        Parameters:
        +
        componentIds - The identifiers of the components to be queried.
        +
        +
      • +
      + + + +
        +
      • +

        forComponents

        +
        ArtifactResolutionQuery forComponents​(ComponentIdentifier... componentIds)
        +
        Specifies the set of components to include in the result.
        +
        +
        Parameters:
        +
        componentIds - The identifiers of the components to be queried.
        +
        +
      • +
      + + + +
        +
      • +

        forModule

        +
        ArtifactResolutionQuery forModule​(String group,
        +                                  String name,
        +                                  String version)
        +
        Specifies a module component to include in the result using its GAV coordinates.
        +
        +
        Parameters:
        +
        group - Module group.
        +
        name - Module name.
        +
        version - Module version.
        +
        Since:
        +
        4.5
        +
        +
      • +
      + + + +
        +
      • +

        withArtifacts

        +
        ArtifactResolutionQuery withArtifacts​(Class<? extends Component> componentType,
        +                                      Class<? extends Artifact>... artifactTypes)
        +
        Defines the type of component that is expected in the result, and the artifacts to retrieve for components of this type. + + Presently, only a single component type and set of artifacts is permitted.
        +
        +
        Parameters:
        +
        componentType - The expected type of the component.
        +
        artifactTypes - The artifacts to retrieve for the queried components.
        +
        +
      • +
      + + + +
        +
      • +

        withArtifacts

        +
        ArtifactResolutionQuery withArtifacts​(Class<? extends Component> componentType,
        +                                      Collection<Class<? extends Artifact>> artifactTypes)
        +
        Defines the type of component that is expected in the result, and the artifacts to retrieve for components of this type. + + Presently, only a single component type and set of artifacts is permitted.
        +
        +
        Parameters:
        +
        componentType - The expected type of the component.
        +
        artifactTypes - The artifacts to retrieve for the queried components.
        +
        Since:
        +
        4.5
        +
        +
      • +
      + + + + +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/artifacts/repositories/IvyArtifactRepositoryMetaDataProvider.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/artifacts/repositories/IvyArtifactRepositoryMetaDataProvider.html new file mode 100644 index 0000000..b6bdf55 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/artifacts/repositories/IvyArtifactRepositoryMetaDataProvider.html @@ -0,0 +1,256 @@ + + + + + +IvyArtifactRepositoryMetaDataProvider (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface IvyArtifactRepositoryMetaDataProvider

+
+
+
+
    +
  • +
    +
    public interface IvyArtifactRepositoryMetaDataProvider
    +
    The meta-data provider for an Ivy repository. Uses the Ivy module descriptor (ivy.xml) to determine the meta-data for module versions and artifacts.
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethodDescription
      booleanisDynamicMode() +
      Returns true if dynamic resolve mode should be used for Ivy modules.
      +
      voidsetDynamicMode​(boolean mode) +
      Specifies whether dynamic resolve mode should be used for Ivy modules.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        isDynamicMode

        +
        boolean isDynamicMode()
        +
        Returns true if dynamic resolve mode should be used for Ivy modules. When enabled, the revConstraint attribute for each dependency declaration + is used in preference to the rev attribute. When disabled (the default), the rev attribute is always used.
        +
      • +
      + + + +
        +
      • +

        setDynamicMode

        +
        void setDynamicMode​(boolean mode)
        +
        Specifies whether dynamic resolve mode should be used for Ivy modules. When enabled, the revConstraint attribute for each dependency declaration + is used in preference to the rev attribute. When disabled (the default), the rev attribute is always used.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/artifacts/verification/package-tree.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/artifacts/verification/package-tree.html new file mode 100644 index 0000000..de517a4 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/artifacts/verification/package-tree.html @@ -0,0 +1,152 @@ + + + + + +org.gradle.api.artifacts.verification Class Hierarchy (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + +
+

Hierarchy For Package org.gradle.api.artifacts.verification

+Package Hierarchies: + +
+
+

Enum Hierarchy

+ +
+ + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/attributes/LibraryElements.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/attributes/LibraryElements.html new file mode 100644 index 0000000..62187b7 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/attributes/LibraryElements.html @@ -0,0 +1,435 @@ + + + + + +LibraryElements (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface LibraryElements

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    Named
    +
    +
    +
    public interface LibraryElements
    +extends Named
    +
    Attribute representing the technical elements of a library variant.
    +
    +
    Since:
    +
    5.6
    +
    +
  • +
+
+
+ +
+
+ +
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/component/BuildableComponent.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/component/BuildableComponent.html new file mode 100644 index 0000000..786ceea --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/component/BuildableComponent.html @@ -0,0 +1,227 @@ + + + + + +BuildableComponent (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface BuildableComponent

+
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Nested Class Summary

      + +
    • +
    + +
      +
    • + + +

      Method Summary

      + +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/distribution/plugins/package-tree.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/distribution/plugins/package-tree.html new file mode 100644 index 0000000..b2fe88a --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/distribution/plugins/package-tree.html @@ -0,0 +1,148 @@ + + + + + +org.gradle.api.distribution.plugins Class Hierarchy (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + +
+

Hierarchy For Package org.gradle.api.distribution.plugins

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/logging/configuration/ShowStacktrace.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/logging/configuration/ShowStacktrace.html new file mode 100644 index 0000000..59ae957 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/logging/configuration/ShowStacktrace.html @@ -0,0 +1,371 @@ + + + + + +ShowStacktrace (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Enum ShowStacktrace

+
+
+ +
+ +
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static ShowStacktrace[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (ShowStacktrace c : ShowStacktrace.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static ShowStacktrace valueOf​(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/plugins/Convention.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/plugins/Convention.html new file mode 100644 index 0000000..c2b87d1 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/plugins/Convention.html @@ -0,0 +1,333 @@ + + + + + +Convention (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface Convention

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    ExtensionContainer
    +
    +
    +
    public interface Convention
    +extends ExtensionContainer
    +

    A Convention manages a set of convention objects. When you add a convention object to a + Convention, and the properties and methods of the convention object become available as properties and methods of + the object which the convention is associated to. A convention object is simply a POJO or POGO. Usually, a + Convention is used by plugins to extend a Project or a Task.

    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getPlugins

        +
        Map<String,​Object> getPlugins()
        +
        Returns the plugin convention objects contained in this convention.
        +
        +
        Returns:
        +
        The plugins. Returns an empty map when this convention does not contain any convention objects.
        +
        +
      • +
      + + + +
        +
      • +

        getPlugin

        +
        <T> T getPlugin​(Class<T> type)
        +         throws IllegalStateException
        +
        Locates the plugin convention object with the given type.
        +
        +
        Parameters:
        +
        type - The convention object type.
        +
        Returns:
        +
        The object. Never returns null.
        +
        Throws:
        +
        IllegalStateException - When there is no such object contained in this convention, or when there are + multiple such objects.
        +
        +
      • +
      + + + +
        +
      • +

        findPlugin

        +
        @Nullable
        +<T> T findPlugin​(Class<T> type)
        +          throws IllegalStateException
        +
        Locates the plugin convention object with the given type.
        +
        +
        Parameters:
        +
        type - The convention object type.
        +
        Returns:
        +
        The object. Returns null if there is no such object.
        +
        Throws:
        +
        IllegalStateException - When there are multiple matching objects.
        +
        +
      • +
      + + + +
        +
      • +

        getExtensionsAsDynamicObject

        +
        org.gradle.internal.metaobject.DynamicObject getExtensionsAsDynamicObject()
        +
        Returns a dynamic object which represents the properties and methods contributed by the extensions and convention objects contained in this + convention.
        +
        +
        Returns:
        +
        The dynamic object
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/plugins/JavaLibraryPlugin.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/plugins/JavaLibraryPlugin.html new file mode 100644 index 0000000..1de1607 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/plugins/JavaLibraryPlugin.html @@ -0,0 +1,309 @@ + + + + + +JavaLibraryPlugin (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class JavaLibraryPlugin

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        JavaLibraryPlugin

        +
        @Inject
        +public JavaLibraryPlugin​(org.gradle.api.plugins.jvm.internal.JvmEcosystemUtilities jvmEcosystemUtilities)
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        apply

        +
        public void apply​(Project project)
        +
        Description copied from interface: Plugin
        +
        Apply this plugin to the given target object.
        +
        +
        Specified by:
        +
        apply in interface Plugin<Project>
        +
        Parameters:
        +
        project - The target object
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/plugins/JavaPlatformPlugin.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/plugins/JavaPlatformPlugin.html new file mode 100644 index 0000000..02b3f39 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/plugins/JavaPlatformPlugin.html @@ -0,0 +1,460 @@ + + + + + +JavaPlatformPlugin (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class JavaPlatformPlugin

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Plugin<Project>
    +
    +
    +
    public class JavaPlatformPlugin
    +extends Object
    +implements Plugin<Project>
    +
    The Java platform plugin allows building platform components + for Java, which are usually published as BOM files (for Maven) + or Gradle platforms (Gradle metadata).
    +
    +
    Since:
    +
    5.2
    +
    See Also:
    +
    Java Platform plugin reference
    +
    +
  • +
+
+
+ +
+
+
    +
  • + + + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        apply

        +
        public void apply​(Project project)
        +
        Description copied from interface: Plugin
        +
        Apply this plugin to the given target object.
        +
        +
        Specified by:
        +
        apply in interface Plugin<Project>
        +
        Parameters:
        +
        project - The target object
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/plugins/PluginAware.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/plugins/PluginAware.html new file mode 100644 index 0000000..c380578 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/plugins/PluginAware.html @@ -0,0 +1,367 @@ + + + + + +PluginAware (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface PluginAware

+
+
+
+
    +
  • +
    +
    All Known Subinterfaces:
    +
    Gradle, Project, Settings
    +
    +
    +
    public interface PluginAware
    +
    Something that can have plugins applied to it. +

    + The plugin manager can be used for applying and detecting whether plugins have been applied. +

    + For more on writing and applying plugins, see Plugin.

    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        apply

        +
        void apply​(Closure closure)
        +
        Applies zero or more plugins or scripts. +

        + The given closure is used to configure an ObjectConfigurationAction, which “builds” the plugin application. +

        + This method differs from apply(java.util.Map) in that it allows methods of the configuration action to be invoked more than once.

        +
        +
        Parameters:
        +
        closure - the closure to configure an ObjectConfigurationAction with before “executing” it
        +
        See Also:
        +
        apply(java.util.Map)
        +
        +
      • +
      + + + + + + + +
        +
      • +

        apply

        +
        void apply​(Map<String,​?> options)
        +
        Applies a plugin or script, using the given options provided as a map. Does nothing if the plugin has already been applied. +

        + The given map is applied as a series of method calls to a newly created ObjectConfigurationAction. + That is, each key in the map is expected to be the name of a method ObjectConfigurationAction and the value to be compatible arguments to that method. + +

        The following options are available:

        + +
        • from: A script to apply. Accepts any path supported by Project.uri(Object).
        • + +
        • plugin: The id or implementation class of the plugin to apply.
        • + +
        • to: The target delegate object or objects. The default is this plugin aware object. Use this to configure objects other than this object.
        +
        +
        Parameters:
        +
        options - the options to use to configure and ObjectConfigurationAction before “executing” it
        +
        +
      • +
      + + + +
        +
      • +

        getPluginManager

        +
        PluginManager getPluginManager()
        +
        The plugin manager for this plugin aware object.
        +
        +
        Returns:
        +
        the plugin manager
        +
        Since:
        +
        2.3
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/plugins/PluginManager.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/plugins/PluginManager.html new file mode 100644 index 0000000..cbb7a4f --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/plugins/PluginManager.html @@ -0,0 +1,376 @@ + + + + + +PluginManager (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface PluginManager

+
+
+
+
    +
  • +
    +
    @NonExtensible
    +public interface PluginManager
    +
    Facilitates applying plugins and determining which plugins have been applied to a PluginAware object.
    +
    +
    Since:
    +
    2.3
    +
    See Also:
    +
    PluginAware
    +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Summary

      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      All Methods Instance Methods Abstract Methods 
      Modifier and TypeMethodDescription
      voidapply​(Class<?> type) +
      Applies the given plugin.
      +
      voidapply​(String pluginId) +
      Applies the plugin with the given ID.
      +
      AppliedPluginfindPlugin​(String id) +
      Returns the information about the plugin that has been applied with the given ID, or null if no plugin has been applied with the given ID.
      +
      booleanhasPlugin​(String id) +
      Returns true if a plugin with the given ID has already been applied, otherwise false.
      +
      voidwithPlugin​(String id, + Action<? super AppliedPlugin> action) +
      Executes the given action when the specified plugin is applied.
      +
      +
    • +
    +
  • +
+
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        apply

        +
        void apply​(String pluginId)
        +
        Applies the plugin with the given ID. Does nothing if the plugin has already been applied. +

        + Plugins in the "org.gradle" namespace can be applied directly via name. + That is, the following two lines are equivalent… +

        + pluginManager.apply "org.gradle.java"
        + pluginManager.apply "java"
        + 
        +
        +
        Parameters:
        +
        pluginId - the ID of the plugin to apply
        +
        Since:
        +
        2.3
        +
        +
      • +
      + + + +
        +
      • +

        apply

        +
        void apply​(Class<?> type)
        +
        Applies the given plugin. Does nothing if the plugin has already been applied. +

        + The given class should implement the Plugin interface, and be parameterized for a compatible type of this. +

        + The following two lines are equivalent… +

        + pluginManager.apply org.gradle.api.plugins.JavaPlugin
        + pluginManager.apply "org.gradle.java"
        + 
        +
        +
        Parameters:
        +
        type - the plugin class to apply
        +
        Since:
        +
        2.3
        +
        +
      • +
      + + + +
        +
      • +

        findPlugin

        +
        @Nullable
        +AppliedPlugin findPlugin​(String id)
        +
        Returns the information about the plugin that has been applied with the given ID, or null if no plugin has been applied with the given ID. +

        + Plugins in the "org.gradle" namespace (that is, core Gradle plugins) can be specified by either name (e.g. "java") or ID "org.gradle.java". + All other plugins must be queried for by their full ID (e.g. "org.company.some-plugin"). +

        + Some Gradle plugins have not yet migrated to fully qualified plugin IDs. + Such plugins can be detected with this method by simply using the unqualified ID (e.g. "some-third-party-plugin".

        +
        +
        Parameters:
        +
        id - the plugin ID
        +
        Returns:
        +
        information about the applied plugin, or null if no plugin has been applied with the given ID
        +
        Since:
        +
        2.3
        +
        +
      • +
      + + + +
        +
      • +

        hasPlugin

        +
        boolean hasPlugin​(String id)
        +
        Returns true if a plugin with the given ID has already been applied, otherwise false.
        +
        +
        Parameters:
        +
        id - the plugin ID. See findPlugin(String) for details about this parameter.
        +
        Returns:
        +
        true if the plugin has been applied
        +
        Since:
        +
        2.3
        +
        +
      • +
      + + + +
        +
      • +

        withPlugin

        +
        void withPlugin​(String id,
        +                Action<? super AppliedPlugin> action)
        +
        Executes the given action when the specified plugin is applied. +

        + If a plugin with the specified ID has already been applied, the supplied action will be executed immediately. + Otherwise, the action will executed immediately after a plugin with the specified ID is applied. +

        + The given action is always executed after the plugin has been applied.

        +
        +
        Parameters:
        +
        id - the plugin ID. See findPlugin(String) for details about this parameter.
        +
        action - the action to execute if/when the plugin is applied
        +
        Since:
        +
        2.3
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/plugins/catalog/CatalogPluginExtension.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/plugins/catalog/CatalogPluginExtension.html new file mode 100644 index 0000000..e0ece58 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/plugins/catalog/CatalogPluginExtension.html @@ -0,0 +1,267 @@ + + + + + +CatalogPluginExtension (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface CatalogPluginExtension

+
+
+
+
    +
  • +
    +
    @Incubating
    +public interface CatalogPluginExtension
    +
    Allows configuring a version catalog.
    +
    +
    Since:
    +
    7.0
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        versionCatalog

        +
        void versionCatalog​(Action<? super VersionCatalogBuilder> spec)
        +
        Configures the version catalog.
        +
        +
        Parameters:
        +
        spec - the spec used to configure the dependencies
        +
        +
      • +
      + + + +
        +
      • +

        configureExplicitAlias

        +
        void configureExplicitAlias​(String alias,
        +                            String group,
        +                            String name)
        +
        Configures an explicit alias for a dependency in case of name clash
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/plugins/quality/Pmd.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/plugins/quality/Pmd.html new file mode 100644 index 0000000..916d022 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/plugins/quality/Pmd.html @@ -0,0 +1,1015 @@ + + + + + +Pmd (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class Pmd

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Pmd

        +
        public Pmd()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getObjectFactory

        +
        @Inject
        +protected ObjectFactory getObjectFactory()
        +
      • +
      + + + +
        +
      • +

        getAntBuilder

        +
        @Inject
        +public org.gradle.api.internal.project.IsolatedAntBuilder getAntBuilder()
        +
      • +
      + + + +
        +
      • +

        run

        +
        public void run()
        +
      • +
      + + + +
        +
      • +

        stdOutIsAttachedToTerminal

        +
        public boolean stdOutIsAttachedToTerminal()
        +
      • +
      + + + + + + + +
        +
      • +

        reports

        +
        public PmdReports reports​(Action<? super PmdReports> configureAction)
        +
        Configures the reports to be generated by this task.
        +
        +
        Specified by:
        +
        reports in interface Reporting<PmdReports>
        +
        Parameters:
        +
        configureAction - The configuration
        +
        Returns:
        +
        The report container
        +
        Since:
        +
        3.0
        +
        +
      • +
      + + + +
        +
      • +

        validate

        +
        public static void validate​(int value)
        +
        Validates the value is a valid PMD rules minimum priority (1-5)
        +
        +
        Parameters:
        +
        value - rules minimum priority threshold
        +
        +
      • +
      + + + +
        +
      • +

        getSource

        +
        @PathSensitive(RELATIVE)
        +public FileTree getSource()
        +
        Returns the source for this task, after the include and exclude patterns have been applied. Ignores source files which do not exist. + +

        + The PathSensitivity for the sources is configured to be PathSensitivity.ABSOLUTE. + If your sources are less strict, please change it accordingly by overriding this method in your subclass. +

        +
        +
        Overrides:
        +
        getSource in class SourceTask
        +
        Returns:
        +
        The source.
        +
        +
      • +
      + + + +
        +
      • +

        getPmdClasspath

        +
        @Classpath
        +public FileCollection getPmdClasspath()
        +
        The class path containing the PMD library to be used.
        +
      • +
      + + + +
        +
      • +

        setPmdClasspath

        +
        public void setPmdClasspath​(FileCollection pmdClasspath)
        +
        The class path containing the PMD library to be used.
        +
      • +
      + + + +
        +
      • +

        getRuleSets

        +
        @Input
        +public List<String> getRuleSets()
        +
        The built-in rule sets to be used. See the official list of built-in rule sets. + +
        +     ruleSets = ["basic", "braces"]
        + 
        +
      • +
      + + + +
        +
      • +

        setRuleSets

        +
        public void setRuleSets​(List<String> ruleSets)
        +
        The built-in rule sets to be used. See the official list of built-in rule sets. + +
        +     ruleSets = ["basic", "braces"]
        + 
        +
      • +
      + + + +
        +
      • +

        getTargetJdk

        +
        @Input
        +public TargetJdk getTargetJdk()
        +
        The target JDK to use with PMD.
        +
      • +
      + + + +
        +
      • +

        setTargetJdk

        +
        public void setTargetJdk​(TargetJdk targetJdk)
        +
        The target JDK to use with PMD.
        +
      • +
      + + + +
        +
      • +

        getRuleSetConfig

        +
        @Nullable
        +@Optional
        +public TextResource getRuleSetConfig()
        +
        The custom rule set to be used (if any). Replaces ruleSetFiles, except that it does not currently support multiple rule sets. + + See the official documentation for how to author a rule set. + +
        +     ruleSetConfig = resources.text.fromFile(resources.file("config/pmd/myRuleSets.xml"))
        + 
        +
        +
        Since:
        +
        2.2
        +
        +
      • +
      + + + +
        +
      • +

        setRuleSetConfig

        +
        public void setRuleSetConfig​(@Nullable
        +                             TextResource ruleSetConfig)
        +
        The custom rule set to be used (if any). Replaces ruleSetFiles, except that it does not currently support multiple rule sets. + + See the official documentation for how to author a rule set. + +
        +     ruleSetConfig = resources.text.fromFile(resources.file("config/pmd/myRuleSets.xml"))
        + 
        +
        +
        Since:
        +
        2.2
        +
        +
      • +
      + + + +
        +
      • +

        getRuleSetFiles

        +
        @InputFiles
        +@PathSensitive(NONE)
        +public FileCollection getRuleSetFiles()
        +
        The custom rule set files to be used. See the official documentation for how to author a rule set file. + If you want to only use custom rule sets, you must clear ruleSets. + +
        +     ruleSetFiles = files("config/pmd/myRuleSet.xml")
        + 
        +
      • +
      + + + +
        +
      • +

        setRuleSetFiles

        +
        public void setRuleSetFiles​(FileCollection ruleSetFiles)
        +
        The custom rule set files to be used. See the official documentation for how to author a rule set file. + This adds to the default rule sets defined by getRuleSets(). + +
        +     ruleSetFiles = files("config/pmd/myRuleSets.xml")
        + 
        +
      • +
      + + + +
        +
      • +

        getReports

        +
        public final PmdReports getReports()
        +
        The reports to be generated by this task.
        +
        +
        Specified by:
        +
        getReports in interface Reporting<PmdReports>
        +
        Returns:
        +
        The report container
        +
        +
      • +
      + + + +
        +
      • +

        getIgnoreFailures

        +
        public boolean getIgnoreFailures()
        +
        Whether or not to allow the build to continue if there are warnings. + +
        +     ignoreFailures = true
        + 
        +
        +
        Specified by:
        +
        getIgnoreFailures in interface VerificationTask
        +
        Returns:
        +
        false, when the build should break on failure, true when the failures should be ignored.
        +
        +
      • +
      + + + +
        +
      • +

        setIgnoreFailures

        +
        public void setIgnoreFailures​(boolean ignoreFailures)
        +
        Whether or not to allow the build to continue if there are warnings. + +
        +     ignoreFailures = true
        + 
        +
        +
        Specified by:
        +
        setIgnoreFailures in interface VerificationTask
        +
        Parameters:
        +
        ignoreFailures - false to break the build on failure, true to ignore the failures. The default is false.
        +
        +
      • +
      + + + +
        +
      • +

        getMaxFailures

        +
        @Input
        +public Property<Integer> getMaxFailures()
        +
        The maximum number of failures to allow before stopping the build. + + Defaults to 0, which will stop the build on any failure. Values 0 and + above are valid. If
        ignoreFailures
        is set, this is ignored + and the build will continue (infinite failures allowed).
        +
        +
        Since:
        +
        6.4
        +
        +
      • +
      + + + + + + + +
        +
      • +

        isConsoleOutput

        +
        @Input
        +public boolean isConsoleOutput()
        +
        Whether or not to write PMD results to System.out.
        +
        +
        Since:
        +
        2.1
        +
        +
      • +
      + + + +
        +
      • +

        setConsoleOutput

        +
        public void setConsoleOutput​(boolean consoleOutput)
        +
        Whether or not to write PMD results to System.out.
        +
        +
        Since:
        +
        2.1
        +
        +
      • +
      + + + +
        +
      • +

        getClasspath

        +
        @Nullable
        +@Optional
        +@Classpath
        +public FileCollection getClasspath()
        +
        Compile class path for the classes to be analyzed. + + The classes on this class path are used during analysis but aren't analyzed themselves. + + This is only well supported for PMD 5.2.1 or better.
        +
        +
        Since:
        +
        2.8
        +
        +
      • +
      + + + +
        +
      • +

        setClasspath

        +
        public void setClasspath​(@Nullable
        +                         FileCollection classpath)
        +
        Compile class path for the classes to be analyzed. + + The classes on this class path are used during analysis but aren't analyzed themselves. + + This is only well supported for PMD 5.2.1 or better.
        +
        +
        Since:
        +
        2.8
        +
        +
      • +
      + + + +
        +
      • +

        getIncrementalAnalysis

        +
        @Internal
        +public Property<Boolean> getIncrementalAnalysis()
        +
        Controls whether to use incremental analysis or not. + + This is only supported for PMD 6.0.0 or better. See for more details.
        +
        +
        Since:
        +
        5.6
        +
        +
      • +
      + + + +
        +
      • +

        getIncrementalCacheFile

        +
        @LocalState
        +public File getIncrementalCacheFile()
        +
        Path to the incremental cache file, if incremental analysis is used.
        +
        +
        Since:
        +
        5.6
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/publish/ivy/IvyModuleDescriptorSpec.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/publish/ivy/IvyModuleDescriptorSpec.html new file mode 100644 index 0000000..6c0e792 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/publish/ivy/IvyModuleDescriptorSpec.html @@ -0,0 +1,454 @@ + + + + + +IvyModuleDescriptorSpec (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface IvyModuleDescriptorSpec

+
+
+
+
    +
  • +
    +
    public interface IvyModuleDescriptorSpec
    +
    The descriptor of any Ivy publication. +

    + Corresponds to the XML version of the Ivy Module Descriptor. +

    + The withXml(org.gradle.api.Action) method can be used to modify the descriptor after it has been generated according to the publication data. + However, the preferred way to customize the project information to be published is to use the dedicated configuration methods exposed by this class, e.g. + description(Action).

    +
    +
    Since:
    +
    1.3
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        withXml

        +
        void withXml​(Action<? super XmlProvider> action)
        +
        Allow configuration of the descriptor, after it has been generated according to the input data. + +
        + plugins {
        +     id 'ivy-publish'
        + }
        +
        + publishing {
        +   publications {
        +     ivy(IvyPublication) {
        +       descriptor {
        +         withXml {
        +           asNode().dependencies.dependency.find { it.@org == "junit" }.@rev = "4.10"
        +         }
        +       }
        +     }
        +   }
        + }
        + 
        + + Note that due to Gradle's internal type conversion system, you can pass a Groovy closure to this method and + it will be automatically converted to an Action. +

        + Each action/closure passed to this method will be stored as a callback, and executed when the publication + that this descriptor is attached to is published. +

        + For details on the structure of the XML to be modified, see the + Ivy Module Descriptor reference.

        +
        +
        Parameters:
        +
        action - The configuration action.
        +
        See Also:
        +
        IvyPublication, +XmlProvider
        +
        +
      • +
      + + + +
        +
      • +

        getStatus

        +
        @Nullable
        +String getStatus()
        +
        Returns the status for this publication.
        +
      • +
      + + + +
        +
      • +

        setStatus

        +
        void setStatus​(@Nullable
        +               String status)
        +
        Sets the status for this publication.
        +
      • +
      + + + +
        +
      • +

        getBranch

        +
        @Nullable
        +String getBranch()
        +
        Returns the branch for this publication
        +
      • +
      + + + +
        +
      • +

        setBranch

        +
        void setBranch​(@Nullable
        +               String branch)
        +
        Sets the branch for this publication
        +
      • +
      + + + +
        +
      • +

        getExtraInfo

        +
        IvyExtraInfoSpec getExtraInfo()
        +
        Returns the extra info element spec for this publication
        +
      • +
      + + + +
        +
      • +

        extraInfo

        +
        void extraInfo​(String namespace,
        +               String elementName,
        +               String value)
        +
        Adds a new extra info element to the publication
        +
      • +
      + + + +
        +
      • +

        license

        +
        void license​(Action<? super IvyModuleDescriptorLicense> action)
        +
        Creates, configures and adds a license to this publication.
        +
        +
        Since:
        +
        4.8
        +
        +
      • +
      + + + +
        +
      • +

        author

        +
        void author​(Action<? super IvyModuleDescriptorAuthor> action)
        +
        Creates, configures and adds an author to this publication.
        +
        +
        Since:
        +
        4.8
        +
        +
      • +
      + + + + +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/publish/maven/MavenPublication.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/publish/maven/MavenPublication.html new file mode 100644 index 0000000..82e00b6 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/publish/maven/MavenPublication.html @@ -0,0 +1,788 @@ + + + + + +MavenPublication (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface MavenPublication

+
+
+
+
    +
  • +
    +
    All Superinterfaces:
    +
    Named, Publication
    +
    +
    +
    public interface MavenPublication
    +extends Publication
    +
    A MavenPublication is the representation/configuration of how Gradle should publish something in Maven format. + + You directly add a named Maven Publication the project's publishing.publications container by providing MavenPublication as the type. +
    + publishing {
    +   publications {
    +     myPublicationName(MavenPublication) {
    +       // Configure the publication here
    +     }
    +   }
    + }
    + 
    + + The default Maven POM identifying attributes are mapped as follows: +
      +
    • groupId - project.group
    • +
    • artifactId - project.name
    • +
    • version - project.version
    • +
    + +

    + For certain common use cases, it's often sufficient to specify the component to publish, and nothing more (from(org.gradle.api.component.SoftwareComponent). + The published component is used to determine which artifacts to publish, and which dependencies should be listed in the generated POM file. +

    + To add additional artifacts to the set published, use the artifact(Object) and artifact(Object, org.gradle.api.Action) methods. + You can also completely replace the set of published artifacts using setArtifacts(Iterable). + Together, these methods give you full control over what artifacts will be published. +

    + To customize the metadata published in the generated POM, set properties, e.g. MavenPom.getDescription(), on the POM returned via the getPom() + method or directly by an action (or closure) passed into pom(org.gradle.api.Action). + As a last resort, it is possible to modify the generated POM using the MavenPom.withXml(org.gradle.api.Action) method. +

    +

    Example of publishing a Java module with a source artifact and a customized POM

    +
    + plugins {
    +     id 'java'
    +     id 'maven-publish'
    + }
    +
    + task sourceJar(type: Jar) {
    +   from sourceSets.main.allJava
    +   archiveClassifier = "sources"
    + }
    +
    + publishing {
    +   publications {
    +     myPublication(MavenPublication) {
    +       from components.java
    +       artifact sourceJar
    +       pom {
    +         name = "Demo"
    +         description = "A demonstration of Maven POM customization"
    +         url = "http://www.example.com/project"
    +         licenses {
    +           license {
    +             name = "The Apache License, Version 2.0"
    +             url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
    +           }
    +         }
    +         developers {
    +           developer {
    +             id = "johnd"
    +             name = "John Doe"
    +             email = "john.doe@example.com"
    +           }
    +         }
    +         scm {
    +           connection = "scm:svn:http://subversion.example.com/svn/project/trunk/"
    +           developerConnection = "scm:svn:https://subversion.example.com/svn/project/trunk/"
    +           url = "http://subversion.example.com/svn/project/trunk/"
    +         }
    +       }
    +     }
    +   }
    + }
    + 
    +
    +
    Since:
    +
    1.4
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getPom

        +
        MavenPom getPom()
        +
        The POM that will be published.
        +
        +
        Returns:
        +
        The POM that will be published.
        +
        +
      • +
      + + + +
        +
      • +

        pom

        +
        void pom​(Action<? super MavenPom> configure)
        +
        Configures the POM that will be published. + + The supplied action will be executed against the getPom() result. This method also accepts a closure argument, by type coercion.
        +
        +
        Parameters:
        +
        configure - The configuration action.
        +
        +
      • +
      + + + +
        +
      • +

        from

        +
        void from​(SoftwareComponent component)
        +
        Provides the software component that should be published. + +
          +
        • Any artifacts declared by the component will be included in the publication.
        • +
        • The dependencies declared by the component will be included in the published meta-data.
        • +
        + + Currently 3 types of component are supported: 'components.java' (added by the JavaPlugin), 'components.web' (added by the WarPlugin) + and `components.javaPlatform` (added by the JavaPlatformPlugin). + + For any individual MavenPublication, only a single component can be provided in this way. + + The following example demonstrates how to publish the 'java' component to a Maven repository. +
        + plugins {
        +     id 'java'
        +     id 'maven-publish'
        + }
        +
        + publishing {
        +   publications {
        +     maven(MavenPublication) {
        +       from components.java
        +     }
        +   }
        + }
        + 
        +
        +
        Parameters:
        +
        component - The software component to publish.
        +
        +
      • +
      + + + +
        +
      • +

        artifact

        +
        MavenArtifact artifact​(Object source)
        +
        Creates a custom MavenArtifact to be included in the publication. + + The artifact method can take a variety of input: +
          +
        • A PublishArtifact instance. Extension and classifier values are taken from the wrapped instance.
        • +
        • An AbstractArchiveTask instance. Extension and classifier values are taken from the wrapped instance.
        • +
        • Anything that can be resolved to a File via the Project.file(Object) method. + Extension and classifier values are interpolated from the file name.
        • +
        • A Map that contains a 'source' entry that can be resolved as any of the other input types, including file. + This map can contain a 'classifier' and an 'extension' entry to further configure the constructed artifact.
        • +
        + + The following example demonstrates the addition of various custom artifacts. +
        + plugins {
        +     id 'maven-publish'
        + }
        +
        + task sourceJar(type: Jar) {
        +   archiveClassifier = "sources"
        + }
        +
        + publishing {
        +   publications {
        +     maven(MavenPublication) {
        +       artifact sourceJar // Publish the output of the sourceJar task
        +       artifact 'my-file-name.jar' // Publish a file created outside of the build
        +       artifact source: sourceJar, classifier: 'src', extension: 'zip'
        +     }
        +   }
        + }
        + 
        +
        +
        Parameters:
        +
        source - The source of the artifact content.
        +
        +
      • +
      + + + +
        +
      • +

        artifact

        +
        MavenArtifact artifact​(Object source,
        +                       Action<? super MavenArtifact> config)
        +
        Creates an MavenArtifact to be included in the publication, which is configured by the associated action. + + The first parameter is used to create a custom artifact and add it to the publication, as per artifact(Object). + The created MavenArtifact is then configured using the supplied action, which can override the extension or classifier of the artifact. + This method also accepts the configure action as a closure argument, by type coercion. + +
        + plugins {
        +     id 'maven-publish'
        + }
        +
        + task sourceJar(type: Jar) {
        +   archiveClassifier = "sources"
        + }
        +
        + publishing {
        +   publications {
        +     maven(MavenPublication) {
        +       artifact(sourceJar) {
        +         // These values will be used instead of the values from the task. The task values will not be updated.
        +         classifier "src"
        +         extension "zip"
        +       }
        +       artifact("my-docs-file.htm") {
        +         classifier "documentation"
        +         extension "html"
        +       }
        +     }
        +   }
        + }
        + 
        +
        +
        Parameters:
        +
        source - The source of the artifact.
        +
        config - An action to configure the values of the constructed MavenArtifact.
        +
        +
      • +
      + + + +
        +
      • +

        setArtifacts

        +
        void setArtifacts​(Iterable<?> sources)
        +
        Clears any previously added artifacts from getArtifacts() and creates artifacts from the specified sources. + Each supplied source is interpreted as per artifact(Object). + + For example, to exclude the dependencies declared by a component and instead use a custom set of artifacts: +
        + plugins {
        +     id 'java'
        +     id 'maven-publish'
        + }
        +
        + task sourceJar(type: Jar) {
        +   archiveClassifier = "sources"
        + }
        +
        + publishing {
        +   publications {
        +     maven(MavenPublication) {
        +       from components.java
        +       artifacts = ["my-custom-jar.jar", sourceJar]
        +     }
        +   }
        + }
        + 
        +
        +
        Parameters:
        +
        sources - The set of artifacts for this publication.
        +
        +
      • +
      + + + +
        +
      • +

        getArtifacts

        +
        MavenArtifactSet getArtifacts()
        +
        Returns the complete set of artifacts for this publication.
        +
        +
        Returns:
        +
        the artifacts.
        +
        +
      • +
      + + + +
        +
      • +

        getGroupId

        +
        String getGroupId()
        +
        Returns the groupId for this publication.
        +
      • +
      + + + +
        +
      • +

        setGroupId

        +
        void setGroupId​(String groupId)
        +
        Sets the groupId for this publication.
        +
      • +
      + + + +
        +
      • +

        getArtifactId

        +
        String getArtifactId()
        +
        Returns the artifactId for this publication.
        +
      • +
      + + + +
        +
      • +

        setArtifactId

        +
        void setArtifactId​(String artifactId)
        +
        Sets the artifactId for this publication.
        +
      • +
      + + + +
        +
      • +

        getVersion

        +
        String getVersion()
        +
        Returns the version for this publication.
        +
      • +
      + + + +
        +
      • +

        setVersion

        +
        void setVersion​(String version)
        +
        Sets the version for this publication.
        +
      • +
      + + + +
        +
      • +

        versionMapping

        +
        void versionMapping​(Action<? super VersionMappingStrategy> configureAction)
        +
        Configures the version mapping strategy. + + For example, to use resolved versions for runtime dependencies: +
        + plugins {
        +     id 'java'
        +     id 'maven-publish'
        + }
        +
        + publishing {
        +   publications {
        +     maven(MavenPublication) {
        +       from components.java
        +       versionMapping {
        +         usage('java-runtime'){
        +           fromResolutionResult()
        +         }
        +       }
        +     }
        +   }
        + }
        + 
        +
        +
        Parameters:
        +
        configureAction - the configuration
        +
        Since:
        +
        5.2
        +
        +
      • +
      + + + +
        +
      • +

        suppressPomMetadataWarningsFor

        +
        void suppressPomMetadataWarningsFor​(String variantName)
        +
        Silences the compatibility warnings for the Maven publication for the specified variant. + + Warnings are emitted when Gradle features are used that cannot be mapped completely to Maven POM.
        +
        +
        Parameters:
        +
        variantName - the variant to silence warning for
        +
        Since:
        +
        6.0
        +
        +
      • +
      + + + +
        +
      • +

        suppressAllPomMetadataWarnings

        +
        void suppressAllPomMetadataWarnings()
        +
        Silences all the compatibility warnings for the Maven publication. + + Warnings are emitted when Gradle features are used that cannot be mapped completely to Maven POM.
        +
        +
        Since:
        +
        6.0
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/reporting/dependencies/HtmlDependencyReportTask.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/reporting/dependencies/HtmlDependencyReportTask.html new file mode 100644 index 0000000..8c6aaed --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/reporting/dependencies/HtmlDependencyReportTask.html @@ -0,0 +1,635 @@ + + + + + +HtmlDependencyReportTask (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class HtmlDependencyReportTask

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.gradle.api.internal.AbstractTask
    • +
    • +
        +
      • org.gradle.api.DefaultTask
      • +
      • +
          +
        • org.gradle.api.internal.ConventionTask
        • +
        • +
            +
          • org.gradle.api.reporting.dependencies.HtmlDependencyReportTask
          • +
          +
        • +
        +
      • +
      +
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.IConventionAware, org.gradle.api.internal.TaskInternal, ExtensionAware, Reporting<DependencyReportContainer>, Task, Configurable<Task>
    +
    +
    +
    @DisableCachingByDefault(because="Not worth caching")
    +public class HtmlDependencyReportTask
    +extends org.gradle.api.internal.ConventionTask
    +implements Reporting<DependencyReportContainer>
    +
    Generates an HTML dependency report. This report + combines the features of the ASCII dependency report and those of the ASCII + dependency insight report. For a given project, it generates a tree of the dependencies + of every configuration, and each dependency can be clicked to show the insight of + this dependency. +

    + This task generates a report for the task's containing project by default. But it can also generate + a report for multiple projects, by setting the value of the + projects property. Here's how to generate an HTML + dependency report for all the projects of a multi-project build, for example: +

    + htmlDependencyReport {
    +     projects = project.allprojects
    + }
    + 
    +

    + The report is generated in the build/reports/project/dependencies directory by default. + This can also be changed by setting the reports.html.destination property: +

    + htmlDependencyReport {
    +     reports.html.destination = file("build/reports/project/dependencies")
    + }
    + 
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        HtmlDependencyReportTask

        +
        public HtmlDependencyReportTask()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getProjectReportDirectory

        +
        @Internal
        +@Incubating
        +public DirectoryProperty getProjectReportDirectory()
        +
        Returns the project report directory.
        +
        +
        Returns:
        +
        the directory to store project reports
        +
        Since:
        +
        7.1
        +
        +
      • +
      + + + + + + + +
        +
      • +

        reports

        +
        public DependencyReportContainer reports​(Closure closure)
        +
        Description copied from interface: Reporting
        +
        Allow configuration of the report container by closure. + +
        + reports {
        +   html {
        +     enabled false
        +   }
        +   xml.destination "build/reports/myReport.xml"
        + }
        + 
        +
        +
        Specified by:
        +
        reports in interface Reporting<DependencyReportContainer>
        +
        Parameters:
        +
        closure - The configuration
        +
        Returns:
        +
        The report container
        +
        +
      • +
      + + + + + + + +
        +
      • +

        getObjectFactory

        +
        @Inject
        +protected ObjectFactory getObjectFactory()
        +
      • +
      + + + +
        +
      • +

        getVersionSelectorScheme

        +
        @Inject
        +protected org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionSelectorScheme getVersionSelectorScheme()
        +
      • +
      + + + +
        +
      • +

        getVersionComparator

        +
        @Inject
        +protected org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionComparator getVersionComparator()
        +
      • +
      + + + +
        +
      • +

        getVersionParser

        +
        @Inject
        +protected org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionParser getVersionParser()
        +
      • +
      + + + +
        +
      • +

        getCallbackActionDecorator

        +
        @Inject
        +protected org.gradle.api.internal.CollectionCallbackActionDecorator getCallbackActionDecorator()
        +
        Required for decorating reports container callbacks for tracing user code application.
        +
        +
        Since:
        +
        5.1
        +
        +
      • +
      + + + +
        +
      • +

        generate

        +
        public void generate()
        +
      • +
      + + + +
        +
      • +

        getProjects

        +
        @Internal
        +public Set<Project> getProjects()
        +
        Returns the set of projects to generate a report for. By default, the report is generated for the task's + containing project.
        +
        +
        Returns:
        +
        The set of files.
        +
        +
      • +
      + + + +
        +
      • +

        setProjects

        +
        public void setProjects​(Set<Project> projects)
        +
        Specifies the set of projects to generate this report for.
        +
        +
        Parameters:
        +
        projects - The set of projects. Must not be null.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/specs/package-summary.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/specs/package-summary.html new file mode 100644 index 0000000..d20a056 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/specs/package-summary.html @@ -0,0 +1,200 @@ + + + + + +org.gradle.api.specs (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + +
+

Package org.gradle.api.specs

+
+
+ + +
Classes for defining general purpose criteria.
+
    +
  • + + + + + + + + + + + + +
    Interface Summary 
    InterfaceDescription
    Spec<T> +
    Represents some predicate against objects of type T.
    +
    +
  • +
  • + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    AndSpec<T> +
    A CompositeSpec which requires all its specs to be true in order to evaluate to true.
    +
    CompositeSpec<T> +
    A Spec which aggregates a sequence of other Spec instances.
    +
    NotSpec<T> +
    A Spec implementation which negates another Spec.
    +
    OrSpec<T> +
    A CompositeSpec which requires any one of its specs to be true in order to evaluate to + true.
    +
    Specs +
    Provides a number of Spec implementations.
    +
    +
  • +
+
+ + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/tasks/AntBuilderAware.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/tasks/AntBuilderAware.html new file mode 100644 index 0000000..d6aae6f --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/tasks/AntBuilderAware.html @@ -0,0 +1,244 @@ + + + + + +AntBuilderAware (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface AntBuilderAware

+
+
+
+ +
+
+ +
+
+
    +
  • + + +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/tasks/compile/JavaCompile.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/tasks/compile/JavaCompile.html new file mode 100644 index 0000000..583dcc1 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/tasks/compile/JavaCompile.html @@ -0,0 +1,653 @@ + + + + + +JavaCompile (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class JavaCompile

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.IConventionAware, org.gradle.api.internal.TaskInternal, org.gradle.api.internal.tasks.compile.HasCompileOptions, ExtensionAware, Task, PatternFilterable, Configurable<Task>
    +
    +
    +
    @CacheableTask
    +public class JavaCompile
    +extends AbstractCompile
    +implements org.gradle.api.internal.tasks.compile.HasCompileOptions
    +
    Compiles Java source files. + +
    +     plugins {
    +         id 'java'
    +     }
    +
    +     tasks.withType(JavaCompile) {
    +         //enable compilation in a separate daemon process
    +         options.fork = true
    +     }
    + 
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        JavaCompile

        +
        public JavaCompile()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getSource

        +
        @ReplacedBy("stableSources")
        +public FileTree getSource()
        +
        Returns the source for this task, after the include and exclude patterns have been applied. Ignores source files which do not exist. + +

        + The PathSensitivity for the sources is configured to be PathSensitivity.ABSOLUTE. + If your sources are less strict, please change it accordingly by overriding this method in your subclass. +

        +
        +
        Overrides:
        +
        getSource in class SourceTask
        +
        Returns:
        +
        The source.
        +
        +
      • +
      + + + + + + + +
        +
      • +

        compile

        +
        protected void compile​(InputChanges inputs)
        +
        Compile the sources, taking into account the changes reported by inputs.
        +
        +
        Since:
        +
        6.0
        +
        +
      • +
      + + + +
        +
      • +

        getIncrementalCompilerFactory

        +
        @Inject
        +protected org.gradle.api.internal.tasks.compile.incremental.IncrementalCompilerFactory getIncrementalCompilerFactory()
        +
      • +
      + + + +
        +
      • +

        getJavaModuleDetector

        +
        @Inject
        +protected org.gradle.internal.jvm.JavaModuleDetector getJavaModuleDetector()
        +
      • +
      + + + +
        +
      • +

        getDeleter

        +
        @Inject
        +protected org.gradle.internal.file.Deleter getDeleter()
        +
      • +
      + + + +
        +
      • +

        getProjectLayout

        +
        @Inject
        +protected ProjectLayout getProjectLayout()
        +
      • +
      + + + +
        +
      • +

        getJavaToolchainService

        +
        @Inject
        +protected JavaToolchainService getJavaToolchainService()
        +
      • +
      + + + +
        +
      • +

        getPreviousCompilationData

        +
        @OutputFile
        +protected File getPreviousCompilationData()
        +
        The previous compilation analysis. Internal use only.
        +
        +
        Since:
        +
        7.1
        +
        +
      • +
      + + + +
        +
      • +

        getModularity

        +
        public ModularitySpec getModularity()
        +
        Returns the module path handling of this compile task.
        +
        +
        Since:
        +
        6.4
        +
        +
      • +
      + + + +
        +
      • +

        getOptions

        +
        public CompileOptions getOptions()
        +
        Returns the compilation options.
        +
        +
        Specified by:
        +
        getOptions in interface org.gradle.api.internal.tasks.compile.HasCompileOptions
        +
        Returns:
        +
        The compilation options.
        +
        +
      • +
      + + + + + + + + +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/tasks/javadoc/Javadoc.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/tasks/javadoc/Javadoc.html new file mode 100644 index 0000000..7195539 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/tasks/javadoc/Javadoc.html @@ -0,0 +1,953 @@ + + + + + +Javadoc (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class Javadoc

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.IConventionAware, org.gradle.api.internal.TaskInternal, ExtensionAware, Task, PatternFilterable, Configurable<Task>
    +
    +
    +
    @CacheableTask
    +public class Javadoc
    +extends SourceTask
    +

    Generates HTML API documentation for Java classes.

    +

    + If you create your own Javadoc tasks remember to specify the 'source' property! + Without source the Javadoc task will not create any documentation. Example: +

    + plugins {
    +     id 'java'
    + }
    +
    + task myJavadocs(type: Javadoc) {
    +   source = sourceSets.main.allJava
    + }
    + 
    + +

    + An example how to create a task that runs a custom doclet implementation: +

    + plugins {
    +     id 'java'
    + }
    +
    + configurations {
    +   jaxDoclet
    + }
    +
    + dependencies {
    +   //jaxDoclet "some.interesting:Dependency:1.0"
    + }
    +
    + task generateRestApiDocs(type: Javadoc) {
    +   source = sourceSets.main.allJava
    +   destinationDir = reporting.file("rest-api-docs")
    +   options.docletpath = configurations.jaxDoclet.files.asType(List)
    +   options.doclet = "com.lunatech.doclets.jax.jaxrs.JAXRSDoclet"
    +   options.addStringOption("jaxrscontext", "http://localhost:8080/myapp")
    + }
    + 
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        Javadoc

        +
        public Javadoc()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        generate

        +
        protected void generate()
        +
      • +
      + + + +
        +
      • +

        getJavaToolchainService

        +
        @Inject
        +protected JavaToolchainService getJavaToolchainService()
        +
      • +
      + + + +
        +
      • +

        getSource

        +
        @PathSensitive(RELATIVE)
        +public FileTree getSource()
        +
        Returns the source for this task, after the include and exclude patterns have been applied. Ignores source files which do not exist. + +

        + The PathSensitivity for the sources is configured to be PathSensitivity.ABSOLUTE. + If your sources are less strict, please change it accordingly by overriding this method in your subclass. +

        +
        +
        Overrides:
        +
        getSource in class SourceTask
        +
        Returns:
        +
        The source.
        +
        +
      • +
      + + + +
        +
      • +

        getJavadocTool

        +
        @Optional
        +public Property<JavadocTool> getJavadocTool()
        +
        Configures the javadoc executable to be used to generate javadoc documentation.
        +
        +
        Since:
        +
        6.7
        +
        +
      • +
      + + + +
        +
      • +

        getDestinationDir

        +
        @Internal
        +@Nullable
        +public File getDestinationDir()
        +

        Returns the directory to generate the documentation into.

        +
        +
        Returns:
        +
        The directory.
        +
        +
      • +
      + + + + + + + +
        +
      • +

        setDestinationDir

        +
        public void setDestinationDir​(File destinationDir)
        +

        Sets the directory to generate the documentation into.

        +
      • +
      + + + +
        +
      • +

        getMaxMemory

        +
        @Internal
        +@Nullable
        +public String getMaxMemory()
        +
        Returns the amount of memory allocated to this task.
        +
      • +
      + + + +
        +
      • +

        setMaxMemory

        +
        public void setMaxMemory​(String maxMemory)
        +
        Sets the amount of memory allocated to this task.
        +
        +
        Parameters:
        +
        maxMemory - The amount of memory
        +
        +
      • +
      + + + +
        +
      • +

        getTitle

        +
        @Nullable
        +@Optional
        +@Input
        +public String getTitle()
        +

        Returns the title for the generated documentation.

        +
        +
        Returns:
        +
        The title, possibly null.
        +
        +
      • +
      + + + +
        +
      • +

        setTitle

        +
        public void setTitle​(@Nullable
        +                     String title)
        +

        Sets the title for the generated documentation.

        +
      • +
      + + + +
        +
      • +

        isVerbose

        +
        @Internal
        +public boolean isVerbose()
        +
        Returns whether Javadoc generation is accompanied by verbose output.
        +
        +
        See Also:
        +
        setVerbose(boolean)
        +
        +
      • +
      + + + +
        +
      • +

        setVerbose

        +
        public void setVerbose​(boolean verbose)
        +
        Sets whether Javadoc generation is accompanied by verbose output or not. The verbose output is done via println + (by the underlying Ant task). Thus it is not handled by our logging.
        +
        +
        Parameters:
        +
        verbose - Whether the output should be verbose.
        +
        +
      • +
      + + + +
        +
      • +

        getClasspath

        +
        @Classpath
        +public FileCollection getClasspath()
        +
        Returns the classpath to use to resolve type references in the source code.
        +
        +
        Returns:
        +
        The classpath.
        +
        +
      • +
      + + + +
        +
      • +

        setClasspath

        +
        public void setClasspath​(FileCollection classpath)
        +
        Sets the classpath to use to resolve type references in this source code.
        +
        +
        Parameters:
        +
        classpath - The classpath. Must not be null.
        +
        +
      • +
      + + + +
        +
      • +

        getModularity

        +
        public ModularitySpec getModularity()
        +
        Returns the module path handling of this javadoc task.
        +
        +
        Since:
        +
        6.4
        +
        +
      • +
      + + + +
        +
      • +

        getOptions

        +
        public MinimalJavadocOptions getOptions()
        +
        Returns the Javadoc generation options.
        +
        +
        Returns:
        +
        The options. Never returns null.
        +
        +
      • +
      + + + +
        +
      • +

        options

        +
        public void options​(Closure<?> block)
        +
        Convenience method for configuring Javadoc generation options.
        +
        +
        Parameters:
        +
        block - The configuration block for Javadoc generation options.
        +
        +
      • +
      + + + +
        +
      • +

        options

        +
        public void options​(Action<? super MinimalJavadocOptions> action)
        +
        Convenience method for configuring Javadoc generation options.
        +
        +
        Parameters:
        +
        action - The action for Javadoc generation options.
        +
        Since:
        +
        3.5
        +
        +
      • +
      + + + +
        +
      • +

        isFailOnError

        +
        @Input
        +public boolean isFailOnError()
        +
        Specifies whether this task should fail when errors are encountered during Javadoc generation. When true, + this task will fail on Javadoc error. When false, this task will ignore Javadoc errors.
        +
      • +
      + + + +
        +
      • +

        setFailOnError

        +
        public void setFailOnError​(boolean failOnError)
        +
      • +
      + + + +
        +
      • +

        getOptionsFile

        +
        @Internal
        +public File getOptionsFile()
        +
      • +
      + + + +
        +
      • +

        getExecutable

        +
        @Nullable
        +@Optional
        +@Input
        +public String getExecutable()
        +
        Returns the Javadoc executable to use to generate the Javadoc. When null, the Javadoc executable for + the current JVM is used or from the toolchain if configured.
        +
        +
        Returns:
        +
        The executable. May be null.
        +
        See Also:
        +
        getJavadocTool()
        +
        +
      • +
      + + + +
        +
      • +

        setExecutable

        +
        public void setExecutable​(@Nullable
        +                          String executable)
        +
      • +
      + + + +
        +
      • +

        getDeleter

        +
        @Inject
        +protected org.gradle.internal.file.Deleter getDeleter()
        +
      • +
      + + + +
        +
      • +

        getProjectLayout

        +
        @Inject
        +protected ProjectLayout getProjectLayout()
        +
      • +
      + + + +
        +
      • +

        getObjectFactory

        +
        @Inject
        +protected ObjectFactory getObjectFactory()
        +
      • +
      + + + +
        +
      • +

        getJavaModuleDetector

        +
        @Inject
        +protected org.gradle.internal.jvm.JavaModuleDetector getJavaModuleDetector()
        +
      • +
      + + + +
        +
      • +

        getExecActionFactory

        +
        @Inject
        +protected org.gradle.process.internal.ExecActionFactory getExecActionFactory()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/tasks/testing/junit/package-tree.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/tasks/testing/junit/package-tree.html new file mode 100644 index 0000000..8c6ae28 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/api/tasks/testing/junit/package-tree.html @@ -0,0 +1,152 @@ + + + + + +org.gradle.api.tasks.testing.junit Class Hierarchy (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + +
+

Hierarchy For Package org.gradle.api.tasks.testing.junit

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/caching/http/package-tree.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/caching/http/package-tree.html new file mode 100644 index 0000000..0733a3d --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/caching/http/package-tree.html @@ -0,0 +1,153 @@ + + + + + +org.gradle.caching.http Class Hierarchy (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + +
+

Hierarchy For Package org.gradle.caching.http

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +
+ + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/external/javadoc/JavadocOptionFileOption.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/external/javadoc/JavadocOptionFileOption.html new file mode 100644 index 0000000..abe98ba --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/external/javadoc/JavadocOptionFileOption.html @@ -0,0 +1,250 @@ + + + + + +JavadocOptionFileOption (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface JavadocOptionFileOption<T>

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getOption

        +
        String getOption()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/language/base/plugins/ComponentModelBasePlugin.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/language/base/plugins/ComponentModelBasePlugin.html new file mode 100644 index 0000000..e4534c8 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/language/base/plugins/ComponentModelBasePlugin.html @@ -0,0 +1,306 @@ + + + + + +ComponentModelBasePlugin (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class ComponentModelBasePlugin

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.gradle.language.base.plugins.ComponentModelBasePlugin
    • +
    +
  • +
+
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Plugin<Project>
    +
    +
    +
    @Incubating
    +public class ComponentModelBasePlugin
    +extends Object
    +implements Plugin<Project>
    +
    Base plugin for component support. + + Adds a ComponentSpecContainer named components to the model. + + For each binary instance added to the binaries container, registers a lifecycle task to create that binary.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ComponentModelBasePlugin

        +
        public ComponentModelBasePlugin()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        apply

        +
        public void apply​(Project project)
        +
        Description copied from interface: Plugin
        +
        Apply this plugin to the given target object.
        +
        +
        Specified by:
        +
        apply in interface Plugin<Project>
        +
        Parameters:
        +
        project - The target object
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/language/base/plugins/LanguageBasePlugin.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/language/base/plugins/LanguageBasePlugin.html new file mode 100644 index 0000000..ae249e1 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/language/base/plugins/LanguageBasePlugin.html @@ -0,0 +1,305 @@ + + + + + +LanguageBasePlugin (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class LanguageBasePlugin

+
+
+
    +
  • java.lang.Object
  • +
  • +
      +
    • org.gradle.language.base.plugins.LanguageBasePlugin
    • +
    +
  • +
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        LanguageBasePlugin

        +
        public LanguageBasePlugin()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        apply

        +
        public void apply​(Project project)
        +
        Description copied from interface: Plugin
        +
        Apply this plugin to the given target object.
        +
        +
        Specified by:
        +
        apply in interface Plugin<Project>
        +
        Parameters:
        +
        project - The target object
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/language/c/plugins/package-tree.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/language/c/plugins/package-tree.html new file mode 100644 index 0000000..a017046 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/language/c/plugins/package-tree.html @@ -0,0 +1,149 @@ + + + + + +org.gradle.language.c.plugins Class Hierarchy (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + +
+

Hierarchy For Package org.gradle.language.c.plugins

+Package Hierarchies: + +
+
+

Class Hierarchy

+
    +
  • java.lang.Object +
      +
    • org.gradle.language.c.plugins.CLangPlugin (implements org.gradle.api.Plugin<T>)
    • +
    • org.gradle.language.c.plugins.CPlugin (implements org.gradle.api.Plugin<T>)
    • +
    +
  • +
+
+ + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/language/jvm/tasks/ProcessResources.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/language/jvm/tasks/ProcessResources.html new file mode 100644 index 0000000..a16adda --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/language/jvm/tasks/ProcessResources.html @@ -0,0 +1,408 @@ + + + + + +ProcessResources (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class ProcessResources

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        ProcessResources

        +
        public ProcessResources()
        +
      • +
      +
    • +
    + +
      +
    • + + +

      Method Detail

      + + + + + + + +
        +
      • +

        getDeleter

        +
        @Inject
        +protected org.gradle.internal.file.Deleter getDeleter()
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/language/nativeplatform/tasks/UnexportMainSymbol.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/language/nativeplatform/tasks/UnexportMainSymbol.html new file mode 100644 index 0000000..62a37b2 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/language/nativeplatform/tasks/UnexportMainSymbol.html @@ -0,0 +1,424 @@ + + + + + +UnexportMainSymbol (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class UnexportMainSymbol

+
+
+ +
+
    +
  • +
    +
    All Implemented Interfaces:
    +
    Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, ExtensionAware, Task, Configurable<Task>
    +
    +
    +
    @CacheableTask
    +public class UnexportMainSymbol
    +extends DefaultTask
    +
    Unexports the main entry point symbol in an object file, so the object file can be linked with an executable.
    +
    +
    Since:
    +
    4.4
    +
    +
  • +
+
+
+ +
+
+ +
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/nativeplatform/NativeLibrarySpec.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/nativeplatform/NativeLibrarySpec.html new file mode 100644 index 0000000..b0ea3f2 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/nativeplatform/NativeLibrarySpec.html @@ -0,0 +1,348 @@ + + + + + +NativeLibrarySpec (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface NativeLibrarySpec

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getShared

        +
        NativeLibraryRequirement getShared()
        +
        Converts this library to a native library requirement that uses the shared library variant. This is the default.
        +
      • +
      + + + +
        +
      • +

        getStatic

        +
        NativeLibraryRequirement getStatic()
        +
        Converts this library to a native library requirement that uses the static library variant.
        +
      • +
      + + + +
        +
      • +

        getApi

        +
        NativeLibraryRequirement getApi()
        +
        Converts this library to a native library requirement that uses the api library linkage.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/nativeplatform/tasks/ObjectFilesToBinary.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/nativeplatform/tasks/ObjectFilesToBinary.html new file mode 100644 index 0000000..f330675 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/nativeplatform/tasks/ObjectFilesToBinary.html @@ -0,0 +1,298 @@ + + + + + +ObjectFilesToBinary (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface ObjectFilesToBinary

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        source

        +
        void source​(Object source)
        +
        Adds a set of object files to be combined into the file binary. + The provided source object is evaluated as per Project.files(Object...).
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/nativeplatform/test/cunit/package-summary.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/nativeplatform/test/cunit/package-summary.html new file mode 100644 index 0000000..7d5fed3 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/nativeplatform/test/cunit/package-summary.html @@ -0,0 +1,166 @@ + + + + + +org.gradle.nativeplatform.test.cunit (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + +
+

@Incubating +

+

Package org.gradle.nativeplatform.test.cunit

+
+
+ + +
API classes for cunit integration.
+ +
+ + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/nativeplatform/toolchain/SwiftcPlatformToolChain.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/nativeplatform/toolchain/SwiftcPlatformToolChain.html new file mode 100644 index 0000000..40712cc --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/nativeplatform/toolchain/SwiftcPlatformToolChain.html @@ -0,0 +1,334 @@ + + + + + +SwiftcPlatformToolChain (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface SwiftcPlatformToolChain

+
+
+
+ +
+
+ +
+
+ +
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/nativeplatform/toolchain/VisualCpp.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/nativeplatform/toolchain/VisualCpp.html new file mode 100644 index 0000000..8e1336d --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/nativeplatform/toolchain/VisualCpp.html @@ -0,0 +1,340 @@ + + + + + +VisualCpp (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface VisualCpp

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getInstallDir

        +
        File getInstallDir()
        +
        The directory where Visual Studio or Visual C++ is installed.
        +
      • +
      + + + +
        +
      • +

        setInstallDir

        +
        void setInstallDir​(Object installDir)
        +
        The directory where Visual Studio or Visual C++ is installed.
        +
      • +
      + + + +
        +
      • +

        getWindowsSdkDir

        +
        File getWindowsSdkDir()
        +
        The directory where Windows SDK is installed.
        +
      • +
      + + + +
        +
      • +

        setWindowsSdkDir

        +
        void setWindowsSdkDir​(Object installDir)
        +
        The directory where Windows SDK is installed.
        +
      • +
      + + + +
        +
      • +

        eachPlatform

        +
        void eachPlatform​(Action<? super VisualCppPlatformToolChain> action)
        +
        Adds an action that can fine-tune the tool configuration for each platform supported by this tool chain.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/platform/base/DependencySpecContainer.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/platform/base/DependencySpecContainer.html new file mode 100644 index 0000000..fcaa566 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/platform/base/DependencySpecContainer.html @@ -0,0 +1,355 @@ + + + + + +DependencySpecContainer (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface DependencySpecContainer

+
+
+
+
    +
  • +
    +
    @Incubating
    +public interface DependencySpecContainer
    +
    A container for dependency specifications.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        project

        +
        ProjectDependencySpecBuilder project​(String path)
        +
        Defines a new dependency, based on a project path. The returned dependency can be mutated.
        +
        +
        Parameters:
        +
        path - the project path
        +
        Returns:
        +
        a mutable dependency, added to this container
        +
        +
      • +
      + + + +
        +
      • +

        library

        +
        ProjectDependencySpecBuilder library​(String name)
        +
        Defines a new dependency, based on a library name. The returned dependency can be mutated.
        +
        +
        Parameters:
        +
        name - of the library
        +
        Returns:
        +
        a mutable dependency, added to this container
        +
        +
      • +
      + + + +
        +
      • +

        module

        +
        ModuleDependencySpecBuilder module​(String moduleIdOrName)
        +
        Defines a new module dependency, based on a module id or a simple name. The returned dependency can be mutated.
        +
        +
        Parameters:
        +
        moduleIdOrName - of the module
        +
        Returns:
        +
        a mutable module dependency, added to this container
        +
        +
      • +
      + + + +
        +
      • +

        group

        +
        ModuleDependencySpecBuilder group​(String name)
        +
        Defines a new module dependency, based on a module group name. The returned dependency can be mutated.
        +
        +
        Parameters:
        +
        name - of the module group
        +
        Returns:
        +
        a mutable module dependency, added to this container
        +
        +
      • +
      + + + +
        +
      • +

        getDependencies

        +
        Collection<DependencySpec> getDependencies()
        +
        Returns an immutable view of dependencies stored in this container.
        +
        +
        Returns:
        +
        an immutable view of dependencies. Each dependency in the collection is itself immutable.
        +
        +
      • +
      + + + +
        +
      • +

        isEmpty

        +
        boolean isEmpty()
        +
        Returns true if this container doesn't hold any dependency.
        +
        +
        Returns:
        +
        true if this container doesn't contain any dependency specification.
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/plugin/devel/plugins/package-summary.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/plugin/devel/plugins/package-summary.html new file mode 100644 index 0000000..4b228dd --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/plugin/devel/plugins/package-summary.html @@ -0,0 +1,164 @@ + + + + + +org.gradle.plugin.devel.plugins (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + +
+

Package org.gradle.plugin.devel.plugins

+
+
+ + +
Plugins for assisting with plugin development.
+
    +
  • + + + + + + + + + + + + + + + + +
    Class Summary 
    ClassDescription
    ExternalPluginValidationPlugin +
    Validates plugins applied to a build, by checking property annotations on work items like tasks and artifact transforms.
    +
    JavaGradlePluginPlugin +
    A plugin for building java gradle plugins.
    +
    +
  • +
+
+ + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/plugins/ide/package-summary.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/plugins/ide/package-summary.html new file mode 100644 index 0000000..4c901d4 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/plugins/ide/package-summary.html @@ -0,0 +1,158 @@ + + + + + +org.gradle.plugins.ide (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + +
+

Package org.gradle.plugins.ide

+
+
+ + +
General purpose IDE types.
+
    +
  • + + + + + + + + + + + + +
    Interface Summary 
    InterfaceDescription
    IdeWorkspace +
    Represents an IDE "workspace" that is generated by Gradle and can be opened in the IDE.
    +
    +
  • +
+
+ + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/testkit/runner/UnexpectedBuildSuccess.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/testkit/runner/UnexpectedBuildSuccess.html new file mode 100644 index 0000000..055709b --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/testkit/runner/UnexpectedBuildSuccess.html @@ -0,0 +1,297 @@ + + + + + +UnexpectedBuildSuccess (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Class UnexpectedBuildSuccess

+
+
+ +
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Constructor Detail

      + + + +
        +
      • +

        UnexpectedBuildSuccess

        +
        public UnexpectedBuildSuccess​(String message,
        +                              BuildResult buildResult)
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/tooling/ConfigurableLauncher.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/tooling/ConfigurableLauncher.html new file mode 100644 index 0000000..a260187 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/tooling/ConfigurableLauncher.html @@ -0,0 +1,832 @@ + + + + + +ConfigurableLauncher (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface ConfigurableLauncher<T extends ConfigurableLauncher<T>>

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        withArguments

        +
        T withArguments​(String... arguments)
        +
        Specify the command line build arguments. Useful mostly for running tasks via BuildLauncher. +

        + Be aware that not all of the Gradle command line options are supported! + Only the build arguments that configure the build execution are supported. + They are modelled in the Gradle API via StartParameter. + Examples of supported build arguments: '--info', '-p'. + The command line instructions that are actually separate commands (like '-?' and '-v') are not supported. + Some other instructions like '--daemon' are also not supported - the tooling API always runs with the daemon. +

        + If an unknown or unsupported command line option is specified, UnsupportedBuildArgumentException + will be thrown at the time the operation is executed via BuildLauncher.run() or ModelBuilder.get(). +

        + For the list of all Gradle command line options please refer to the User Manual + or take a look at the output of the 'gradle -?' command. Majority of arguments modeled by + StartParameter are supported. +

        + The arguments can potentially override some other settings you have configured. + For example, the project directory or Gradle user home directory that are configured + in the GradleConnector. + Also, the task names configured by BuildLauncher.forTasks(String...) can be overridden + if you happen to specify other tasks via the build arguments. +

        + See the example in the docs for BuildLauncher + + If not configured, null, or an empty array is passed, then the reasonable default will be used. + +

        Requires Gradle 1.0 or later.

        +
        +
        Specified by:
        +
        withArguments in interface LongRunningOperation
        +
        Parameters:
        +
        arguments - Gradle command line arguments
        +
        Returns:
        +
        this
        +
        Since:
        +
        1.0
        +
        +
      • +
      + + + +
        +
      • +

        withArguments

        +
        T withArguments​(Iterable<String> arguments)
        +
        Specify the command line build arguments. Useful mostly for running tasks via BuildLauncher. +

        + If not configured, null, or an empty list is passed, then the reasonable default will be used. + +

        Requires Gradle 1.0 or later.

        +
        +
        Specified by:
        +
        withArguments in interface LongRunningOperation
        +
        Parameters:
        +
        arguments - Gradle command line arguments
        +
        Returns:
        +
        this
        +
        Since:
        +
        2.6
        +
        +
      • +
      + + + +
        +
      • +

        addArguments

        +
        T addArguments​(String... arguments)
        +
        Appends new command line arguments to the existing list. Useful mostly for running tasks via BuildLauncher.
        +
        +
        Specified by:
        +
        addArguments in interface LongRunningOperation
        +
        Parameters:
        +
        arguments - Gradle command line arguments
        +
        Returns:
        +
        this
        +
        Since:
        +
        5.0
        +
        +
      • +
      + + + +
        +
      • +

        addArguments

        +
        T addArguments​(Iterable<String> arguments)
        +
        Appends new command line arguments to the existing list. Useful mostly for running tasks via BuildLauncher.
        +
        +
        Specified by:
        +
        addArguments in interface LongRunningOperation
        +
        Parameters:
        +
        arguments - Gradle command line arguments
        +
        Returns:
        +
        this
        +
        Since:
        +
        5.0
        +
        +
      • +
      + + + +
        +
      • +

        setStandardOutput

        +
        T setStandardOutput​(OutputStream outputStream)
        +
        Sets the OutputStream which should receive standard output logging generated while running the operation. + The default is to discard the output.
        +
        +
        Specified by:
        +
        setStandardOutput in interface LongRunningOperation
        +
        Parameters:
        +
        outputStream - The output stream. The system default character encoding will be used to encode characters written to this stream.
        +
        Returns:
        +
        this
        +
        Since:
        +
        1.0-milestone-3
        +
        +
      • +
      + + + +
        +
      • +

        setStandardError

        +
        T setStandardError​(OutputStream outputStream)
        +
        Sets the OutputStream which should receive standard error logging generated while running the operation. + The default is to discard the output.
        +
        +
        Specified by:
        +
        setStandardError in interface LongRunningOperation
        +
        Parameters:
        +
        outputStream - The output stream. The system default character encoding will be used to encode characters written to this stream.
        +
        Returns:
        +
        this
        +
        Since:
        +
        1.0-milestone-3
        +
        +
      • +
      + + + +
        +
      • +

        setColorOutput

        +
        T setColorOutput​(boolean colorOutput)
        +
        Specifies whether to generate colored (ANSI encoded) output for logging. The default is to not generate color output. + +

        Supported by Gradle 2.3 or later. Ignored for older versions.

        +
        +
        Specified by:
        +
        setColorOutput in interface LongRunningOperation
        +
        Parameters:
        +
        colorOutput - true to request color output (using ANSI encoding).
        +
        Returns:
        +
        this
        +
        Since:
        +
        2.3
        +
        +
      • +
      + + + +
        +
      • +

        setStandardInput

        +
        T setStandardInput​(InputStream inputStream)
        +
        Sets the InputStream that will be used as standard input for this operation. + Defaults to an empty input stream.
        +
        +
        Specified by:
        +
        setStandardInput in interface LongRunningOperation
        +
        Parameters:
        +
        inputStream - The input stream
        +
        Returns:
        +
        this
        +
        Since:
        +
        1.0-milestone-7
        +
        +
      • +
      + + + +
        +
      • +

        setJavaHome

        +
        T setJavaHome​(File javaHome)
        +
        Specifies the Java home directory to use for this operation. +

        + BuildEnvironment model contains information such as Java or Gradle environment. + If you want to get hold of this information you can ask tooling API to build this model. +

        + If not configured or null is passed, then the sensible default will be used.

        +
        +
        Specified by:
        +
        setJavaHome in interface LongRunningOperation
        +
        Parameters:
        +
        javaHome - to use for the Gradle process
        +
        Returns:
        +
        this
        +
        Since:
        +
        1.0-milestone-8
        +
        +
      • +
      + + + +
        +
      • +

        setJvmArguments

        +
        T setJvmArguments​(String... jvmArguments)
        +
        Specifies the Java VM arguments to use for this operation. +

        + BuildEnvironment model contains information such as Java or Gradle environment. + If you want to get hold of this information you can ask tooling API to build this model. +

        + If not configured, null, or an empty array is passed, then the reasonable default will be used.

        +
        +
        Specified by:
        +
        setJvmArguments in interface LongRunningOperation
        +
        Parameters:
        +
        jvmArguments - to use for the Gradle process
        +
        Returns:
        +
        this
        +
        Since:
        +
        1.0-milestone-9
        +
        +
      • +
      + + + +
        +
      • +

        setJvmArguments

        +
        T setJvmArguments​(Iterable<String> jvmArguments)
        +
        Specifies the Java VM arguments to use for this operation. +

        + BuildEnvironment model contains information such as Java or Gradle environment. + If you want to get hold of this information you can ask tooling API to build this model. +

        + If not configured, null, or an empty list is passed, then the reasonable default will be used.

        +
        +
        Specified by:
        +
        setJvmArguments in interface LongRunningOperation
        +
        Parameters:
        +
        jvmArguments - to use for the Gradle process
        +
        Returns:
        +
        this
        +
        Since:
        +
        2.6
        +
        +
      • +
      + + + +
        +
      • +

        addJvmArguments

        +
        T addJvmArguments​(String... jvmArguments)
        +
        Appends Java VM arguments to the existing list.
        +
        +
        Specified by:
        +
        addJvmArguments in interface LongRunningOperation
        +
        Parameters:
        +
        jvmArguments - the argument to use for the Gradle process
        +
        Returns:
        +
        this
        +
        Since:
        +
        5.0
        +
        +
      • +
      + + + +
        +
      • +

        addJvmArguments

        +
        T addJvmArguments​(Iterable<String> jvmArguments)
        +
        Appends Java VM arguments to the existing list.
        +
        +
        Specified by:
        +
        addJvmArguments in interface LongRunningOperation
        +
        Parameters:
        +
        jvmArguments - the argument to use for the Gradle process
        +
        Returns:
        +
        this
        +
        Since:
        +
        5.0
        +
        +
      • +
      + + + +
        +
      • +

        setEnvironmentVariables

        +
        T setEnvironmentVariables​(Map<String,​String> envVariables)
        +
        Specifies the environment variables to use for this operation. +

        + BuildEnvironment model contains information such as Java or Gradle environment. + If you want to get hold of this information you can ask tooling API to build this model. +

        + If not configured or null is passed, then the reasonable default will be used.

        +
        +
        Specified by:
        +
        setEnvironmentVariables in interface LongRunningOperation
        +
        Parameters:
        +
        envVariables - environment variables
        +
        Returns:
        +
        this
        +
        Since:
        +
        3.5
        +
        +
      • +
      + + + +
        +
      • +

        addProgressListener

        +
        T addProgressListener​(ProgressListener listener)
        +
        Adds a progress listener which will receive progress events as the operation runs. + +

        This method is intended to be replaced by LongRunningOperation.addProgressListener(org.gradle.tooling.events.ProgressListener). The new progress listener type + provides much richer information and much better handling of parallel operations that run during the build, such as tasks that run in parallel. + You should prefer using the new listener interface where possible. Note, however, that the new interface is supported only for Gradle 2.5. +

        +
        +
        Specified by:
        +
        addProgressListener in interface LongRunningOperation
        +
        Parameters:
        +
        listener - The listener
        +
        Returns:
        +
        this
        +
        Since:
        +
        1.0-milestone-3
        +
        +
      • +
      + + + +
        +
      • +

        addProgressListener

        +
        T addProgressListener​(ProgressListener listener)
        +
        Adds a progress listener which will receive progress events of all types as the operation runs. + +

        This method is intended to replace LongRunningOperation.addProgressListener(ProgressListener). You should prefer using the new progress listener method where possible, + as the new interface provides much richer information and much better handling of parallel operations that run during the build. +

        + +

        Supported by Gradle 2.5 or later. Gradle 2.4 supports OperationType.TEST operations only. Ignored for older versions.

        +
        +
        Specified by:
        +
        addProgressListener in interface LongRunningOperation
        +
        Parameters:
        +
        listener - The listener
        +
        Returns:
        +
        this
        +
        Since:
        +
        2.5
        +
        +
      • +
      + + + +
        +
      • +

        addProgressListener

        +
        T addProgressListener​(ProgressListener listener,
        +                      Set<OperationType> eventTypes)
        +
        Adds a progress listener which will receive progress events as the operations of the requested type run. + +

        This method is intended to replace LongRunningOperation.addProgressListener(ProgressListener). You should prefer using the new progress listener method where possible, + as the new interface provides much richer information and much better handling of parallel operations that run during the build. +

        + +

        Supported by Gradle 2.5 or later. Gradle 2.4 supports OperationType.TEST operations only. Ignored for older versions.

        +
        +
        Specified by:
        +
        addProgressListener in interface LongRunningOperation
        +
        Parameters:
        +
        listener - The listener
        +
        eventTypes - The types of operations to receive progress events for.
        +
        Returns:
        +
        this
        +
        Since:
        +
        2.5
        +
        +
      • +
      + + + +
        +
      • +

        addProgressListener

        +
        T addProgressListener​(ProgressListener listener,
        +                      OperationType... operationTypes)
        +
        Adds a progress listener which will receive progress events as the operations of the requested type run. + +

        This method is intended to replace LongRunningOperation.addProgressListener(ProgressListener). You should prefer using the new progress listener method where possible, + as the new interface provides much richer information and much better handling of parallel operations that run during the build. +

        + +

        Supported by Gradle 2.5 or later. Gradle 2.4 supports OperationType.TEST operations only. Ignored for older versions.

        +
        +
        Specified by:
        +
        addProgressListener in interface LongRunningOperation
        +
        Parameters:
        +
        listener - The listener
        +
        operationTypes - The types of operations to receive progress events for.
        +
        Returns:
        +
        this
        +
        Since:
        +
        2.6
        +
        +
      • +
      + + + +
        +
      • +

        withCancellationToken

        +
        T withCancellationToken​(CancellationToken cancellationToken)
        +
        Sets the cancellation token to use to cancel the operation if required. + +

        Supported by Gradle 2.1 or later. Ignored for older versions.

        +
        +
        Specified by:
        +
        withCancellationToken in interface LongRunningOperation
        +
        Since:
        +
        2.3
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/tooling/ProgressListener.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/tooling/ProgressListener.html new file mode 100644 index 0000000..b40e2de --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/tooling/ProgressListener.html @@ -0,0 +1,247 @@ + + + + + +ProgressListener (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface ProgressListener

+
+
+
+
    +
  • +
    +
    public interface ProgressListener
    +
    A listener which is notified as some long running operation makes progress.
    +
    +
    Since:
    +
    1.0-milestone-3
    +
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        statusChanged

        +
        void statusChanged​(ProgressEvent event)
        +
        Called when the progress status changes.
        +
        +
        Parameters:
        +
        event - An event describing the status change.
        +
        Since:
        +
        1.0-milestone-3
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/tooling/events/test/TestOutputDescriptor.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/tooling/events/test/TestOutputDescriptor.html new file mode 100644 index 0000000..461a253 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/tooling/events/test/TestOutputDescriptor.html @@ -0,0 +1,270 @@ + + + + + +TestOutputDescriptor (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface TestOutputDescriptor

+
+
+
+ +
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getDestination

        +
        Destination getDestination()
        +
        Describes whether the content was printed to the standard output or the standard error.
        +
      • +
      + + + +
        +
      • +

        getMessage

        +
        String getMessage()
        +
        The text printed by the test.
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/tooling/model/Dependency.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/tooling/model/Dependency.html new file mode 100644 index 0000000..9cd242b --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/tooling/model/Dependency.html @@ -0,0 +1,182 @@ + + + + + +Dependency (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface Dependency

+
+
+
+ +
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/tooling/model/idea/IdeaCompilerOutput.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/tooling/model/idea/IdeaCompilerOutput.html new file mode 100644 index 0000000..cbeb9f9 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/tooling/model/idea/IdeaCompilerOutput.html @@ -0,0 +1,290 @@ + + + + + +IdeaCompilerOutput (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Interface IdeaCompilerOutput

+
+
+
+
    +
  • +
    +
    public interface IdeaCompilerOutput
    +
    IDEA compiler output settings.
    +
  • +
+
+
+ +
+
+
    +
  • + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        getInheritOutputDirs

        +
        boolean getInheritOutputDirs()
        +
        whether current module should inherit project's output directory.
        +
        +
        Returns:
        +
        inherit output dirs flag
        +
        See Also:
        +
        getOutputDir(), +getTestOutputDir()
        +
        +
      • +
      + + + +
        +
      • +

        getOutputDir

        +
        @Nullable
        +File getOutputDir()
        +
        directory to store module's production classes and resources.
        +
        +
        Returns:
        +
        directory to store production output. non-null if + getInheritOutputDirs() returns 'false'
        +
        +
      • +
      + + + +
        +
      • +

        getTestOutputDir

        +
        @Nullable
        +File getTestOutputDir()
        +
        directory to store module's test classes and resources.
        +
        +
        Returns:
        +
        directory to store test output. non-null if + getInheritOutputDirs() returns 'false'
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/tooling/model/kotlin/dsl/EditorReportSeverity.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/tooling/model/kotlin/dsl/EditorReportSeverity.html new file mode 100644 index 0000000..63ea3f7 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/tooling/model/kotlin/dsl/EditorReportSeverity.html @@ -0,0 +1,362 @@ + + + + + +EditorReportSeverity (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Enum EditorReportSeverity

+
+
+ +
+ +
+
+ +
+
+
    +
  • + + + +
      +
    • + + +

      Method Detail

      + + + +
        +
      • +

        values

        +
        public static EditorReportSeverity[] values()
        +
        Returns an array containing the constants of this enum type, in +the order they are declared. This method may be used to iterate +over the constants as follows: +
        +for (EditorReportSeverity c : EditorReportSeverity.values())
        +    System.out.println(c);
        +
        +
        +
        Returns:
        +
        an array containing the constants of this enum type, in the order they are declared
        +
        +
      • +
      + + + +
        +
      • +

        valueOf

        +
        public static EditorReportSeverity valueOf​(String name)
        +
        Returns the enum constant of this type with the specified name. +The string must match exactly an identifier used to declare an +enum constant in this type. (Extraneous whitespace characters are +not permitted.)
        +
        +
        Parameters:
        +
        name - the name of the enum constant to be returned.
        +
        Returns:
        +
        the enum constant with the specified name
        +
        Throws:
        +
        IllegalArgumentException - if this enum type has no constant with the specified name
        +
        NullPointerException - if the argument is null
        +
        +
      • +
      +
    • +
    +
  • +
+
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/tooling/model/kotlin/dsl/package-tree.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/tooling/model/kotlin/dsl/package-tree.html new file mode 100644 index 0000000..ebddda7 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/tooling/model/kotlin/dsl/package-tree.html @@ -0,0 +1,167 @@ + + + + + +org.gradle.tooling.model.kotlin.dsl Class Hierarchy (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + +
+

Hierarchy For Package org.gradle.tooling.model.kotlin.dsl

+Package Hierarchies: + +
+
+

Class Hierarchy

+ +

Interface Hierarchy

+ +

Enum Hierarchy

+ +
+ + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/work/Incremental.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/work/Incremental.html new file mode 100644 index 0000000..a70e845 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/org/gradle/work/Incremental.html @@ -0,0 +1,185 @@ + + + + + +Incremental (Gradle API 7.2) + + + + + + + + + + + + + +
+ + + + +
+ + + +
+ +

Annotation Type Incremental

+
+
+
+ +
+
+ + + + + + + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/overview-summary.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/overview-summary.html new file mode 100644 index 0000000..2232064 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/javadoc/overview-summary.html @@ -0,0 +1,19 @@ + + + + + +Gradle API 7.2 + + + + + + + + +

index.html

+ + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/userguide/img/scalaPluginTasks.png b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/userguide/img/scalaPluginTasks.png new file mode 100644 index 0000000..4dbfb38 Binary files /dev/null and b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/userguide/img/scalaPluginTasks.png differ diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/userguide/variant_attributes.html b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/userguide/variant_attributes.html new file mode 100644 index 0000000..419b9a9 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/docs/userguide/variant_attributes.html @@ -0,0 +1,3413 @@ + + + + + + + +Working with Variant Attributes + + + + + + + + + + + + + +
+ + + +
+ +
+
+
+
+

As explained in the section on variant aware matching, attributes give semantics to variants and are used to perform the selection between them.

+
+
+

As a user of Gradle, attributes are often hidden as implementation details. +But it might be useful to understand the standard attributes defined by Gradle and its core plugins.

+
+
+

As a plugin author, these attributes, and the way they are defined, can serve as a basis for building your own set of attributes in your eco system plugin.

+
+
+
+
+

Standard attributes defined by Gradle

+
+
+

Gradle defines a list of standard attributes used by Gradle’s core plugins.

+
+
+

Ecosystem-independent standard attributes

+ + ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 1. Ecosystem-independent standard variant attributes
Attribute nameDescriptionValuescompatibility and disambiguation rules

org.gradle.usage

Indicates main purpose of variant

Usage values built from constants defined in Usage

Following ecosystem semantics (e.g. java-runtime can be used in place of java-api but not the opposite)

org.gradle.category

Indicates the category of this software component

Category values built from constants defined in Category

Following ecosystem semantics (e.g. library is default on the JVM, no compatibility otherwise)

org.gradle.libraryelements

Indicates the contents of a org.gradle.category=library variant

LibraryElements values built from constants defined in LibraryElements

Following ecosystem semantics(e.g. in the JVM world, jar is the default and is compatible with classes)

org.gradle.docstype

Indicates the contents of a org.gradle.category=documentation variant

DocsType values built from constants defined in DocsType

No default, no compatibility

org.gradle.dependency.bundling

Indicates how dependencies of a variant are accessed.

Bundling values built from constants defined in Bundling

Following ecosystem semantics (e.g. in the JVM world, embedded is compatible with external)

+ + ++++++ + + + + + + + + + + + + + + + + +
Table 2. Ecosystem-independent standard component attributes
Attribute nameDescriptionValuescompatibility and disambiguation rules

org.gradle.status

Component level attribute, derived

Based on a status scheme, with a default one existing based on the source repository.

Based on the scheme in use

+
+
+

JVM ecosystem specific attributes

+
+

In addition to the ecosystem independent attributes defined above, the JVM ecosystem adds the following attribute:

+
+ + ++++++ + + + + + + + + + + + + + + + + + + + + + + +
Table 3. JVM ecosystem standard component attributes
Attribute nameDescriptionValuescompatibility and disambiguation rules

org.gradle.jvm.version

Indicates the JVM version compatibility.

Integer using the version after the 1. for Java 1.4 and before, the major version for Java 5 and beyond.

Defaults to the JVM version used by Gradle, lower is compatible with higher, prefers highest compatible.

org.gradle.jvm.environment

Indicates that a variant is optimized for a certain JVM environment.

Common values are standard-jvm and android. Other values are allowed.

The attribute is used to prefer one variant over another if multiple are available, but in general all values are compatible. The default is standard-jvm.

+
+

The JVM ecosystem also contains a number of compatibility and disambiguation rules over the different attributes. +The reader willing to know more can take a look at the code for org.gradle.api.internal.artifacts.JavaEcosystemSupport.

+
+
+
+

Native ecosystem specific attributes

+
+

In addition to the ecosystem independent attributes defined above, the native ecosystem adds the following attributes:

+
+ + ++++++ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Table 4. Native ecosystem standard component attributes
Attribute nameDescriptionValuescompatibility and disambiguation rules

org.gradle.native.debuggable

Indicates if the binary was built with debugging symbols

Boolean

N/A

org.gradle.native.optimized

Indicates if the binary was built with optimization flags

Boolean

N/A

org.gradle.native.architecture

Indicates the target architecture of the binary

MachineArchitecture values built from constants defined in MachineArchitecture

None

org.gradle.native.operatingSystem

Indicates the target operating system of the binary

OperatingSystemFamily values built from constants defined in OperatingSystemFamily

None

+
+
+

Gradle plugin ecosystem specific attributes

+
+

For Gradle plugin development, the following attribute is supported since Gradle 7.0. +A Gradle plugin variant can specify compatibility with a Gradle API version through this attribute.

+
+ + ++++++ + + + + + + + + + + + + + + + + +
Table 5. Gradle plugin ecosystem standard component attributes
Attribute nameDescriptionValuescompatibility and disambiguation rules

org.gradle.plugin.api‑version

Indicates the Gradle API version compatibility.

Valid Gradle version strings.

Defaults to the currently running Gradle, lower is compatible with higher, prefers highest compatible.

+
+
+
+
+

Declaring custom attributes

+
+
+

If you are extending Gradle, e.g. by writing a plugin for another ecosystem, declaring custom attributes could be an option if you want to support variant-aware dependency management features in your plugin. +However, you should be cautious if you also attempt to publish libraries. +Semantics of new attributes are usually defined through a plugin, which can carry compatibility and disambiguation rules. +Consequently, builds that consume libraries published for a certain ecosystem, also need to apply the corresponding plugin to interpret attributes correctly. +If your plugin is intended for a larger audience, i.e. if it is openly available and libraries are published to public repositories, defining new attributes effectively extends the semantics of Gradle Module Metadata and comes with responsibilities. +E.g., support for attributes that are already published should not be removed again, or should be handled in some kind of compatibility layer in future versions of the plugin.

+
+
+
+
+

Creating attributes in a build script or plugin

+
+
+

Attributes are typed. An attribute can be created via the Attribute<T>.of method:

+
+
+
Example 1. Define attributes
+
+
+
+
+
build.gradle
+
+
// An attribute of type `String`
+def myAttribute = Attribute.of("my.attribute.name", String)
+// An attribute of type `Usage`
+def myUsage = Attribute.of("my.usage.attribute", Usage)
+
+
+
+
+
+
+
+
build.gradle.kts
+
+
// An attribute of type `String`
+val myAttribute = Attribute.of("my.attribute.name", String::class.java)
+// An attribute of type `Usage`
+val myUsage = Attribute.of("my.usage.attribute", Usage::class.java)
+
+
+
+
+
+
+
+

Currently, only attribute types of String, or anything extending Named is supported. +Attributes must be declared in the attribute schema found on the dependencies handler:

+
+
+
Example 2. Registering attributes on the attributes schema
+
+
+
+
+
build.gradle
+
+
dependencies.attributesSchema {
+    // registers this attribute to the attributes schema
+    attribute(myAttribute)
+    attribute(myUsage)
+}
+
+
+
+
+
+
+
+
build.gradle.kts
+
+
dependencies.attributesSchema {
+    // registers this attribute to the attributes schema
+    attribute(myAttribute)
+    attribute(myUsage)
+}
+
+
+
+
+
+
+
+

Then configurations can be configured to set values for attributes:

+
+
+
Example 3. Setting attributes on configurations
+
+
+
+
+
build.gradle
+
+
configurations {
+    myConfiguration {
+        attributes {
+            attribute(myAttribute, 'my-value')
+        }
+    }
+}
+
+
+
+
+
+
+
+
build.gradle.kts
+
+
configurations {
+    create("myConfiguration") {
+        attributes {
+            attribute(myAttribute, "my-value")
+        }
+    }
+}
+
+
+
+
+
+
+
+

For attributes which type extends Named, the value of the attribute must be created via the object factory:

+
+
+
Example 4. Named attributes
+
+
+
+
+
build.gradle
+
+
configurations {
+    myConfiguration {
+        attributes {
+            attribute(myUsage, project.objects.named(Usage, 'my-value'))
+        }
+    }
+}
+
+
+
+
+
+
+
+
build.gradle.kts
+
+
configurations {
+    "myConfiguration" {
+        attributes {
+            attribute(myUsage, project.objects.named(Usage::class.java, "my-value"))
+        }
+    }
+}
+
+
+
+
+
+
+
+

Attribute compatibility rules

+
+

Attributes let the engine select compatible variants. +However, there are cases where a provider may not have exactly what the consumer wants, but still something that it can use. +For example, if the consumer is asking for the API of a library, there’s a possibility that the producer doesn’t have such a variant, but only a runtime variant. +This is typical of libraries published on external repositories. +In this case, we know that even if we don’t have an exact match (API), we can still compile against the runtime variant (it contains more than what we need to compile but it’s still ok to use). +To deal with this, Gradle provides attribute compatibility rules. +The role of a compatibility rule is to explain what variants are compatible with what the consumer asked for.

+
+
+

Attribute compatibility rules have to be registered via the attribute matching strategy that you can obtain from the attributes schema.

+
+
+
+

Attribute disambiguation rules

+
+

Because multiple values for an attribute can be compatible with the requested attribute, Gradle needs to choose between the candidates. +This is done by implementing an attribute disambiguation rule.

+
+
+

Attribute disambiguation rules have to be registered via the attribute matching strategy that you can obtain from the attributes schema.

+
+
+
+
+
+ +
+ + +
+ + + + + + + \ No newline at end of file diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/lib/gradle-hashing-7.2.jar b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/lib/gradle-hashing-7.2.jar new file mode 100644 index 0000000..07dfe1c Binary files /dev/null and b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/lib/gradle-hashing-7.2.jar differ diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/lib/groovy-sql-3.0.8.jar b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/lib/groovy-sql-3.0.8.jar new file mode 100644 index 0000000..f5c5c5c Binary files /dev/null and b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/lib/groovy-sql-3.0.8.jar differ diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/lib/groovy-test-3.0.8.jar b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/lib/groovy-test-3.0.8.jar new file mode 100644 index 0000000..ad349e9 Binary files /dev/null and b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/lib/groovy-test-3.0.8.jar differ diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/lib/kotlin-compiler-embeddable-1.5.21-patched-for-gradle-7.2.jar b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/lib/kotlin-compiler-embeddable-1.5.21-patched-for-gradle-7.2.jar new file mode 100644 index 0000000..39e47e7 Binary files /dev/null and b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/lib/kotlin-compiler-embeddable-1.5.21-patched-for-gradle-7.2.jar differ diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/lib/plugins/gson-2.8.6.jar b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/lib/plugins/gson-2.8.6.jar new file mode 100644 index 0000000..4765c4a Binary files /dev/null and b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/lib/plugins/gson-2.8.6.jar differ diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/lib/plugins/jaxb-impl-3.0.0.jar b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/lib/plugins/jaxb-impl-3.0.0.jar new file mode 100644 index 0000000..a34baa7 Binary files /dev/null and b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/lib/plugins/jaxb-impl-3.0.0.jar differ diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/lib/plugins/plexus-interpolation-1.26.jar b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/lib/plugins/plexus-interpolation-1.26.jar new file mode 100644 index 0000000..cfcf162 Binary files /dev/null and b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/lib/plugins/plexus-interpolation-1.26.jar differ diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/base-services/org/gradle/internal/reflect/JavaMethod.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/base-services/org/gradle/internal/reflect/JavaMethod.java new file mode 100644 index 0000000..bedbdea --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/base-services/org/gradle/internal/reflect/JavaMethod.java @@ -0,0 +1,125 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.internal.reflect; + +import org.apache.commons.lang.StringUtils; +import org.gradle.api.GradleException; +import org.gradle.internal.UncheckedException; + +import javax.annotation.Nullable; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.Arrays; + +public class JavaMethod { + private final Method method; + private final Class returnType; + + /** + * Locates the given method. Searches all methods, including private methods. + */ + public static JavaMethod of(Class target, Class returnType, String name, Class... paramTypes) throws NoSuchMethodException { + return new JavaMethod(target, returnType, name, paramTypes); + } + + /** + * Locates the given static method. Searches all methods, including private methods. + */ + public static JavaMethod ofStatic(Class target, Class returnType, String name, Class... paramTypes) throws NoSuchMethodException { + return new JavaMethod(target, returnType, name, true, paramTypes); + } + + /** + * Locates the given method. Searches all methods, including private methods. + */ + public static JavaMethod of(T target, Class returnType, String name, Class... paramTypes) throws NoSuchMethodException { + @SuppressWarnings("unchecked") + Class targetClass = (Class) target.getClass(); + return of(targetClass, returnType, name, paramTypes); + } + + /** + * Locates the given method. Searches all methods, including private methods. + */ + public static JavaMethod of(Class returnType, Method method) throws NoSuchMethodException { + return new JavaMethod(returnType, method); + } + + public JavaMethod(Class target, Class returnType, String name, boolean allowStatic, Class... paramTypes) { + this(returnType, findMethod(target, target, name, allowStatic, paramTypes)); + } + + public JavaMethod(Class target, Class returnType, String name, Class... paramTypes) { + this(target, returnType, name, false, paramTypes); + } + + public JavaMethod(Class returnType, Method method) { + this.returnType = returnType; + this.method = method; + method.setAccessible(true); + } + + private static Method findMethod(Class origTarget, Class target, String name, boolean allowStatic, Class[] paramTypes) { + for (Method method : target.getDeclaredMethods()) { + if (!allowStatic && Modifier.isStatic(method.getModifiers())) { + continue; + } + if (method.getName().equals(name) && Arrays.equals(method.getParameterTypes(), paramTypes)) { + return method; + } + } + + Class parent = target.getSuperclass(); + if (parent == null) { + throw new NoSuchMethodException(String.format("Could not find method %s(%s) on %s.", name, StringUtils.join(paramTypes, ", "), origTarget.getSimpleName())); + } else { + return findMethod(origTarget, parent, name, allowStatic, paramTypes); + } + } + + public boolean isStatic() { + return Modifier.isStatic(method.getModifiers()); + } + + public R invokeStatic(Object... args) { + return invoke(null, args); + } + + public R invoke(@Nullable T target, Object... args) { + try { + Object result = method.invoke(target, args); + return returnType.cast(result); + } catch (InvocationTargetException e) { + throw UncheckedException.throwAsUncheckedException(e.getCause()); + } catch (Exception e) { + throw new GradleException(String.format("Could not call %s.%s() on %s", method.getDeclaringClass().getSimpleName(), method.getName(), target), e); + } + } + + public Method getMethod() { + return method; + } + + public Class[] getParameterTypes(){ + return method.getParameterTypes(); + } + + @Override + public String toString() { + return method.toString(); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/base-services/org/gradle/internal/service/DefaultServiceMethodFactory.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/base-services/org/gradle/internal/service/DefaultServiceMethodFactory.java new file mode 100644 index 0000000..103a5b9 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/base-services/org/gradle/internal/service/DefaultServiceMethodFactory.java @@ -0,0 +1,42 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.internal.service; + +import java.lang.reflect.Method; + +import static org.gradle.internal.Cast.uncheckedNonnullCast; + +/** + * A service method factory that will try to use method handles if available, otherwise fallback on reflection. + */ +class DefaultServiceMethodFactory implements ServiceMethodFactory { + private final ServiceMethodFactory delegate = getOptimalServiceMethodFactory(); + + private ServiceMethodFactory getOptimalServiceMethodFactory() { + try { + return uncheckedNonnullCast( + Class.forName("org.gradle.internal.service.MethodHandleBasedServiceMethodFactory").getConstructor().newInstance() + ); + } catch (Exception e) { + return new ReflectionBasedServiceMethodFactory(); + } + } + + @Override + public ServiceMethod toServiceMethod(Method method) { + return delegate.toServiceMethod(method); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/base-services/org/gradle/util/internal/GUtil.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/base-services/org/gradle/util/internal/GUtil.java new file mode 100644 index 0000000..dab6a18 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/base-services/org/gradle/util/internal/GUtil.java @@ -0,0 +1,574 @@ +/* + * Copyright 2021 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.util.internal; + +import org.apache.commons.lang.StringUtils; +import org.gradle.api.Transformer; +import org.gradle.api.UncheckedIOException; +import org.gradle.api.specs.Spec; +import org.gradle.internal.Cast; +import org.gradle.internal.Factory; +import org.gradle.internal.IoActions; +import org.gradle.internal.UncheckedException; +import org.gradle.internal.io.StreamByteBuffer; + +import javax.annotation.Nullable; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.ObjectOutputStream; +import java.io.OutputStream; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.net.URLConnection; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Comparator; +import java.util.EnumSet; +import java.util.Formatter; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.concurrent.Callable; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import static java.util.Arrays.asList; +import static java.util.Collections.emptyList; + +public class GUtil { + private static final Pattern WORD_SEPARATOR = Pattern.compile("\\W+"); + private static final Pattern UPPER_LOWER = Pattern.compile("(?m)([A-Z]*)([a-z0-9]*)"); + + public static > T flatten(Object[] elements, T addTo, boolean flattenMaps) { + return flatten(asList(elements), addTo, flattenMaps); + } + + public static > T flatten(Object[] elements, T addTo) { + return flatten(asList(elements), addTo); + } + + public static > T flatten(Collection elements, T addTo) { + return flatten(elements, addTo, true); + } + + public static > T flattenElements(Object... elements) { + Collection out = new LinkedList(); + flatten(elements, out, true); + return Cast.uncheckedNonnullCast(out); + } + + public static > T flatten(Collection elements, T addTo, boolean flattenMapsAndArrays) { + return flatten(elements, addTo, flattenMapsAndArrays, flattenMapsAndArrays); + } + + public static > T flatten(Collection elements, T addTo, boolean flattenMaps, boolean flattenArrays) { + Iterator iter = elements.iterator(); + while (iter.hasNext()) { + Object element = iter.next(); + if (element instanceof Collection) { + flatten((Collection) element, addTo, flattenMaps, flattenArrays); + } else if ((element instanceof Map) && flattenMaps) { + flatten(((Map) element).values(), addTo, flattenMaps, flattenArrays); + } else if ((element.getClass().isArray()) && flattenArrays) { + flatten(asList((Object[]) element), addTo, flattenMaps, flattenArrays); + } else { + (Cast.>uncheckedNonnullCast(addTo)).add(element); + } + } + return addTo; + } + + /** + * Flattens input collections (including arrays *but* not maps). If input is not a collection wraps it in a collection and returns it. + * + * @param input any object + * @return collection of flattened input or single input wrapped in a collection. + */ + public static Collection collectionize(Object input) { + if (input == null) { + return emptyList(); + } else if (input instanceof Collection) { + Collection out = new LinkedList(); + flatten((Collection) input, out, false, true); + return out; + } else if (input.getClass().isArray()) { + Collection out = new LinkedList(); + flatten(asList((Object[]) input), out, false, true); + return out; + } else { + return asList(input); + } + } + + public static List flatten(Collection elements, boolean flattenMapsAndArrays) { + return flatten(elements, new ArrayList(), flattenMapsAndArrays); + } + + public static List flatten(Collection elements) { + return flatten(elements, new ArrayList()); + } + + public static String asPath(Iterable collection) { + return CollectionUtils.join(File.pathSeparator, collection); + } + + public static List prefix(String prefix, Collection strings) { + List prefixed = new ArrayList(); + for (String string : strings) { + prefixed.add(prefix + string); + } + return prefixed; + } + + public static boolean isTrue(@Nullable Object object) { + if (object == null) { + return false; + } + if (object instanceof Collection) { + return ((Collection) object).size() > 0; + } else if (object instanceof String) { + return ((String) object).length() > 0; + } + return true; + } + /** + * Prefer {@link #getOrDefault(Object, Factory)} if the value is expensive to compute or + * would trigger early configuration. + */ + @Nullable + public static T elvis(@Nullable T object, @Nullable T defaultValue) { + return isTrue(object) ? object : defaultValue; + } + + @Nullable + public static T getOrDefault(@Nullable T object, Factory defaultValueSupplier) { + return isTrue(object) ? object : defaultValueSupplier.create(); + } + + public static > T addToCollection(T dest, boolean failOnNull, Iterable src) { + for (V v : src) { + if (failOnNull && v == null) { + throw new IllegalArgumentException("Illegal null value provided in this collection: " + src); + } + dest.add(v); + } + return dest; + } + + public static > T addToCollection(T dest, Iterable src) { + return addToCollection(dest, false, src); + } + + @Deprecated + public static > T addToCollection(T dest, boolean failOnNull, Iterable... srcs) { + for (Iterable src : srcs) { + for (V v : src) { + if (failOnNull && v == null) { + throw new IllegalArgumentException("Illegal null value provided in this collection: " + src); + } + dest.add(v); + } + } + return dest; + } + + @Deprecated + public static > T addToCollection(T dest, Iterable... srcs) { + return addToCollection(dest, false, srcs); + } + + public static Comparator caseInsensitive() { + return new Comparator() { + @Override + public int compare(String o1, String o2) { + int diff = o1.compareToIgnoreCase(o2); + if (diff != 0) { + return diff; + } + return o1.compareTo(o2); + } + }; + } + + public static Map addMaps(Map map1, Map map2) { + HashMap map = new HashMap(); + map.putAll(map1); + map.putAll(map2); + return map; + } + + public static void addToMap(Map dest, Map src) { + for (Map.Entry entry : src.entrySet()) { + dest.put(entry.getKey().toString(), entry.getValue().toString()); + } + } + + public static Properties loadProperties(File propertyFile) { + try { + FileInputStream inputStream = new FileInputStream(propertyFile); + try { + return loadProperties(inputStream); + } finally { + inputStream.close(); + } + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + public static Properties loadProperties(URL url) { + try { + URLConnection uc = url.openConnection(); + uc.setUseCaches(false); + return loadProperties(uc.getInputStream()); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + public static Properties loadProperties(InputStream inputStream) { + Properties properties = new Properties(); + try { + properties.load(inputStream); + } catch (IOException e) { + throw new UncheckedIOException(e); + } finally { + IoActions.closeQuietly(inputStream); + } + return properties; + } + + public static void saveProperties(Properties properties, File propertyFile) { + try { + FileOutputStream propertiesFileOutputStream = new FileOutputStream(propertyFile); + try { + properties.store(propertiesFileOutputStream, null); + } finally { + propertiesFileOutputStream.close(); + } + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + public static void saveProperties(Properties properties, OutputStream outputStream) { + try { + try { + properties.store(outputStream, null); + } finally { + outputStream.close(); + } + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + public static Map map(Object... objects) { + Map map = new HashMap(); + assert objects.length % 2 == 0; + for (int i = 0; i < objects.length; i += 2) { + map.put(objects[i], objects[i + 1]); + } + return map; + } + + public static String toString(Iterable names) { + Formatter formatter = new Formatter(); + boolean first = true; + for (Object name : names) { + if (first) { + formatter.format("'%s'", name); + first = false; + } else { + formatter.format(", '%s'", name); + } + } + return formatter.toString(); + } + + /** + * Converts an arbitrary string to a camel-case string which can be used in a Java identifier. Eg, with_underscores -> withUnderscores + */ + public static String toCamelCase(CharSequence string) { + return toCamelCase(string, false); + } + + public static String toLowerCamelCase(CharSequence string) { + return toCamelCase(string, true); + } + + private static String toCamelCase(CharSequence string, boolean lower) { + if (string == null) { + return null; + } + StringBuilder builder = new StringBuilder(); + Matcher matcher = WORD_SEPARATOR.matcher(string); + int pos = 0; + boolean first = true; + while (matcher.find()) { + String chunk = string.subSequence(pos, matcher.start()).toString(); + pos = matcher.end(); + if (chunk.isEmpty()) { + continue; + } + if (lower && first) { + chunk = StringUtils.uncapitalize(chunk); + first = false; + } else { + chunk = StringUtils.capitalize(chunk); + } + builder.append(chunk); + } + String rest = string.subSequence(pos, string.length()).toString(); + if (lower && first) { + rest = StringUtils.uncapitalize(rest); + } else { + rest = StringUtils.capitalize(rest); + } + builder.append(rest); + return builder.toString(); + } + + /** + * Converts an arbitrary string to upper case identifier with words separated by _. Eg, camelCase -> CAMEL_CASE + */ + public static String toConstant(CharSequence string) { + if (string == null) { + return null; + } + return toWords(string, '_').toUpperCase(); + } + + /** + * Converts an arbitrary string to space-separated words. Eg, camelCase -> camel case, with_underscores -> with underscores + */ + public static String toWords(CharSequence string) { + return toWords(string, ' '); + } + + public static String toWords(CharSequence string, char separator) { + if (string == null) { + return null; + } + StringBuilder builder = new StringBuilder(); + int pos = 0; + Matcher matcher = UPPER_LOWER.matcher(string); + while (pos < string.length()) { + matcher.find(pos); + if (matcher.end() == pos) { + // Not looking at a match + pos++; + continue; + } + if (builder.length() > 0) { + builder.append(separator); + } + String group1 = matcher.group(1).toLowerCase(); + String group2 = matcher.group(2); + if (group2.length() == 0) { + builder.append(group1); + } else { + if (group1.length() > 1) { + builder.append(group1.substring(0, group1.length() - 1)); + builder.append(separator); + builder.append(group1.substring(group1.length() - 1)); + } else { + builder.append(group1); + } + builder.append(group2); + } + pos = matcher.end(); + } + + return builder.toString(); + } + + public static byte[] serialize(Object object) { + StreamByteBuffer buffer = new StreamByteBuffer(); + serialize(object, buffer.getOutputStream()); + return buffer.readAsByteArray(); + } + + public static void serialize(Object object, OutputStream outputStream) { + try { + ObjectOutputStream objectOutputStream = new ObjectOutputStream(outputStream); + objectOutputStream.writeObject(object); + objectOutputStream.close(); + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } + + public static Comparator last(final Comparator comparator, final T lastValue) { + return new Comparator() { + @Override + public int compare(T o1, T o2) { + boolean o1Last = comparator.compare(o1, lastValue) == 0; + boolean o2Last = comparator.compare(o2, lastValue) == 0; + if (o1Last && o2Last) { + return 0; + } + if (o1Last && !o2Last) { + return 1; + } + if (!o1Last && o2Last) { + return -1; + } + return comparator.compare(o1, o2); + } + }; + } + + /** + * Calls the given callable converting any thrown exception to an unchecked exception via {@link UncheckedException#throwAsUncheckedException(Throwable)} + * + * @param callable The callable to call + * @param Callable's return type + * @return The value returned by {@link Callable#call()} + */ + @Nullable + public static T uncheckedCall(Callable callable) { + try { + return callable.call(); + } catch (Exception e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + + public static > T toEnum(Class enumType, Object value) { + if (enumType.isInstance(value)) { + return enumType.cast(value); + } + if (value instanceof CharSequence) { + final String literal = value.toString(); + T match = findEnumValue(enumType, literal); + if (match != null) { + return match; + } + + final String alternativeLiteral = toWords(literal, '_'); + match = findEnumValue(enumType, alternativeLiteral); + if (match != null) { + return match; + } + + throw new IllegalArgumentException( + String.format("Cannot convert string value '%s' to an enum value of type '%s' (valid case insensitive values: %s)", + literal, enumType.getName(), CollectionUtils.join(", ", CollectionUtils.collect(Arrays.asList(enumType.getEnumConstants()), new Transformer() { + @Override + public String transform(T t) { + return t.name(); + } + })) + ) + ); + } + throw new IllegalArgumentException(String.format("Cannot convert value '%s' of type '%s' to enum type '%s'", + value, value.getClass().getName(), enumType.getName())); + } + + @Nullable + private static > T findEnumValue(Class enumType, final String literal) { + List enumConstants = Arrays.asList(enumType.getEnumConstants()); + return CollectionUtils.findFirst(enumConstants, new Spec() { + @Override + public boolean isSatisfiedBy(T enumValue) { + return enumValue.name().equalsIgnoreCase(literal); + } + }); + } + + public static > EnumSet toEnumSet(Class enumType, Object[] values) { + return toEnumSet(enumType, Arrays.asList(values)); + } + + public static > EnumSet toEnumSet(Class enumType, Iterable values) { + EnumSet result = EnumSet.noneOf(enumType); + for (Object value : values) { + result.add(toEnum(enumType, value)); + } + return result; + } + + /** + * Checks whether the fist {@link CharSequence} ends with the second. + * + * If the {@link CharSequence#charAt(int)} method of both sequences is fast, + * this check is faster than converting them to Strings and using {@link String#endsWith(String)}. + */ + public static boolean endsWith(CharSequence longer, CharSequence shorter) { + if (longer instanceof String && shorter instanceof String) { + return ((String) longer).endsWith((String) shorter); + } + int longerLength = longer.length(); + int shorterLength = shorter.length(); + if (longerLength < shorterLength) { + return false; + } + for (int i = shorterLength; i > 0; i--) { + if (longer.charAt(longerLength - i) != shorter.charAt(shorterLength - i)) { + return false; + } + } + return true; + } + + public static URI toSecureUrl(URI scriptUri) { + try { + return new URI("https", null, scriptUri.getHost(), scriptUri.getPort(), scriptUri.getPath(), scriptUri.getQuery(), scriptUri.getFragment()); + } catch (URISyntaxException e) { + throw new IllegalArgumentException("could not make url use https", e); + } + } + + public static boolean isSecureUrl(URI url) { + /* + * TL;DR: http://127.0.0.1 will bypass this validation, http://localhost will fail this validation. + * + * Hundreds of Gradle's integration tests use a local web-server to test logic that relies upon + * this behavior. + * + * Changing all of those tests so that they use a KeyStore would have been impractical. + * Instead, the test fixture was updated to use 127.0.0.1 when making HTTP requests. + * + * This allows tests that still want to exercise the deprecation logic to use http://localhost + * which will bypass this check and trigger the validation. + * + * It's important to note that the only way to create a certificate for an IP address is to bind + * the IP address as a 'Subject Alternative Name' which was deemed far too complicated for our test + * use case. + * + * Additionally, in the rare case that a user or a plugin author truly needs to test with a localhost + * server, they can use http://127.0.0.1 + */ + if ("127.0.0.1".equals(url.getHost())) { + return true; + } + + final String scheme = url.getScheme(); + return !"http".equalsIgnoreCase(scheme); + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/build-events/org/gradle/internal/build/event/types/AbstractResult.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/build-events/org/gradle/internal/build/event/types/AbstractResult.java new file mode 100644 index 0000000..12d970a --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/build-events/org/gradle/internal/build/event/types/AbstractResult.java @@ -0,0 +1,48 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.internal.build.event.types; + +import java.io.Serializable; +import java.util.Collections; +import java.util.List; + +public abstract class AbstractResult implements Serializable { + private final long startTime; + private final long endTime; + private final String outcomeDescription; + + public AbstractResult(long startTime, long endTime, String outcomeDescription) { + this.startTime = startTime; + this.endTime = endTime; + this.outcomeDescription = outcomeDescription; + } + + public long getStartTime() { + return startTime; + } + + public long getEndTime() { + return endTime; + } + + public String getOutcomeDescription() { + return outcomeDescription; + } + + public List getFailures() { + return Collections.emptyList(); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/build-init/org/gradle/buildinit/plugins/internal/JvmLibraryProjectInitDescriptor.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/build-init/org/gradle/buildinit/plugins/internal/JvmLibraryProjectInitDescriptor.java new file mode 100644 index 0000000..f55ebb8 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/build-init/org/gradle/buildinit/plugins/internal/JvmLibraryProjectInitDescriptor.java @@ -0,0 +1,80 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.buildinit.plugins.internal; + +import org.gradle.api.internal.DocumentationRegistry; +import org.gradle.buildinit.plugins.internal.model.Description; +import org.gradle.buildinit.plugins.internal.modifiers.ComponentType; + +import java.util.List; + +public class JvmLibraryProjectInitDescriptor extends JvmProjectInitDescriptor { + + private final TemplateLibraryVersionProvider libraryVersionProvider; + + public JvmLibraryProjectInitDescriptor(Description description, TemplateLibraryVersionProvider libraryVersionProvider, DocumentationRegistry documentationRegistry) { + super(description, libraryVersionProvider, documentationRegistry); + this.libraryVersionProvider = libraryVersionProvider; + } + + @Override + public ComponentType getComponentType() { + return ComponentType.LIBRARY; + } + + @Override + public void generateProjectBuildScript(String projectName, InitSettings settings, BuildScriptBuilder buildScriptBuilder) { + super.generateProjectBuildScript(projectName, settings, buildScriptBuilder); + + applyLibraryPlugin(buildScriptBuilder); + buildScriptBuilder.dependency( + "api", + "This dependency is exported to consumers, that is to say found on their compile classpath.", + "org.apache.commons:commons-math3:" + libraryVersionProvider.getVersion("commons-math")); + buildScriptBuilder.implementationDependency("This dependency is used internally, and not exposed to consumers on their own compile classpath.", + "com.google.guava:guava:" + libraryVersionProvider.getVersion("guava")); + } + + @Override + protected void sourceTemplates(String subproject, InitSettings settings, TemplateFactory templateFactory, List templates) { + templates.add("Library"); + } + + @Override + protected void testSourceTemplates(String subproject, InitSettings settings, TemplateFactory templateFactory, List templates) { + switch (settings.getTestFramework()) { + case SPOCK: + templates.add("groovy/LibraryTest"); + break; + case TESTNG: + templates.add("testng/LibraryTest"); + break; + case JUNIT: + case KOTLINTEST: + templates.add("LibraryTest"); + break; + case JUNIT_JUPITER: + templates.add("junitjupiter/LibraryTest"); + break; + case SCALATEST: + templates.add("LibrarySuite"); + break; + default: + throw new IllegalArgumentException(); + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/build-init/org/gradle/buildinit/plugins/internal/LanguageSpecificProjectGenerator.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/build-init/org/gradle/buildinit/plugins/internal/LanguageSpecificProjectGenerator.java new file mode 100644 index 0000000..c212749 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/build-init/org/gradle/buildinit/plugins/internal/LanguageSpecificProjectGenerator.java @@ -0,0 +1,49 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.buildinit.plugins.internal; + +import org.gradle.buildinit.plugins.internal.modifiers.BuildInitTestFramework; +import org.gradle.buildinit.plugins.internal.modifiers.ComponentType; +import org.gradle.buildinit.plugins.internal.modifiers.Language; +import org.gradle.buildinit.plugins.internal.modifiers.ModularizationOption; + +import java.util.Optional; +import java.util.Set; + +public interface LanguageSpecificProjectGenerator { + String getId(); + + ComponentType getComponentType(); + + Language getLanguage(); + + Set getModularizationOptions(); + + Optional getFurtherReading(InitSettings settings); + + Set getTestFrameworks(); + + BuildInitTestFramework getDefaultTestFramework(); + + boolean supportsPackage(); + + void generateProjectBuildScript(String projectName, InitSettings settings, BuildScriptBuilder buildScriptBuilder); + + void generateConventionPluginBuildScript(String conventionPluginName, InitSettings settings, BuildScriptBuilder buildScriptBuilder); + + void generateSources(InitSettings settings, TemplateFactory templateFactory); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/build-init/org/gradle/buildinit/plugins/internal/ProjectGenerator.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/build-init/org/gradle/buildinit/plugins/internal/ProjectGenerator.java new file mode 100644 index 0000000..ecc4236 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/build-init/org/gradle/buildinit/plugins/internal/ProjectGenerator.java @@ -0,0 +1,58 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.buildinit.plugins.internal; + +import org.gradle.buildinit.plugins.internal.modifiers.BuildInitDsl; +import org.gradle.buildinit.plugins.internal.modifiers.BuildInitTestFramework; +import org.gradle.buildinit.plugins.internal.modifiers.ComponentType; +import org.gradle.buildinit.plugins.internal.modifiers.Language; +import org.gradle.buildinit.plugins.internal.modifiers.ModularizationOption; + +import java.util.Optional; +import java.util.Set; + +/** + * Creates a new Gradle project + */ +public interface ProjectGenerator extends BuildContentGenerator { + String getId(); + + ComponentType getComponentType(); + + Language getLanguage(); + + Set getModularizationOptions(); + + Optional getFurtherReading(InitSettings settings); + + /** + * Does a source package name make sense for this type of project? + */ + boolean supportsPackage(); + + BuildInitDsl getDefaultDsl(); + + /** + * Returns the set of test frameworks supported for this type of project. + */ + Set getTestFrameworks(); + + /** + * Returns {@link BuildInitTestFramework#NONE} when no tests generated by default. + */ + BuildInitTestFramework getDefaultTestFramework(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/build-init/org/gradle/buildinit/plugins/internal/modifiers/ModularizationOption.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/build-init/org/gradle/buildinit/plugins/internal/modifiers/ModularizationOption.java new file mode 100644 index 0000000..3e8586a --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/build-init/org/gradle/buildinit/plugins/internal/modifiers/ModularizationOption.java @@ -0,0 +1,58 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.buildinit.plugins.internal.modifiers; + +import java.util.ArrayList; +import java.util.List; + +public enum ModularizationOption implements WithIdentifier { + SINGLE_PROJECT("no - only one application project"), + WITH_LIBRARY_PROJECTS("yes - application and library projects"); + + public static ModularizationOption byId(String id) { + for (ModularizationOption option : values()) { + if (option.getId().equals(id)) { + return option; + } + } + return SINGLE_PROJECT; + } + + public static List listSupported() { + List result = new ArrayList<>(); + for (ModularizationOption option : values()) { + result.add(option.getId()); + } + return result; + } + + private final String displayName; + + ModularizationOption(String displayName) { + this.displayName = displayName; + } + + @Override + public String getId() { + return Names.idFor(this); + } + + @Override + public String toString() { + return displayName; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/build-option/org/gradle/internal/buildoption/EnumBuildOption.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/build-option/org/gradle/internal/buildoption/EnumBuildOption.java new file mode 100644 index 0000000..9772b27 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/build-option/org/gradle/internal/buildoption/EnumBuildOption.java @@ -0,0 +1,101 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.buildoption; + +import org.gradle.cli.CommandLineParser; +import org.gradle.cli.ParsedCommandLine; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * A build option that takes a string value e.g. {@code "--max-workers=4"}. + * + * @since 4.3 + */ +public abstract class EnumBuildOption, T> extends AbstractBuildOption { + + private final String displayName; + private final Class enumClass; + private final List possibleValues; + + public EnumBuildOption(String displayName, Class enumClass, E[] possibleValues, String gradleProperty, CommandLineOptionConfiguration... commandLineOptionConfigurations) { + super(gradleProperty, commandLineOptionConfigurations); + this.displayName = displayName; + this.enumClass = enumClass; + this.possibleValues = Collections.unmodifiableList(Arrays.asList(possibleValues)); + } + + @Override + public void applyFromProperty(Map properties, T settings) { + String value = properties.get(gradleProperty); + + if (value != null) { + applyTo(value, settings, Origin.forGradleProperty(gradleProperty)); + } + } + + @Override + public void configure(CommandLineParser parser) { + for (CommandLineOptionConfiguration config : commandLineOptionConfigurations) { + configureCommandLineOption(parser, config.getAllOptions(), config.getDescription(), config.isDeprecated(), config.isIncubating()).hasArgument(); + } + } + + @Override + public void applyFromCommandLine(ParsedCommandLine options, T settings) { + for (CommandLineOptionConfiguration config : commandLineOptionConfigurations) { + if (options.hasOption(config.getLongOption())) { + String value = options.option(config.getLongOption()).getValue(); + applyTo(value, settings, Origin.forCommandLine(config.getLongOption())); + } + } + } + + private void applyTo(String value, T settings, Origin origin) { + applyTo(getValue(value), settings, origin); + } + + private E getValue(String value) { + E enumValue = null; + if (value != null) { + enumValue = tryGetValue(value); + if (enumValue == null) { + enumValue = tryGetValue(value.toLowerCase()); + } + if (enumValue == null) { + enumValue = tryGetValue(value.toUpperCase()); + } + } + if (enumValue == null) { + throw new RuntimeException("Option " + displayName + " doesn't accept value '" + value + "'. Possible values are " + possibleValues); + } + return enumValue; + } + + private E tryGetValue(String value) { + try { + return Enum.valueOf(enumClass, value); + } catch (IllegalArgumentException e) { + return null; + } + } + + public abstract void applyTo(E value, T settings, Origin origin); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/configuration-cache/org/gradle/configurationcache/build/NoOpBuildModelController.kt b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/configuration-cache/org/gradle/configurationcache/build/NoOpBuildModelController.kt new file mode 100644 index 0000000..b70e8b7 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/configuration-cache/org/gradle/configurationcache/build/NoOpBuildModelController.kt @@ -0,0 +1,38 @@ +/* + * Copyright 2021 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.configurationcache.build + +import org.gradle.api.internal.GradleInternal +import org.gradle.internal.build.BuildModelController + + +// The model for this build is already fully populated and the tasks scheduled when it is created, so this controller does not need to do anything +class NoOpBuildModelController(val gradle: GradleInternal) : BuildModelController { + // TODO - this method should fail, as the fully configured settings object is not actually available + override fun getLoadedSettings() = gradle.settings + + // TODO - this method should fail, as the fully configured build model is not actually available + override fun getConfiguredModel() = gradle + + override fun prepareToScheduleTasks() { + // Already done + } + + override fun scheduleRequestedTasks() { + // Already done + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/UnknownDomainObjectException.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/UnknownDomainObjectException.java new file mode 100644 index 0000000..a77372a --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/UnknownDomainObjectException.java @@ -0,0 +1,30 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api; + +/** + *

A {@code UnknownDomainObjectException} is the super class of all exceptions thrown when a given domain object + * cannot be located.

+ */ +public class UnknownDomainObjectException extends GradleException { + public UnknownDomainObjectException(String message) { + super(message); + } + + public UnknownDomainObjectException(String message, Throwable cause) { + super(message, cause); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/artifacts/ArtifactCollection.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/artifacts/ArtifactCollection.java new file mode 100644 index 0000000..accf965 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/artifacts/ArtifactCollection.java @@ -0,0 +1,54 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.artifacts; + +import org.gradle.api.artifacts.result.ResolvedArtifactResult; +import org.gradle.api.file.FileCollection; + +import java.util.Collection; +import java.util.Set; + +/** + * A collection of artifacts resolved for a configuration. The configuration is resolved on demand when + * the collection is queried. + * + * @since 3.4 + */ +public interface ArtifactCollection extends Iterable { + /** + * A file collection containing the files for all artifacts in this collection. + * This is primarily useful to wire this artifact collection as a task input. + */ + FileCollection getArtifactFiles(); + + /** + * Returns the resolved artifacts, performing the resolution if required. + * This will resolve the artifact metadata and download the artifact files as required. + * + * @throws ResolveException On failure to resolve or download any artifact. + */ + Set getArtifacts(); + + /** + * Returns any failures to resolve the artifacts for this collection. + * + * @since 4.0 + * + * @return A collection of exceptions, one for each failure in resolution. + */ + Collection getFailures(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/artifacts/ExcludeRuleContainer.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/artifacts/ExcludeRuleContainer.java new file mode 100644 index 0000000..aef1b20 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/artifacts/ExcludeRuleContainer.java @@ -0,0 +1,43 @@ +/* + * Copyright 2007-2008 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.artifacts; + +import java.util.Map; +import java.util.Set; + +/** + *

A container for adding exclude rules for dependencies.

+ */ +public interface ExcludeRuleContainer { + /** + * Returns all the exclude rules added to this container. If no exclude rules has been added an empty list is + * returned. + */ + Set getRules(); + + /** + * Adds an exclude rule to this container. The ExcludeRule object gets created internally based on the map values + * passed to this method. The possible keys for the map are: + * + *
    + *
  • group - The exact name of the organization or group that should be excluded. + *
  • module - The exact name of the module that should be excluded + *
+ * + * @param args A map describing the exclude pattern. + */ + void add(Map args); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/artifacts/UnknownRepositoryException.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/artifacts/UnknownRepositoryException.java new file mode 100644 index 0000000..120b6bc --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/artifacts/UnknownRepositoryException.java @@ -0,0 +1,27 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.artifacts; + +import org.gradle.api.UnknownDomainObjectException; + +/** + * An {@code UnknownRepositoryException} is thrown when a repository referenced by name cannot be found. + */ +public class UnknownRepositoryException extends UnknownDomainObjectException { + public UnknownRepositoryException(String message) { + super(message); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/artifacts/maven/package-info.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/artifacts/maven/package-info.java new file mode 100644 index 0000000..2e0f700 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/artifacts/maven/package-info.java @@ -0,0 +1,21 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Classes for declaring and using Maven modules. + */ +@org.gradle.api.NonNullApi +package org.gradle.api.artifacts.maven; diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/artifacts/type/package-info.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/artifacts/type/package-info.java new file mode 100644 index 0000000..ecfac8e --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/artifacts/type/package-info.java @@ -0,0 +1,23 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Types related to artifact type definitions. + * + * @since 4.0 + */ +@org.gradle.api.NonNullApi +package org.gradle.api.artifacts.type; diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/attributes/DisambiguationRuleChain.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/attributes/DisambiguationRuleChain.java new file mode 100644 index 0000000..1ade96f --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/attributes/DisambiguationRuleChain.java @@ -0,0 +1,83 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.attributes; + +import org.gradle.api.Action; +import org.gradle.api.ActionConfiguration; +import org.gradle.internal.HasInternalProtocol; + +import java.util.Comparator; + +/** + *

A chain of disambiguation rules. By default the chain is empty and will not do any disambiguation.

+ * + *

For a given set of rules, the execution is done in order, and interrupts as soon as a rule + * selected at least one candidate (through {@link MultipleCandidatesDetails#closestMatch(Object)}). + *

+ * + *

If the end of the rule chain is reached and that no rule selected a candidate then the candidate list is returned + * unmodified, meaning we still have an ambiguous match.

+ * + * @param the concrete type of the attribute + */ +@HasInternalProtocol +public interface DisambiguationRuleChain { + + /** + *

Adds an arbitrary disambiguation rule to the chain.

+ *

A disambiguation rule can select the best match from a list of candidates.

+ * + *

A rule can express an preference by calling the @{link {@link MultipleCandidatesDetails#closestMatch(Object)} + * method to tell that a candidate is the best one.

+ * + *

It is not mandatory for a rule to choose, and it is not an error to select multiple candidates.

+ * + * @param rule the rule to add + * @since 4.0 + */ + void add(Class> rule); + + /** + *

Adds an arbitrary disambiguation rule to the chain, possibly configuring the rule as well.

+ * + * @param rule the rule to add + * @param configureAction the action to use to configure the rule + * @since 4.0 + */ + void add(Class> rule, Action configureAction); + + /** + * Adds an ordered disambiguation rule. Values will be compared using the + * provided comparator, and the rule will automatically select the first + * value (if multiple candidates have the same attribute value, there will + * still be an ambiguity). + * + * @param comparator the comparator to use + */ + void pickFirst(Comparator comparator); + + /** + * Adds an ordered disambiguation rule. Values will be compared using the + * provided comparator, and the rule will automatically select the last + * value (if multiple candidates have the same attribute value, there will + * still be an ambiguity). + * + * @param comparator the comparator to use + */ + void pickLast(Comparator comparator); + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/capabilities/MutableCapabilitiesMetadata.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/capabilities/MutableCapabilitiesMetadata.java new file mode 100644 index 0000000..20e979f --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/capabilities/MutableCapabilitiesMetadata.java @@ -0,0 +1,49 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.capabilities; + +/** + * Describes the capabilities of a component in a mutable way. + * This interface can be used to adjust the capabilities of a published component via + * metadata rules (see {@link org.gradle.api.artifacts.dsl.ComponentMetadataHandler}. + * + * @since 4.7 + */ +public interface MutableCapabilitiesMetadata extends CapabilitiesMetadata { + + /** + * Adds a new capability. If a capability of the same (group, name) is found with a different + * version, an error will be thrown. + * + * @param group the group of the capability + * @param name the name of the capability + * @param version the version of the capability + */ + void addCapability(String group, String name, String version); + + /** + * Removes a capability. + * @param group the group of the capability + * @param name the name of the capability + */ + void removeCapability(String group, String name); + + /** + * Returns an immutable vew of the capabilities. + * @return an immutable view of the capabilities + */ + CapabilitiesMetadata asImmutable(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/component/Component.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/component/Component.java new file mode 100644 index 0000000..5032fd5 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/component/Component.java @@ -0,0 +1,24 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.component; + +/** + * A software component that can be queried via the Artifact Query API. + * + * @since 2.0 + */ +public interface Component { +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/file/FileVisitDetails.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/file/FileVisitDetails.java new file mode 100644 index 0000000..cfc6fea --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/file/FileVisitDetails.java @@ -0,0 +1,29 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.file; + +/** + * Provides access to details about a file or directory being visited by a {@link FileVisitor}. + * + * @see FileTree#visit(groovy.lang.Closure) + */ +public interface FileVisitDetails extends FileTreeElement { + + /** + * Requests that file visiting terminate after the current file. + */ + void stopVisiting(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/services/BuildServiceRegistration.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/services/BuildServiceRegistration.java new file mode 100644 index 0000000..9341df1 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/api/services/BuildServiceRegistration.java @@ -0,0 +1,48 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.services; + +import org.gradle.api.Incubating; +import org.gradle.api.Named; +import org.gradle.api.provider.Property; +import org.gradle.api.provider.Provider; + +/** + * Details of a build service. + * + * @param the service type. + * @param

the service parameters type. + * @since 6.1 + */ +@Incubating +public interface BuildServiceRegistration, P extends BuildServiceParameters> extends Named { + /** + * Returns the parameters that will be used to instantiate the service with. + */ + P getParameters(); + + /** + * Specifies the maximum number of tasks that can use this service in parallel. Setting this to 1 means that the service will be used by a single task at a time. + * When this property has no value defined, then any number of tasks may use this service iin parallel. This is the default. + */ + Property getMaxParallelUsages(); + + /** + * Returns a {@link Provider} that will create the service instance when its value is queried. + */ + Provider getService(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/caching/MapBasedBuildCacheService.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/caching/MapBasedBuildCacheService.java new file mode 100644 index 0000000..a7fa833 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/caching/MapBasedBuildCacheService.java @@ -0,0 +1,66 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.caching; + +import org.gradle.internal.io.StreamByteBuffer; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.util.concurrent.ConcurrentMap; + +/** + * Simple build cache implementation that delegates to a {@link ConcurrentMap}. + * + * @since 3.5 + */ +public class MapBasedBuildCacheService implements BuildCacheService { + private final ConcurrentMap delegate; + + public MapBasedBuildCacheService(ConcurrentMap delegate) { + this.delegate = delegate; + } + + @Override + public boolean load(BuildCacheKey key, BuildCacheEntryReader reader) throws BuildCacheException { + final byte[] bytes = delegate.get(key.getHashCode()); + if (bytes == null) { + return false; + } + try { + reader.readFrom(new ByteArrayInputStream(bytes)); + } catch (IOException e) { + throw new BuildCacheException("loading " + key, e); + } + return true; + } + + @Override + public void store(BuildCacheKey key, BuildCacheEntryWriter output) throws BuildCacheException { + StreamByteBuffer buffer = new StreamByteBuffer(); + try { + output.writeTo(buffer.getOutputStream()); + } catch (IOException e) { + throw new BuildCacheException("storing " + key, e); + } + delegate.put(key.getHashCode(), buffer.readAsByteArray()); + } + + @Override + public void close() throws IOException { + // Do nothing + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/caching/package-info.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/caching/package-info.java new file mode 100644 index 0000000..4e6d16f --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core-api/org/gradle/caching/package-info.java @@ -0,0 +1,25 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Classes for build caches. + * + * @since 3.3 + */ +@NonNullApi +package org.gradle.caching; + +import org.gradle.api.NonNullApi; diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/artifacts/ModuleVersionSelectorStrictSpec.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/artifacts/ModuleVersionSelectorStrictSpec.java new file mode 100644 index 0000000..b726a83 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/artifacts/ModuleVersionSelectorStrictSpec.java @@ -0,0 +1,38 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts; + +import org.gradle.api.artifacts.ModuleVersionIdentifier; +import org.gradle.api.artifacts.ModuleVersionSelector; +import org.gradle.api.specs.Spec; + +public class ModuleVersionSelectorStrictSpec implements Spec { + + private final ModuleVersionSelector selector; + + public ModuleVersionSelectorStrictSpec(ModuleVersionSelector selector) { + assert selector != null; + this.selector = selector; + } + + @Override + public boolean isSatisfiedBy(ModuleVersionIdentifier candidate) { + return candidate.getName().equals(selector.getName()) + && candidate.getGroup().equals(selector.getGroup()) + && candidate.getVersion().equals(selector.getVersion()); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/artifacts/configurations/ResolveConfigurationDependenciesBuildOperationType.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/artifacts/configurations/ResolveConfigurationDependenciesBuildOperationType.java new file mode 100644 index 0000000..f50443f --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/artifacts/configurations/ResolveConfigurationDependenciesBuildOperationType.java @@ -0,0 +1,116 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.configurations; + +import org.gradle.api.artifacts.result.ResolvedComponentResult; +import org.gradle.api.attributes.AttributeContainer; +import org.gradle.internal.operations.BuildOperationType; +import org.gradle.internal.scan.UsedByScanPlugin; + +import javax.annotation.Nullable; +import java.util.List; +import java.util.Map; + +/** + * Resolution of a configuration's dependencies. + * + * @since 4.4 + */ +public final class ResolveConfigurationDependenciesBuildOperationType implements BuildOperationType { + + @UsedByScanPlugin + public interface Details { + + String getConfigurationName(); + + @Nullable + String getProjectPath(); + + boolean isScriptConfiguration(); + + @Nullable + String getConfigurationDescription(); + + String getBuildPath(); + + boolean isConfigurationVisible(); + + boolean isConfigurationTransitive(); + + /** + * @since 4.10 + */ + @Nullable + List getRepositories(); + + } + + @UsedByScanPlugin + public interface Result { + + ResolvedComponentResult getRootComponent(); + + /** + * If the component was resolved from a repository, its {@link Repository#getId()}. + */ + @Nullable + String getRepositoryId(ResolvedComponentResult resolvedComponentResult); + + /** + * Which attributes the resolved configuration was requested with, if any. + * @since 5.6 + */ + AttributeContainer getRequestedAttributes(); + } + + /** + * A description of a repository potentially used in the resolution. + * + * Effectively maps to a RepositoryDescriptor. + */ + @UsedByScanPlugin + public interface Repository { + + /** + * A unique identifier for this repository, used for associating resolved components to their source repository. + */ + String getId(); + + /** + * The type of repository. + * + * Then name of one of RepositoryDescriptor.Type. + */ + String getType(); + + /** + * The name of this repository. + */ + String getName(); + + /** + * The properties of the repository. + * + * See RepositoryDescriptor.getProperties() and the specific properties used by the subtypes. + * The properties sent, their names and types, should be kept stable. + * Ordered by key lexicographically. + */ + Map getProperties(); + + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/artifacts/dsl/dependencies/ProjectFinder.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/artifacts/dsl/dependencies/ProjectFinder.java new file mode 100644 index 0000000..3e7c773 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/artifacts/dsl/dependencies/ProjectFinder.java @@ -0,0 +1,28 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.dsl.dependencies; + +import org.gradle.api.internal.project.ProjectInternal; + +public interface ProjectFinder { + /** + * Locates the project with the provided path, failing if not found. + * + * @param path Can be relative or absolute + * @return The project belonging to the path, never null. + */ + ProjectInternal getProject(String path); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/collections/IndexedElementSource.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/collections/IndexedElementSource.java new file mode 100644 index 0000000..64bad4a --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/collections/IndexedElementSource.java @@ -0,0 +1,40 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.collections; + +import java.util.List; +import java.util.ListIterator; + +public interface IndexedElementSource extends ElementSource { + void add(int index, T element); + + T get(int index); + + T set(int index, T element); + + T remove(int index); + + int indexOf(Object o); + + int lastIndexOf(Object o); + + ListIterator listIterator(); + + ListIterator listIterator(int index); + + List subList(int fromIndex, int toIndex); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/collections/PendingSource.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/collections/PendingSource.java new file mode 100644 index 0000000..8865315 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/collections/PendingSource.java @@ -0,0 +1,45 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.collections; + +import org.gradle.api.Action; +import org.gradle.api.internal.provider.CollectionProviderInternal; +import org.gradle.api.internal.provider.ProviderInternal; + +public interface PendingSource { + void realizePending(); + + void realizePending(Class type); + + boolean addPending(ProviderInternal provider); + + boolean removePending(ProviderInternal provider); + + boolean addPendingCollection(CollectionProviderInternal> provider); + + boolean removePendingCollection(CollectionProviderInternal> provider); + + void realizeExternal(ProviderInternal provider); + + void onRealize(Action action); + + boolean isEmpty(); + + int size(); + + void clear(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/model/InstantiatorBackedObjectFactory.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/model/InstantiatorBackedObjectFactory.java new file mode 100644 index 0000000..9244655 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/model/InstantiatorBackedObjectFactory.java @@ -0,0 +1,135 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.model; + +import org.gradle.api.DomainObjectSet; +import org.gradle.api.ExtensiblePolymorphicDomainObjectContainer; +import org.gradle.api.Named; +import org.gradle.api.NamedDomainObjectContainer; +import org.gradle.api.NamedDomainObjectFactory; +import org.gradle.api.NamedDomainObjectList; +import org.gradle.api.NamedDomainObjectSet; +import org.gradle.api.file.ConfigurableFileCollection; +import org.gradle.api.file.ConfigurableFileTree; +import org.gradle.api.file.DirectoryProperty; +import org.gradle.api.file.RegularFileProperty; +import org.gradle.api.file.SourceDirectorySet; +import org.gradle.api.internal.provider.DefaultProperty; +import org.gradle.api.internal.provider.PropertyHost; +import org.gradle.api.model.ObjectFactory; +import org.gradle.api.provider.ListProperty; +import org.gradle.api.provider.MapProperty; +import org.gradle.api.provider.Property; +import org.gradle.api.provider.SetProperty; +import org.gradle.api.reflect.ObjectInstantiationException; +import org.gradle.internal.reflect.Instantiator; + +public class InstantiatorBackedObjectFactory implements ObjectFactory { + private final Instantiator instantiator; + + public InstantiatorBackedObjectFactory(Instantiator instantiator) { + this.instantiator = instantiator; + } + + @Override + public T named(Class type, String name) throws ObjectInstantiationException { + throw new UnsupportedOperationException("This ObjectFactory implementation does not support constructing named objects"); + } + + @Override + public SourceDirectorySet sourceDirectorySet(String name, String displayName) { + throw new UnsupportedOperationException("This ObjectFactory implementation does not support constructing source directory sets"); + } + + @Override + public ConfigurableFileCollection fileCollection() { + throw new UnsupportedOperationException("This ObjectFactory implementation does not support constructing file collections"); + } + + @Override + public ConfigurableFileTree fileTree() { + throw new UnsupportedOperationException("This ObjectFactory implementation does not support constructing file trees"); + } + + @Override + public NamedDomainObjectContainer domainObjectContainer(Class elementType) { + throw new UnsupportedOperationException("This ObjectFactory implementation does not support constructing named domain object containers"); + } + + @Override + public NamedDomainObjectContainer domainObjectContainer(Class elementType, NamedDomainObjectFactory factory) { + throw new UnsupportedOperationException("This ObjectFactory implementation does not support constructing named domain object containers"); + } + + @Override + public ExtensiblePolymorphicDomainObjectContainer polymorphicDomainObjectContainer(Class elementType) { + throw new UnsupportedOperationException("This ObjectFactory implementation does not support constructing named domain object containers"); + } + + @Override + public DomainObjectSet domainObjectSet(Class elementType) { + throw new UnsupportedOperationException("This ObjectFactory implementation does not support constructing domain object sets"); + } + + @Override + public NamedDomainObjectSet namedDomainObjectSet(Class elementType) { + throw new UnsupportedOperationException("This ObjectFactory implementation does not support constructing named domain object sets"); + } + + @Override + public NamedDomainObjectList namedDomainObjectList(Class elementType) { + throw new UnsupportedOperationException("This ObjectFactory implementation does not support constructing named domain object lists"); + } + + @Override + public Property property(Class valueType) { + return new DefaultProperty<>(PropertyHost.NO_OP, valueType); + } + + @Override + public ListProperty listProperty(Class elementType) { + return broken(); + } + + @Override + public SetProperty setProperty(Class elementType) { + return broken(); + } + + @Override + public MapProperty mapProperty(Class keyType, Class valueType) { + return broken(); + } + + @Override + public DirectoryProperty directoryProperty() { + return broken(); + } + + @Override + public RegularFileProperty fileProperty() { + return broken(); + } + + private T broken() { + throw new UnsupportedOperationException("This ObjectFactory implementation does not support constructing property objects"); + } + + @Override + public T newInstance(Class type, Object... parameters) throws ObjectInstantiationException { + return instantiator.newInstance(type, parameters); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/resources/StringBackedTextResource.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/resources/StringBackedTextResource.java new file mode 100644 index 0000000..637c306 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/resources/StringBackedTextResource.java @@ -0,0 +1,91 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.resources; + +import com.google.common.io.Files; +import org.gradle.api.file.FileCollection; +import org.gradle.api.internal.file.temp.TemporaryFileProvider; +import org.gradle.api.internal.tasks.TaskDependencyInternal; +import org.gradle.api.resources.ResourceException; +import org.gradle.api.resources.internal.TextResourceInternal; +import org.gradle.api.tasks.TaskDependency; + +import java.io.File; +import java.io.IOException; +import java.io.Reader; +import java.io.StringReader; +import java.nio.charset.Charset; + +public class StringBackedTextResource implements TextResourceInternal { + private final TemporaryFileProvider tempFileProvider; + private final String string; + + public StringBackedTextResource(TemporaryFileProvider tempFileProvider, String string) { + this.tempFileProvider = tempFileProvider; + this.string = string; + } + + @Override + public String getDisplayName() { + return "text resource"; + } + + @Override + public String toString() { + return getDisplayName(); + } + + @Override + public String asString() { + return string; + } + + @Override + public Reader asReader() { + return new StringReader(string); + } + + @Override + public File asFile(String charset) { + File file = tempFileProvider.createTemporaryFile("string", ".txt", "resource"); + try { + Files.asCharSink(file, Charset.forName(charset)).write(string); + } catch (IOException e) { + throw new ResourceException("Could not write " + getDisplayName() + " content to " + file + ".", e); + } + return file; + } + + @Override + public File asFile() { + return asFile(Charset.defaultCharset().name()); + } + + @Override + public TaskDependency getBuildDependencies() { + return TaskDependencyInternal.EMPTY; + } + + @Override + public Object getInputProperties() { + return string; + } + + @Override + public FileCollection getInputFiles() { + return null; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/AbstractTaskFilePropertyRegistration.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/AbstractTaskFilePropertyRegistration.java new file mode 100644 index 0000000..cc51f4e --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/AbstractTaskFilePropertyRegistration.java @@ -0,0 +1,50 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks; + +public abstract class AbstractTaskFilePropertyRegistration implements TaskPropertyRegistration { + private String propertyName; + private boolean optional; + private final StaticValue value; + + public AbstractTaskFilePropertyRegistration(StaticValue value) { + this.value = value; + } + + @Override + public String getPropertyName() { + return propertyName; + } + + @Override + public StaticValue getValue() { + return value; + } + + @Override + public boolean isOptional() { + return optional; + } + + public void setPropertyName(String propertyName) { + this.propertyName = TaskPropertyUtils.checkPropertyName(propertyName); + } + + public void setOptional(boolean optional) { + this.optional = optional; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/DefaultTaskInputFilePropertyRegistration.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/DefaultTaskInputFilePropertyRegistration.java new file mode 100644 index 0000000..cf53b69 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/DefaultTaskInputFilePropertyRegistration.java @@ -0,0 +1,135 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks; + +import org.gradle.api.NonNullApi; +import org.gradle.api.internal.tasks.properties.FileParameterUtils; +import org.gradle.api.internal.tasks.properties.InputFilePropertyType; +import org.gradle.api.tasks.FileNormalizer; +import org.gradle.api.tasks.PathSensitivity; +import org.gradle.api.tasks.TaskInputFilePropertyBuilder; +import org.gradle.internal.fingerprint.AbsolutePathInputNormalizer; +import org.gradle.internal.fingerprint.DirectorySensitivity; +import org.gradle.internal.fingerprint.LineEndingSensitivity; + +@NonNullApi +public class DefaultTaskInputFilePropertyRegistration extends AbstractTaskFilePropertyRegistration implements TaskInputFilePropertyRegistration { + + private final InputFilePropertyType filePropertyType; + private boolean skipWhenEmpty; + private DirectorySensitivity directorySensitivity = DirectorySensitivity.DEFAULT; + private LineEndingSensitivity lineEndingSensitivity = LineEndingSensitivity.DEFAULT; + private Class normalizer = AbsolutePathInputNormalizer.class; + + public DefaultTaskInputFilePropertyRegistration(StaticValue value, InputFilePropertyType filePropertyType) { + super(value); + this.filePropertyType = filePropertyType; + } + + @Override + public InputFilePropertyType getFilePropertyType() { + return filePropertyType; + } + + @Override + public TaskInputFilePropertyBuilderInternal withPropertyName(String propertyName) { + setPropertyName(propertyName); + return this; + } + + @Override + public boolean isSkipWhenEmpty() { + return skipWhenEmpty; + } + + @Override + public TaskInputFilePropertyBuilderInternal skipWhenEmpty(boolean skipWhenEmpty) { + this.skipWhenEmpty = skipWhenEmpty; + return this; + } + + @Override + public TaskInputFilePropertyBuilderInternal skipWhenEmpty() { + return skipWhenEmpty(true); + } + + @Override + public TaskInputFilePropertyBuilderInternal optional(boolean optional) { + setOptional(optional); + return this; + } + + @Override + public TaskInputFilePropertyBuilderInternal optional() { + return optional(true); + } + + @Override + public TaskInputFilePropertyBuilderInternal withPathSensitivity(PathSensitivity sensitivity) { + return withNormalizer(FileParameterUtils.determineNormalizerForPathSensitivity(sensitivity)); + } + + @Override + public TaskInputFilePropertyBuilderInternal withNormalizer(Class normalizer) { + this.normalizer = normalizer; + return this; + } + + @Override + public Class getNormalizer() { + return normalizer; + } + + @Override + public DirectorySensitivity getDirectorySensitivity() { + return directorySensitivity; + } + + @Override + public TaskInputFilePropertyBuilder ignoreEmptyDirectories() { + this.directorySensitivity = DirectorySensitivity.IGNORE_DIRECTORIES; + return this; + } + + @Override + public TaskInputFilePropertyBuilder ignoreEmptyDirectories(boolean ignoreDirectories) { + this.directorySensitivity = ignoreDirectories ? DirectorySensitivity.IGNORE_DIRECTORIES : DirectorySensitivity.DEFAULT; + return this; + } + + @Override + public LineEndingSensitivity getLineEndingNormalization() { + return lineEndingSensitivity; + } + + @Override + public TaskInputFilePropertyBuilder normalizeLineEndings() { + this.lineEndingSensitivity = LineEndingSensitivity.NORMALIZE_LINE_ENDINGS; + return this; + } + + @Override + public TaskInputFilePropertyBuilder normalizeLineEndings(boolean ignoreLineEndings) { + this.lineEndingSensitivity = ignoreLineEndings ? LineEndingSensitivity.NORMALIZE_LINE_ENDINGS : LineEndingSensitivity.DEFAULT; + return this; + } + + @Override + public String toString() { + return getPropertyName() + " (" + getNormalizer().getSimpleName().replace("Normalizer", "") + ")"; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/RealizeTaskBuildOperationType.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/RealizeTaskBuildOperationType.java new file mode 100644 index 0000000..edcaaef --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/RealizeTaskBuildOperationType.java @@ -0,0 +1,52 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks; + +import org.gradle.internal.operations.BuildOperationType; +import org.gradle.internal.scan.UsedByScanPlugin; + +/** + * Represents a creation request for a task. Actual task may be realized later. + * + * @since 4.9 + */ +public final class RealizeTaskBuildOperationType implements BuildOperationType { + + @UsedByScanPlugin + public interface Details { + String getBuildPath(); + + String getTaskPath(); + + /** + * @see org.gradle.api.internal.project.taskfactory.TaskIdentity#uniqueId + */ + long getTaskId(); + + boolean isReplacement(); + + boolean isEager(); + } + + @UsedByScanPlugin + public interface Result { + } + + private RealizeTaskBuildOperationType() { + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/TaskExecuter.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/TaskExecuter.java new file mode 100644 index 0000000..87bfa00 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/TaskExecuter.java @@ -0,0 +1,26 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.tasks; + +import org.gradle.api.internal.TaskInternal; + +public interface TaskExecuter { + /** + * Executes the given task. If the task fails with an exception, the exception is packaged in the provided task + * state. + */ + TaskExecuterResult execute(TaskInternal task, TaskStateInternal state, TaskExecutionContext context); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/execution/ExecuteTaskBuildOperationDetails.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/execution/ExecuteTaskBuildOperationDetails.java new file mode 100644 index 0000000..c5a5fbe --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/execution/ExecuteTaskBuildOperationDetails.java @@ -0,0 +1,73 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.execution; + +import com.google.common.collect.ImmutableMap; +import org.gradle.api.internal.TaskInternal; +import org.gradle.execution.plan.LocalTaskNode; +import org.gradle.internal.operations.trace.CustomOperationTraceSerialization; +import org.gradle.internal.scan.NotUsedByScanPlugin; + +public class ExecuteTaskBuildOperationDetails implements ExecuteTaskBuildOperationType.Details, CustomOperationTraceSerialization { + + private final LocalTaskNode taskNode; + + public ExecuteTaskBuildOperationDetails(LocalTaskNode taskNode) { + this.taskNode = taskNode; + } + + // TODO: do not reference mutable state + @NotUsedByScanPlugin + public TaskInternal getTask() { + return taskNode.getTask(); + } + + @NotUsedByScanPlugin + public LocalTaskNode getTaskNode() { + return taskNode; + } + + @Override + public String getBuildPath() { + return getTask().getTaskIdentity().buildPath.toString(); + } + + @Override + public String getTaskPath() { + return getTask().getTaskIdentity().projectPath.toString(); + } + + @Override + public long getTaskId() { + return getTask().getTaskIdentity().uniqueId; + } + + @Override + public Class getTaskClass() { + return getTask().getTaskIdentity().type; + } + + @Override + public Object getCustomOperationTraceSerializableModel() { + ImmutableMap.Builder builder = new ImmutableMap.Builder(); + builder.put("buildPath", getBuildPath()); + builder.put("taskPath", getTaskPath()); + builder.put("taskClass", getTaskClass().getName()); + builder.put("taskId", getTaskId()); + return builder.build(); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/execution/statistics/TaskExecutionStatisticsEventAdapter.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/execution/statistics/TaskExecutionStatisticsEventAdapter.java new file mode 100644 index 0000000..81bb31f --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/execution/statistics/TaskExecutionStatisticsEventAdapter.java @@ -0,0 +1,57 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.tasks.execution.statistics; + +import org.gradle.api.internal.project.taskfactory.TaskIdentity; +import org.gradle.api.internal.tasks.TaskStateInternal; +import org.gradle.api.tasks.TaskState; +import org.gradle.execution.taskgraph.TaskListenerInternal; + +public class TaskExecutionStatisticsEventAdapter implements TaskListenerInternal { + private int executedTasksCount; + private int fromCacheTaskCount; + private int upToDateTaskCount; + + @Override + public void beforeExecute(TaskIdentity taskIdentity) { + // do nothing + } + + @Override + public void afterExecute(TaskIdentity taskIdentity, TaskState state) { + TaskStateInternal stateInternal = (TaskStateInternal) state; + if (stateInternal.isActionable()) { + switch (stateInternal.getOutcome()) { + case EXECUTED: + executedTasksCount++; + break; + case FROM_CACHE: + fromCacheTaskCount++; + break; + case UP_TO_DATE: + upToDateTaskCount++; + break; + default: + // Ignore any other outcome + break; + } + } + } + + public TaskExecutionStatistics getStatistics() { + return new TaskExecutionStatistics(executedTasksCount, fromCacheTaskCount, upToDateTaskCount); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/properties/bean/MapRuntimeBeanNode.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/properties/bean/MapRuntimeBeanNode.java new file mode 100644 index 0000000..fd389e0 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/properties/bean/MapRuntimeBeanNode.java @@ -0,0 +1,42 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.properties.bean; + +import com.google.common.base.Preconditions; +import org.gradle.api.internal.tasks.properties.PropertyVisitor; +import org.gradle.api.internal.tasks.properties.TypeMetadata; +import org.gradle.internal.reflect.validation.TypeValidationContext; + +import java.util.Map; +import java.util.Queue; + +class MapRuntimeBeanNode extends RuntimeBeanNode> { + public MapRuntimeBeanNode(RuntimeBeanNode parentNode, String propertyName, Map map, TypeMetadata typeMetadata) { + super(parentNode, propertyName, map, typeMetadata); + } + + @Override + public void visitNode(PropertyVisitor visitor, Queue> queue, RuntimeBeanNodeFactory nodeFactory, TypeValidationContext validationContext) { + for (Map.Entry entry : getBean().entrySet()) { + RuntimeBeanNode childNode = createChildNode( + Preconditions.checkNotNull(entry.getKey(), "Null keys in nested map '%s' are not allowed.", getPropertyName()).toString(), + entry.getValue(), + nodeFactory); + queue.add(childNode); + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/properties/bean/RootRuntimeBeanNode.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/properties/bean/RootRuntimeBeanNode.java new file mode 100644 index 0000000..9ff08d6 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/api/internal/tasks/properties/bean/RootRuntimeBeanNode.java @@ -0,0 +1,34 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.properties.bean; + +import org.gradle.api.internal.tasks.properties.PropertyVisitor; +import org.gradle.api.internal.tasks.properties.TypeMetadata; +import org.gradle.internal.reflect.validation.TypeValidationContext; + +import java.util.Queue; + +public class RootRuntimeBeanNode extends AbstractNestedRuntimeBeanNode { + public RootRuntimeBeanNode(Object bean, TypeMetadata typeMetadata) { + super(null, null, bean, typeMetadata); + } + + @Override + public void visitNode(PropertyVisitor visitor, Queue> queue, RuntimeBeanNodeFactory nodeFactory, TypeValidationContext validationContext) { + visitProperties(visitor, queue, nodeFactory, validationContext); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/configuration/project/ConfigureProjectBuildOperationType.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/configuration/project/ConfigureProjectBuildOperationType.java new file mode 100644 index 0000000..4e569c0 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/configuration/project/ConfigureProjectBuildOperationType.java @@ -0,0 +1,82 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.configuration.project; + +import org.gradle.internal.operations.BuildOperationType; +import org.gradle.internal.scan.UsedByScanPlugin; +import org.gradle.util.Path; + +import java.io.File; + +/** + * Configuration of a project. + * + * @since 4.0 + */ +public final class ConfigureProjectBuildOperationType implements BuildOperationType { + + @UsedByScanPlugin + public interface Details { + + String getProjectPath(); + + String getBuildPath(); + + File getRootDir(); + + } + + public interface Result { + + } + + public static class DetailsImpl implements Details { + + private final Path buildPath; + private final File rootDir; + private final Path projectPath; + + public DetailsImpl(Path projectPath, Path buildPath, File rootDir) { + this.projectPath = projectPath; + this.buildPath = buildPath; + this.rootDir = rootDir; + } + + @Override + public String getProjectPath() { + return projectPath.getPath(); + } + + @Override + public String getBuildPath() { + return buildPath.getPath(); + } + + @Override + public File getRootDir() { + return rootDir; + } + + } + + final static Result RESULT = new Result() { + }; + + private ConfigureProjectBuildOperationType() { + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/execution/plan/DependencyResolver.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/execution/plan/DependencyResolver.java new file mode 100644 index 0000000..9824449 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/execution/plan/DependencyResolver.java @@ -0,0 +1,25 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.execution.plan; + +import org.gradle.api.internal.tasks.WorkDependencyResolver; + +/** + * Resolves dependencies to {@link Node} objects. + */ +public interface DependencyResolver extends WorkDependencyResolver { +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/execution/plan/TaskNode.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/execution/plan/TaskNode.java new file mode 100644 index 0000000..d2943e1 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/execution/plan/TaskNode.java @@ -0,0 +1,178 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.execution.plan; + +import com.google.common.collect.Iterables; +import com.google.common.collect.Sets; +import org.gradle.api.Action; +import org.gradle.api.Task; +import org.gradle.api.internal.TaskInternal; +import org.gradle.internal.deprecation.DeprecationLogger; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.NavigableSet; +import java.util.Set; + +public abstract class TaskNode extends Node { + private static final Logger LOGGER = LoggerFactory.getLogger(TaskNode.class); + + private final NavigableSet mustSuccessors = Sets.newTreeSet(); + private final Set mustPredecessors = Sets.newHashSet(); + private final NavigableSet shouldSuccessors = Sets.newTreeSet(); + private final NavigableSet finalizers = Sets.newTreeSet(); + private final NavigableSet finalizingSuccessors = Sets.newTreeSet(); + + @Override + public boolean doCheckDependenciesComplete() { + if (!super.doCheckDependenciesComplete()) { + return false; + } + LOGGER.debug("Checking if all must successors are complete for {}", this); + for (Node dependency : mustSuccessors) { + if (!dependency.isComplete()) { + return false; + } + } + + LOGGER.debug("Checking if all finalizing successors are complete for {}", this); + for (Node dependency : finalizingSuccessors) { + if (!dependency.isComplete()) { + return false; + } + } + + LOGGER.debug("All task dependencies are complete for {}", this); + return true; + } + + public Set getMustSuccessors() { + return mustSuccessors; + } + + @Override + public Set getFinalizers() { + return finalizers; + } + + public Set getFinalizingSuccessors() { + return finalizingSuccessors; + } + + public Set getShouldSuccessors() { + return shouldSuccessors; + } + + public void addMustSuccessor(TaskNode toNode) { + deprecateLifecycleHookReferencingNonLocalTask("mustRunAfter", toNode); + mustSuccessors.add(toNode); + toNode.mustPredecessors.add(this); + } + + public void addFinalizingSuccessor(TaskNode finalized) { + finalizingSuccessors.add(finalized); + finalized.finalizers.add(this); + } + + public void addFinalizer(TaskNode finalizerNode) { + deprecateLifecycleHookReferencingNonLocalTask("finalizedBy", finalizerNode); + finalizerNode.addFinalizingSuccessor(this); + } + + public void addShouldSuccessor(Node toNode) { + deprecateLifecycleHookReferencingNonLocalTask("shouldRunAfter", toNode); + shouldSuccessors.add(toNode); + } + + public void removeShouldSuccessor(TaskNode toNode) { + shouldSuccessors.remove(toNode); + } + + @Override + public Iterable getAllSuccessors() { + return Iterables.concat( + shouldSuccessors, + finalizingSuccessors, + mustSuccessors, + super.getAllSuccessors() + ); + } + + @Override + public Iterable getHardSuccessors() { + return Iterables.concat( + finalizingSuccessors, + mustSuccessors, + super.getHardSuccessors() + ); + } + + @Override + public Iterable getAllSuccessorsInReverseOrder() { + return Iterables.concat( + super.getAllSuccessorsInReverseOrder(), + mustSuccessors.descendingSet(), + finalizingSuccessors.descendingSet(), + shouldSuccessors.descendingSet() + ); + } + + @Override + public Iterable getAllPredecessors() { + return Iterables.concat(mustPredecessors, finalizers, super.getAllPredecessors()); + } + + @Override + public boolean hasHardSuccessor(Node successor) { + if (super.hasHardSuccessor(successor)) { + return true; + } + if (!(successor instanceof TaskNode)) { + return false; + } + return getMustSuccessors().contains(successor) + || getFinalizingSuccessors().contains(successor); + } + + /** + * Attach an action to execute immediately after the successful completion of this task. + * + *

This is used to ensure that dependency resolution metadata for a particular artifact is calculated immediately after that artifact is produced and cached, to avoid consuming tasks having to lock the producing project in order to calculate this metadata.

+ * + *

This action should really be modelled as a real node in the graph. This 'post action' concept is intended to be a step in this direction.

+ */ + public abstract void appendPostAction(Action action); + + public abstract Action getPostAction(); + + public abstract TaskInternal getTask(); + + @Override + public boolean isPublicNode() { + return true; + } + + private void deprecateLifecycleHookReferencingNonLocalTask(String hookName, Node taskNode) { + if (taskNode instanceof TaskInAnotherBuild) { + DeprecationLogger.deprecateAction("Using " + hookName + " to reference tasks from another build") + .willBecomeAnErrorInGradle8() + .withUpgradeGuideSection(6, "referencing_tasks_from_included_builds") + .nagUser(); + } + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/groovy/scripts/internal/DefaultScriptRunnerFactory.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/groovy/scripts/internal/DefaultScriptRunnerFactory.java new file mode 100644 index 0000000..3f23da8 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/groovy/scripts/internal/DefaultScriptRunnerFactory.java @@ -0,0 +1,100 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.groovy.scripts.internal; + +import org.gradle.api.GradleScriptException; +import org.gradle.groovy.scripts.Script; +import org.gradle.internal.scripts.ScriptExecutionListener; +import org.gradle.groovy.scripts.ScriptRunner; +import org.gradle.groovy.scripts.ScriptSource; +import org.gradle.internal.reflect.Instantiator; +import org.gradle.internal.service.ServiceRegistry; + +public class DefaultScriptRunnerFactory implements ScriptRunnerFactory { + private final ScriptExecutionListener listener; + private final Instantiator instantiator; + + public DefaultScriptRunnerFactory(ScriptExecutionListener listener, Instantiator instantiator) { + this.listener = listener; + this.instantiator = instantiator; + } + + @Override + public ScriptRunner create(CompiledScript script, ScriptSource source, ClassLoader contextClassLoader) { + return new ScriptRunnerImpl(script, source, contextClassLoader); + } + + private class ScriptRunnerImpl implements ScriptRunner { + private final ScriptSource source; + private final ClassLoader contextClassLoader; + private T script; + private final CompiledScript compiledScript; + + public ScriptRunnerImpl(CompiledScript compiledScript, ScriptSource source, ClassLoader contextClassLoader) { + this.compiledScript = compiledScript; + this.source = source; + this.contextClassLoader = contextClassLoader; + } + + @Override + public T getScript() { + if (script == null) { + Class scriptClass = compiledScript.loadClass(); + script = instantiator.newInstance(scriptClass); + script.setScriptSource(source); + script.setContextClassloader(contextClassLoader); + listener.onScriptClassLoaded(source, scriptClass); + } + return script; + } + + @Override + public M getData() { + return compiledScript.getData(); + } + + @Override + public boolean getRunDoesSomething() { + return compiledScript.getRunDoesSomething(); + } + + @Override + public boolean getHasMethods() { + return compiledScript.getHasMethods(); + } + + @Override + public void run(Object target, ServiceRegistry scriptServices) throws GradleScriptException { + if (!compiledScript.getRunDoesSomething()) { + return; + } + + ClassLoader originalLoader = Thread.currentThread().getContextClassLoader(); + T script = getScript(); + script.init(target, scriptServices); + Thread.currentThread().setContextClassLoader(script.getContextClassloader()); + script.getStandardOutputCapture().start(); + try { + script.run(); + } catch (Throwable e) { + throw new GradleScriptException(String.format("A problem occurred evaluating %s.", script), e); + } finally { + script.getStandardOutputCapture().stop(); + Thread.currentThread().setContextClassLoader(originalLoader); + } + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/initialization/ContinuousExecutionGate.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/initialization/ContinuousExecutionGate.java new file mode 100644 index 0000000..c2ee517 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/initialization/ContinuousExecutionGate.java @@ -0,0 +1,31 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.initialization; + +import javax.annotation.Nonnull; + +public interface ContinuousExecutionGate { + @Nonnull + GateKeeper createGateKeeper(); + + void waitForOpen(); + + interface GateKeeper { + void open(); + void close(); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/initialization/DefaultSettings.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/initialization/DefaultSettings.java new file mode 100644 index 0000000..098930b --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/initialization/DefaultSettings.java @@ -0,0 +1,388 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.initialization; + +import org.gradle.StartParameter; +import org.gradle.api.Action; +import org.gradle.api.UnknownProjectException; +import org.gradle.api.initialization.ConfigurableIncludedBuild; +import org.gradle.api.initialization.ProjectDescriptor; +import org.gradle.api.initialization.Settings; +import org.gradle.api.initialization.dsl.ScriptHandler; +import org.gradle.api.initialization.resolve.DependencyResolutionManagement; +import org.gradle.api.internal.FeaturePreviews; +import org.gradle.api.internal.FeaturePreviews.Feature; +import org.gradle.api.internal.GradleInternal; +import org.gradle.api.internal.SettingsInternal; +import org.gradle.api.internal.file.FileResolver; +import org.gradle.api.internal.initialization.ClassLoaderScope; +import org.gradle.api.internal.initialization.ScriptHandlerFactory; +import org.gradle.api.internal.plugins.DefaultObjectConfigurationAction; +import org.gradle.api.internal.plugins.PluginManagerInternal; +import org.gradle.api.internal.project.AbstractPluginAware; +import org.gradle.api.internal.project.ProjectRegistry; +import org.gradle.api.provider.ProviderFactory; +import org.gradle.caching.configuration.BuildCacheConfiguration; +import org.gradle.caching.configuration.internal.BuildCacheConfigurationInternal; +import org.gradle.configuration.ScriptPluginFactory; +import org.gradle.groovy.scripts.ScriptSource; +import org.gradle.internal.Actions; +import org.gradle.internal.deprecation.DeprecationLogger; +import org.gradle.internal.management.DependencyResolutionManagementInternal; +import org.gradle.internal.resource.TextUriResourceLoader; +import org.gradle.internal.service.ServiceRegistry; +import org.gradle.internal.service.scopes.ServiceRegistryFactory; +import org.gradle.plugin.management.PluginManagementSpec; +import org.gradle.plugin.management.internal.PluginManagementSpecInternal; +import org.gradle.vcs.SourceControl; + +import javax.inject.Inject; +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +public abstract class DefaultSettings extends AbstractPluginAware implements SettingsInternal { + private ScriptSource settingsScript; + + private StartParameter startParameter; + + private File settingsDir; + + private DefaultProjectDescriptor rootProjectDescriptor; + + private DefaultProjectDescriptor defaultProjectDescriptor; + + private final GradleInternal gradle; + + private final ClassLoaderScope classLoaderScope; + private final ClassLoaderScope baseClassLoaderScope; + private final ScriptHandler scriptHandler; + private final ServiceRegistry services; + + private final List includedBuildSpecs = new ArrayList<>(); + private final DependencyResolutionManagementInternal dependencyResolutionManagement; + + public DefaultSettings(ServiceRegistryFactory serviceRegistryFactory, + GradleInternal gradle, + ClassLoaderScope classLoaderScope, + ClassLoaderScope baseClassLoaderScope, + ScriptHandler settingsScriptHandler, + File settingsDir, + ScriptSource settingsScript, + StartParameter startParameter) { + this.gradle = gradle; + this.classLoaderScope = classLoaderScope; + this.baseClassLoaderScope = baseClassLoaderScope; + this.scriptHandler = settingsScriptHandler; + this.settingsDir = settingsDir; + this.settingsScript = settingsScript; + this.startParameter = startParameter; + this.services = serviceRegistryFactory.createFor(this); + this.rootProjectDescriptor = createProjectDescriptor(null, settingsDir.getName(), settingsDir); + this.dependencyResolutionManagement = services.get(DependencyResolutionManagementInternal.class); + } + + @Override + public String toString() { + return "settings '" + rootProjectDescriptor.getName() + "'"; + } + + @Override + public GradleInternal getGradle() { + return gradle; + } + + @Override + public List getIncludedBuilds() { + return includedBuildSpecs; + } + + @Override + public Settings getSettings() { + return this; + } + + @Override + public ScriptHandler getBuildscript() { + return scriptHandler; + } + + public DefaultProjectDescriptor createProjectDescriptor(DefaultProjectDescriptor parent, String name, File dir) { + return new DefaultProjectDescriptor(parent, name, dir, getProjectDescriptorRegistry(), getFileResolver()); + } + + @Override + public DefaultProjectDescriptor findProject(String path) { + return getProjectDescriptorRegistry().getProject(path); + } + + @Override + public DefaultProjectDescriptor findProject(File projectDir) { + return getProjectDescriptorRegistry().getProject(projectDir); + } + + @Override + public DefaultProjectDescriptor project(String path) { + DefaultProjectDescriptor projectDescriptor = getProjectDescriptorRegistry().getProject(path); + if (projectDescriptor == null) { + throw new UnknownProjectException(String.format("Project with path '%s' could not be found.", path)); + } + return projectDescriptor; + } + + @Override + public DefaultProjectDescriptor project(File projectDir) { + DefaultProjectDescriptor projectDescriptor = getProjectDescriptorRegistry().getProject(projectDir); + if (projectDescriptor == null) { + throw new UnknownProjectException(String.format("Project with path '%s' could not be found.", projectDir)); + } + return projectDescriptor; + } + + @Override + public void include(String... projectPaths) { + for (String projectPath : projectPaths) { + String subPath = ""; + String[] pathElements = removeTrailingColon(projectPath).split(":"); + DefaultProjectDescriptor parentProjectDescriptor = rootProjectDescriptor; + for (String pathElement : pathElements) { + subPath = subPath + ":" + pathElement; + DefaultProjectDescriptor projectDescriptor = getProjectDescriptorRegistry().getProject(subPath); + if (projectDescriptor == null) { + parentProjectDescriptor = createProjectDescriptor(parentProjectDescriptor, pathElement, new File(parentProjectDescriptor.getProjectDir(), pathElement)); + } else { + parentProjectDescriptor = projectDescriptor; + } + } + } + } + + @Override + @Deprecated + public void includeFlat(String... projectNames) { + for (String projectName : projectNames) { + createProjectDescriptor(rootProjectDescriptor, projectName, + new File(rootProjectDescriptor.getProjectDir().getParentFile(), projectName)); + } + } + + private String removeTrailingColon(String projectPath) { + if (projectPath.startsWith(":")) { + return projectPath.substring(1); + } + return projectPath; + } + + @Override + public ProjectDescriptor getRootProject() { + return rootProjectDescriptor; + } + + public void setRootProjectDescriptor(DefaultProjectDescriptor rootProjectDescriptor) { + this.rootProjectDescriptor = rootProjectDescriptor; + } + + @Override + public DefaultProjectDescriptor getDefaultProject() { + return defaultProjectDescriptor; + } + + @Override + public void setDefaultProject(DefaultProjectDescriptor defaultProjectDescriptor) { + this.defaultProjectDescriptor = defaultProjectDescriptor; + } + + @Override + public File getRootDir() { + return rootProjectDescriptor.getProjectDir(); + } + + @Override + public StartParameter getStartParameter() { + return startParameter; + } + + public void setStartParameter(StartParameter startParameter) { + this.startParameter = startParameter; + } + + @Override + public File getSettingsDir() { + return settingsDir; + } + + public void setSettingsDir(File settingsDir) { + this.settingsDir = settingsDir; + } + + @Override + public ScriptSource getSettingsScript() { + return settingsScript; + } + + public void setSettingsScript(ScriptSource settingsScript) { + this.settingsScript = settingsScript; + } + + @Override + @Inject + public ProviderFactory getProviders() { + // Decoration takes care of the implementation + throw new UnsupportedOperationException(); + } + + @Inject + public ProjectDescriptorRegistry getProjectDescriptorRegistry() { + throw new UnsupportedOperationException(); + } + + @Inject + public TextUriResourceLoader.Factory getTextUriResourceLoaderFactory() { + throw new UnsupportedOperationException(); + } + + @Override + public ProjectRegistry getProjectRegistry() { + return getProjectDescriptorRegistry(); + } + + @Override + protected DefaultObjectConfigurationAction createObjectConfigurationAction() { + return new DefaultObjectConfigurationAction( + getFileResolver(), + getScriptPluginFactory(), + getScriptHandlerFactory(), + baseClassLoaderScope, + getTextUriResourceLoaderFactory(), + this); + } + + @Override + public ClassLoaderScope getBaseClassLoaderScope() { + return baseClassLoaderScope; + } + + @Override + public ClassLoaderScope getClassLoaderScope() { + return classLoaderScope; + } + + @Override + public File getBuildSrcDir() { + return new File(getSettingsDir(), BUILD_SRC); + } + + @Override + public ServiceRegistry getServices() { + return services; + } + + @Inject + protected ScriptHandlerFactory getScriptHandlerFactory() { + throw new UnsupportedOperationException(); + } + + @Inject + protected ScriptPluginFactory getScriptPluginFactory() { + throw new UnsupportedOperationException(); + } + + @Inject + protected FileResolver getFileResolver() { + throw new UnsupportedOperationException(); + } + + @Override + @Inject + public PluginManagerInternal getPluginManager() { + throw new UnsupportedOperationException(); + } + + @Override + public void includeBuild(Object rootProject) { + includeBuild(rootProject, Actions.doNothing()); + } + + @Override + public void includeBuild(Object rootProject, Action configuration) { + File projectDir = getFileResolver().resolve(rootProject); + includedBuildSpecs.add(IncludedBuildSpec.includedBuild(projectDir, configuration)); + } + + @Override + public void buildCache(Action action) { + action.execute(getBuildCache()); + } + + @Override + @Inject + public BuildCacheConfigurationInternal getBuildCache() { + throw new UnsupportedOperationException(); + } + + @Override + public void pluginManagement(Action rule) { + rule.execute(getPluginManagement()); + includedBuildSpecs.addAll(((PluginManagementSpecInternal) getPluginManagement()).getIncludedBuilds()); + } + + @Override + @Inject + public PluginManagementSpec getPluginManagement() { + throw new UnsupportedOperationException(); + } + + @Override + public void sourceControl(Action configuration) { + configuration.execute(getSourceControl()); + } + + @Override + @Inject + public SourceControl getSourceControl() { + throw new UnsupportedOperationException(); + } + + @Override + public void enableFeaturePreview(String name) { + Feature feature = Feature.withName(name); + if (feature.isActive()) { + services.get(FeaturePreviews.class).enableFeature(feature); + } else { + DeprecationLogger + .deprecate("enableFeaturePreview('" + feature.name() + "')") + .withAdvice("The feature flag is no longer relevant, please remove it from your settings file.") + .willBeRemovedInGradle8() + .withUserManual("feature_lifecycle", "feature_preview") + .nagUser(); + } + } + + @Override + public void dependencyResolutionManagement(Action dependencyResolutionConfiguration) { + dependencyResolutionConfiguration.execute(dependencyResolutionManagement); + } + + @Override + public void preventFromFurtherMutation() { + dependencyResolutionManagement.preventFromFurtherMutation(); + } + + @Override + public DependencyResolutionManagementInternal getDependencyResolutionManagement() { + return dependencyResolutionManagement; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/initialization/RootBuildCacheControllerSettingsProcessor.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/initialization/RootBuildCacheControllerSettingsProcessor.java new file mode 100644 index 0000000..ae37fa9 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/initialization/RootBuildCacheControllerSettingsProcessor.java @@ -0,0 +1,51 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.initialization; + +import org.gradle.StartParameter; +import org.gradle.api.internal.GradleInternal; +import org.gradle.api.internal.SettingsInternal; +import org.gradle.api.internal.initialization.ClassLoaderScope; +import org.gradle.caching.internal.controller.BuildCacheController; +import org.gradle.caching.internal.controller.RootBuildCacheControllerRef; + +public class RootBuildCacheControllerSettingsProcessor implements SettingsProcessor { + + public static void process(GradleInternal gradle) { + // The strategy for sharing build cache configuration across included builds in a composite, + // requires that the cache configuration be finalized (and cache controller available) + // before configuring them. This achieves that. + if (gradle.isRootBuild()) { + BuildCacheController rootController = gradle.getServices().get(BuildCacheController.class); + RootBuildCacheControllerRef rootControllerRef = gradle.getServices().get(RootBuildCacheControllerRef.class); + rootControllerRef.set(rootController); + } + } + + private final SettingsProcessor delegate; + + public RootBuildCacheControllerSettingsProcessor(SettingsProcessor delegate) { + this.delegate = delegate; + } + + @Override + public SettingsInternal process(GradleInternal gradle, SettingsLocation settingsLocation, ClassLoaderScope buildRootClassLoaderScope, StartParameter startParameter) { + SettingsInternal settings = delegate.process(gradle, settingsLocation, buildRootClassLoaderScope, startParameter); + process(gradle); + return settings; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/initialization/exception/MultipleBuildFailuresExceptionAnalyser.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/initialization/exception/MultipleBuildFailuresExceptionAnalyser.java new file mode 100644 index 0000000..da48093 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/initialization/exception/MultipleBuildFailuresExceptionAnalyser.java @@ -0,0 +1,55 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.initialization.exception; + +import org.gradle.execution.MultipleBuildFailures; + +import java.util.ArrayList; +import java.util.List; + +/** + * An exception analyser that deals specifically with MultipleBuildFailures and transforms each component failure. + */ +public class MultipleBuildFailuresExceptionAnalyser implements ExceptionAnalyser { + private final ExceptionCollector collector; + + public MultipleBuildFailuresExceptionAnalyser(ExceptionCollector collector) { + this.collector = collector; + } + + @Override + public RuntimeException transform(Throwable failure) { + List failures = new ArrayList(); + if (failure instanceof MultipleBuildFailures) { + MultipleBuildFailures multipleBuildFailures = (MultipleBuildFailures) failure; + for (Throwable cause : multipleBuildFailures.getCauses()) { + collector.collectFailures(cause, failures); + } + if (failures.size() == 1 && failures.get(0) instanceof RuntimeException) { + return (RuntimeException) failures.get(0); + } + multipleBuildFailures.replaceCauses(failures); + return multipleBuildFailures; + } else { + collector.collectFailures(failure, failures); + if (failures.size() == 1 && failures.get(0) instanceof RuntimeException) { + return (RuntimeException) failures.get(0); + } + return new MultipleBuildFailures(failures); + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/internal/classpath/ClasspathBuilder.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/internal/classpath/ClasspathBuilder.java new file mode 100644 index 0000000..22170f9 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/internal/classpath/ClasspathBuilder.java @@ -0,0 +1,129 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.classpath; + +import org.apache.tools.zip.ZipEntry; +import org.apache.tools.zip.ZipOutputStream; +import org.gradle.api.GradleException; +import org.gradle.api.internal.file.temp.TemporaryFileProvider; +import org.gradle.api.internal.file.archive.ZipCopyAction; +import org.gradle.internal.service.scopes.Scopes; +import org.gradle.internal.service.scopes.ServiceScope; + +import javax.annotation.Nullable; +import javax.inject.Inject; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.StandardCopyOption; +import java.util.HashSet; +import java.util.Set; + +@ServiceScope(Scopes.UserHome.class) +public class ClasspathBuilder { + private static final int BUFFER_SIZE = 8192; + private final TemporaryFileProvider temporaryFileProvider; + + @Inject + ClasspathBuilder(final TemporaryFileProvider temporaryFileProvider) { + this.temporaryFileProvider = temporaryFileProvider; + } + + /** + * Creates a Jar file using the given action to add entries to the file. If the file already exists it will be replaced. + */ + public void jar(File jarFile, Action action) { + try { + buildJar(jarFile, action); + } catch (Exception e) { + throw new GradleException(String.format("Failed to create Jar file %s.", jarFile), e); + } + } + + private void buildJar(File jarFile, Action action) throws IOException { + File parentDir = jarFile.getParentFile(); + File tmpFile = temporaryFileProvider.createTemporaryFile(jarFile.getName(), ".tmp"); + try { + Files.createDirectories(parentDir.toPath()); + try (ZipOutputStream outputStream = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(tmpFile), BUFFER_SIZE))) { + outputStream.setLevel(0); + action.execute(new ZipEntryBuilder(outputStream)); + } + Files.move(tmpFile.toPath(), jarFile.toPath(), StandardCopyOption.REPLACE_EXISTING); + } finally { + Files.deleteIfExists(tmpFile.toPath()); + } + } + + public interface Action { + void execute(EntryBuilder builder) throws IOException; + } + + public interface EntryBuilder { + void put(String name, byte[] content) throws IOException; + } + + private static class ZipEntryBuilder implements EntryBuilder { + private final ZipOutputStream outputStream; + private final Set dirs = new HashSet<>(); + + public ZipEntryBuilder(ZipOutputStream outputStream) { + this.outputStream = outputStream; + } + + @Override + public void put(String name, byte[] content) throws IOException { + maybeAddParent(name); + ZipEntry zipEntry = newZipEntryWithFixedTime(name); + outputStream.setEncoding("UTF-8"); + outputStream.putNextEntry(zipEntry); + outputStream.write(content); + outputStream.closeEntry(); + } + + private void maybeAddParent(String name) throws IOException { + String dir = dir(name); + if (dir != null && dirs.add(dir)) { + maybeAddParent(dir); + ZipEntry zipEntry = newZipEntryWithFixedTime(dir); + outputStream.putNextEntry(zipEntry); + outputStream.closeEntry(); + } + } + + @Nullable + String dir(String name) { + int pos = name.lastIndexOf('/'); + if (pos == name.length() - 1) { + pos = name.lastIndexOf('/', pos - 1); + } + if (pos >= 0) { + return name.substring(0, pos + 1); + } else { + return null; + } + } + + private ZipEntry newZipEntryWithFixedTime(String name) { + ZipEntry entry = new ZipEntry(name); + entry.setTime(ZipCopyAction.CONSTANT_TIME_FOR_ZIP_ENTRIES); + return entry; + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/internal/composite/DefaultConfigurableIncludedPluginBuild.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/internal/composite/DefaultConfigurableIncludedPluginBuild.java new file mode 100644 index 0000000..1481d42 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/internal/composite/DefaultConfigurableIncludedPluginBuild.java @@ -0,0 +1,61 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.composite; + +import com.google.common.base.Preconditions; +import org.gradle.api.tasks.TaskReference; +import org.gradle.api.initialization.ConfigurableIncludedPluginBuild; + +import javax.annotation.Nonnull; +import javax.annotation.Nullable; +import java.io.File; + +public class DefaultConfigurableIncludedPluginBuild implements ConfigurableIncludedPluginBuild { + + private final File projectDir; + + private String name; + + public DefaultConfigurableIncludedPluginBuild(File projectDir) { + this.projectDir = projectDir; + this.name = projectDir.getName(); + } + + @Override + @Nonnull + public String getName() { + return name; + } + + @Override + public void setName(@Nonnull String name) { + Preconditions.checkNotNull(name, "name must not be null"); + this.name = name; + } + + @Override + @Nonnull + public File getProjectDir() { + return projectDir; + } + + @Override + @Nonnull + public TaskReference task(@Nullable String path) { + throw new IllegalStateException("IncludedBuild.task() cannot be used while configuring the included build"); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/internal/fingerprint/impl/RelativePathFileCollectionFingerprinter.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/internal/fingerprint/impl/RelativePathFileCollectionFingerprinter.java new file mode 100644 index 0000000..27ace57 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/internal/fingerprint/impl/RelativePathFileCollectionFingerprinter.java @@ -0,0 +1,36 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.fingerprint.impl; + +import org.gradle.api.internal.cache.StringInterner; +import org.gradle.api.tasks.FileNormalizer; +import org.gradle.internal.execution.fingerprint.FileCollectionSnapshotter; +import org.gradle.internal.fingerprint.DirectorySensitivity; +import org.gradle.internal.fingerprint.RelativePathInputNormalizer; +import org.gradle.internal.fingerprint.hashing.FileSystemLocationSnapshotHasher; + +public class RelativePathFileCollectionFingerprinter extends AbstractFileCollectionFingerprinter { + + public RelativePathFileCollectionFingerprinter(StringInterner stringInterner, DirectorySensitivity directorySensitivity, FileCollectionSnapshotter fileCollectionSnapshotter, FileSystemLocationSnapshotHasher normalizedContentHasher) { + super(new RelativePathFingerprintingStrategy(stringInterner, directorySensitivity, normalizedContentHasher), fileCollectionSnapshotter); + } + + @Override + public Class getRegisteredType() { + return RelativePathInputNormalizer.class; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/internal/hash/DefaultChecksumService.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/internal/hash/DefaultChecksumService.java new file mode 100644 index 0000000..81ecfcd --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/internal/hash/DefaultChecksumService.java @@ -0,0 +1,103 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.internal.hash; + +import org.gradle.api.internal.cache.StringInterner; +import org.gradle.api.internal.changedetection.state.CachingFileHasher; +import org.gradle.api.internal.changedetection.state.CrossBuildFileHashCache; +import org.gradle.api.internal.changedetection.state.FileHasherStatistics; +import org.gradle.api.internal.changedetection.state.FileTimeStampInspector; +import org.gradle.internal.nativeintegration.filesystem.FileSystem; +import org.gradle.internal.service.scopes.Scopes; +import org.gradle.internal.service.scopes.ServiceScope; + +import java.io.File; + +@ServiceScope(Scopes.BuildSession.class) +public class DefaultChecksumService implements ChecksumService { + private final CachingFileHasher md5; + private final CachingFileHasher sha1; + private final CachingFileHasher sha256; + private final CachingFileHasher sha512; + + public DefaultChecksumService( + StringInterner stringInterner, + CrossBuildFileHashCache fileStore, + FileSystem fileSystem, + FileTimeStampInspector fileTimeStampInspector, + FileHasherStatistics.Collector statisticsCollector + ) { + md5 = createCache(stringInterner, fileStore, fileSystem, fileTimeStampInspector, "md5", Hashing.md5(), statisticsCollector); + sha1 = createCache(stringInterner, fileStore, fileSystem, fileTimeStampInspector, "sha1", Hashing.sha1(), statisticsCollector); + sha256 = createCache(stringInterner, fileStore, fileSystem, fileTimeStampInspector, "sha256", Hashing.sha256(), statisticsCollector); + sha512 = createCache(stringInterner, fileStore, fileSystem, fileTimeStampInspector, "sha512", Hashing.sha512(), statisticsCollector); + } + + private CachingFileHasher createCache( + StringInterner stringInterner, + CrossBuildFileHashCache fileStore, + FileSystem fileSystem, + FileTimeStampInspector fileTimeStampInspector, + String name, + HashFunction hashFunction, + FileHasherStatistics.Collector statisticsCollector + ) { + return new CachingFileHasher(new ChecksumHasher(hashFunction), fileStore, stringInterner, fileTimeStampInspector, name + "-checksums", fileSystem, 1000, statisticsCollector); + } + + @Override + public HashCode md5(File file) { + return doHash(file, md5); + } + + @Override + public HashCode sha1(File file) { + return doHash(file, sha1); + } + + @Override + public HashCode sha256(File file) { + return doHash(file, sha256); + } + + @Override + public HashCode sha512(File file) { + return doHash(file, sha512); + } + + @Override + public HashCode hash(File src, String algorithm) { + switch (algorithm.toLowerCase()) { + case "md5": + return md5(src); + case "sha1": + case "sha-1": + return sha1(src); + case "sha256": + case "sha-256": + return sha256(src); + case "sha512": + case "sha-512": + return sha512(src); + } + throw new UnsupportedOperationException("Cannot hash with algorith " + algorithm); + } + + private HashCode doHash(File file, CachingFileHasher hasher) { + return hasher.hash(file); + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/internal/operations/logging/DefaultBuildOperationLoggerFactory.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/internal/operations/logging/DefaultBuildOperationLoggerFactory.java new file mode 100644 index 0000000..e8ed74c --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/internal/operations/logging/DefaultBuildOperationLoggerFactory.java @@ -0,0 +1,61 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.operations.logging; + +import org.gradle.api.logging.Logger; +import org.gradle.api.logging.Logging; +import org.gradle.util.internal.GFileUtils; + +import java.io.File; + +public class DefaultBuildOperationLoggerFactory implements BuildOperationLoggerFactory { + private static final int MAX_FAILURES = 10; + + private final Logger logger; + + DefaultBuildOperationLoggerFactory(Logger logger) { + this.logger = logger; + } + + public DefaultBuildOperationLoggerFactory() { + this(Logging.getLogger(DefaultBuildOperationLoggerFactory.class)); + } + + + @Override + public BuildOperationLogger newOperationLogger(String taskName, File outputDir) { + final File outputFile = createOutputFile(outputDir); + final BuildOperationLogInfo configuration = createLogInfo(taskName, outputFile, MAX_FAILURES); + return new DefaultBuildOperationLogger(configuration, logger, outputFile); + } + + protected File createOutputFile(File outputDir) { + GFileUtils.mkdirs(outputDir); + return new File(outputDir, "output.txt"); + } + + protected BuildOperationLogInfo createLogInfo(String taskName, File outputFile, int maximumFailures) { + final BuildOperationLogInfo configuration; + if (logger.isDebugEnabled()) { + // show all operation output when debug is enabled + configuration = new BuildOperationLogInfo(taskName, outputFile, Integer.MAX_VALUE); + } else { + configuration = new BuildOperationLogInfo(taskName, outputFile, maximumFailures); + } + return configuration; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/internal/operations/trace/BuildOperationTrace.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/internal/operations/trace/BuildOperationTrace.java new file mode 100644 index 0000000..dc4a87b --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/internal/operations/trace/BuildOperationTrace.java @@ -0,0 +1,389 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.operations.trace; + +import com.google.common.base.Charsets; +import com.google.common.base.StandardSystemProperty; +import com.google.common.io.Files; +import com.google.common.io.LineProcessor; +import groovy.json.JsonOutput; +import groovy.json.JsonSlurper; +import org.gradle.StartParameter; +import org.gradle.internal.UncheckedException; +import org.gradle.internal.concurrent.Stoppable; +import org.gradle.internal.operations.BuildOperationDescriptor; +import org.gradle.internal.operations.BuildOperationListener; +import org.gradle.internal.operations.BuildOperationListenerManager; +import org.gradle.internal.operations.OperationFinishEvent; +import org.gradle.internal.operations.OperationIdentifier; +import org.gradle.internal.operations.OperationProgressEvent; +import org.gradle.internal.operations.OperationStartEvent; +import org.gradle.util.internal.GFileUtils; + +import javax.annotation.Nonnull; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.charset.StandardCharsets; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Deque; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Queue; + +import static org.gradle.internal.Cast.uncheckedCast; +import static org.gradle.internal.Cast.uncheckedNonnullCast; + +/** + * Writes files describing the build operation stream for a build. + * Can be enabled for any build with `-Dorg.gradle.internal.operations.trace=«path-base»`. + * + * Imposes no overhead when not enabled. + * Also used as the basis for asserting on the event stream in integration tests, via BuildOperationFixture. + * + * Three files are created: + * + * - «path-base»-log.txt: a chronological log of events, each line is a JSON object + * - «path-base»-tree.json: a JSON tree of the event structure + * - «path-base»-tree.txt: A simplified tree representation showing basic information + * + * Generally, the simplified tree view is best for browsing. + * The JSON tree view can be used for more detailed analysis — open in a JSON tree viewer, like Chrome. + * + * The «path-base» param is optional. + * If invoked as `-Dorg.gradle.internal.operations.trace`, a base value of "operations" will be used. + * + * The “trace” produced here is different to the trace produced by Gradle Profiler. + * There, the focus is analyzing the performance profile. + * Here, the focus is debugging/developing the information structure of build operations. + * + * @since 4.0 + */ +public class BuildOperationTrace implements Stoppable { + + public static final String SYSPROP = "org.gradle.internal.operations.trace"; + + private static final byte[] NEWLINE = "\n".getBytes(); + + private final String basePath; + private final OutputStream logOutputStream; + + private final BuildOperationListenerManager buildOperationListenerManager; + + private final BuildOperationListener listener = new BuildOperationListener() { + @Override + public void started(BuildOperationDescriptor buildOperation, OperationStartEvent startEvent) { + write(new SerializedOperationStart(buildOperation, startEvent)); + } + + @Override + public void progress(OperationIdentifier buildOperationId, OperationProgressEvent progressEvent) { + write(new SerializedOperationProgress(buildOperationId, progressEvent)); + } + + @Override + public void finished(BuildOperationDescriptor buildOperation, OperationFinishEvent finishEvent) { + write(new SerializedOperationFinish(buildOperation, finishEvent)); + } + }; + + public BuildOperationTrace(StartParameter startParameter, BuildOperationListenerManager buildOperationListenerManager) { + this.buildOperationListenerManager = buildOperationListenerManager; + + Map sysProps = startParameter.getSystemPropertiesArgs(); + String basePath = sysProps.get(SYSPROP); + if (basePath == null) { + basePath = System.getProperty(SYSPROP); + } + + this.basePath = basePath; + if (this.basePath == null || basePath.equals(Boolean.FALSE.toString())) { + this.logOutputStream = null; + return; + } + + try { + File logFile = logFile(basePath); + GFileUtils.mkdirs(logFile.getParentFile()); + if (logFile.isFile()) { + GFileUtils.forceDelete(logFile); + } + //noinspection ResultOfMethodCallIgnored + logFile.createNewFile(); + + this.logOutputStream = new BufferedOutputStream(new FileOutputStream(logFile)); + } catch (IOException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + + buildOperationListenerManager.addListener(listener); + } + + @Override + public void stop() { + buildOperationListenerManager.removeListener(listener); + if (logOutputStream != null) { + try { + synchronized (logOutputStream) { + logOutputStream.close(); + } + + final List roots = readLogToTreeRoots(logFile(basePath)); + writeDetailTree(roots); + writeSummaryTree(roots); + } catch (IOException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + } + + private void write(SerializedOperation operation) { + String json = JsonOutput.toJson(operation.toMap()); + try { + synchronized (logOutputStream) { + logOutputStream.write(json.getBytes(StandardCharsets.UTF_8)); + logOutputStream.write(NEWLINE); + logOutputStream.flush(); + } + } catch (IOException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + + private void writeDetailTree(List roots) throws IOException { + try { + String rawJson = JsonOutput.toJson(BuildOperationTree.serialize(roots)); + String prettyJson = JsonOutput.prettyPrint(rawJson); + Files.asCharSink(file(basePath, "-tree.json"), Charsets.UTF_8).write(prettyJson); + } catch (OutOfMemoryError e) { + System.err.println("Failed to write build operation trace JSON due to out of memory."); + } + } + + private void writeSummaryTree(final List roots) throws IOException { + Files.asCharSink(file(basePath, "-tree.txt"), Charsets.UTF_8).writeLines(new Iterable() { + @Override + @Nonnull + public Iterator iterator() { + + final Deque> stack = new ArrayDeque<>(Collections.singleton(new ArrayDeque<>(roots))); + final StringBuilder stringBuilder = new StringBuilder(); + + return new Iterator() { + @Override + public boolean hasNext() { + if (stack.isEmpty()) { + return false; + } else if (stack.peek().isEmpty()) { + stack.pop(); + return hasNext(); + } else { + return true; + } + } + + @Override + public String next() { + Queue children = stack.element(); + BuildOperationRecord record = children.remove(); + + stringBuilder.setLength(0); + + int indents = stack.size() - 1; + + for (int i = 0; i < indents; ++i) { + stringBuilder.append(" "); + } + + if (!record.children.isEmpty()) { + stack.addFirst(new ArrayDeque<>(record.children)); + } + + stringBuilder.append(record.displayName); + + if (record.details != null) { + stringBuilder.append(" "); + stringBuilder.append(JsonOutput.toJson(record.details)); + } + + if (record.result != null) { + stringBuilder.append(" "); + stringBuilder.append(JsonOutput.toJson(record.result)); + } + + stringBuilder.append(" ["); + stringBuilder.append(record.endTime - record.startTime); + stringBuilder.append("ms]"); + + stringBuilder.append(" ("); + stringBuilder.append(record.id); + stringBuilder.append(")"); + + if (!record.progress.isEmpty()) { + for (BuildOperationRecord.Progress progress : record.progress) { + stringBuilder.append(StandardSystemProperty.LINE_SEPARATOR.value()); + for (int i = 0; i < indents; ++i) { + stringBuilder.append(" "); + } + stringBuilder.append("- ") + .append(progress.details).append(" [") + .append(progress.time - record.startTime) + .append("]"); + } + } + + return stringBuilder.toString(); + } + + @Override + public void remove() { + throw new UnsupportedOperationException(); + } + }; + } + }); + } + + public static BuildOperationTree read(String basePath) { + File logFile = logFile(basePath); + List roots = readLogToTreeRoots(logFile); + return new BuildOperationTree(roots); + } + + private static List readLogToTreeRoots(final File logFile) { + try { + final JsonSlurper slurper = new JsonSlurper(); + + final List roots = new ArrayList<>(); + final Map pendings = new HashMap<>(); + final Map> childrens = new HashMap<>(); + + Files.asCharSource(logFile, Charsets.UTF_8).readLines(new LineProcessor() { + @Override + public boolean processLine(@SuppressWarnings("NullableProblems") String line) { + Map map = uncheckedNonnullCast(slurper.parseText(line)); + if (map.containsKey("startTime")) { + SerializedOperationStart serialized = new SerializedOperationStart(map); + pendings.put(serialized.id, new PendingOperation(serialized)); + childrens.put(serialized.id, new LinkedList<>()); + } else if (map.containsKey("time")) { + SerializedOperationProgress serialized = new SerializedOperationProgress(map); + PendingOperation pending = pendings.get(serialized.id); + assert pending != null : "did not find owner of progress event with ID " + serialized.id; + pending.progress.add(serialized); + } else { + SerializedOperationFinish finish = new SerializedOperationFinish(map); + + PendingOperation pending = pendings.remove(finish.id); + assert pending != null; + + List children = childrens.remove(finish.id); + assert children != null; + + SerializedOperationStart start = pending.start; + + Map detailsMap = uncheckedCast(start.details); + Map resultMap = uncheckedCast(finish.result); + + List progresses = new ArrayList<>(); + for (SerializedOperationProgress progress : pending.progress) { + Map progressDetailsMap = uncheckedCast(progress.details); + progresses.add(new BuildOperationRecord.Progress( + progress.time, + progressDetailsMap, + progress.detailsClassName + )); + } + + BuildOperationRecord record = new BuildOperationRecord( + start.id, + start.parentId, + start.displayName, + start.startTime, + finish.endTime, + detailsMap == null ? null : Collections.unmodifiableMap(detailsMap), + start.detailsClassName, + resultMap == null ? null : Collections.unmodifiableMap(resultMap), + finish.resultClassName, + finish.failureMsg, + progresses, + BuildOperationRecord.ORDERING.immutableSortedCopy(children) + ); + + if (start.parentId == null) { + roots.add(record); + } else { + List parentChildren = childrens.get(start.parentId); + assert parentChildren != null : "parentChildren != null '" + line + "' from " + logFile; + parentChildren.add(record); + } + } + + return true; + } + + @Override + public Void getResult() { + return null; + } + }); + + assert pendings.isEmpty(); + + return roots; + } catch (Exception e) { + throw UncheckedException.throwAsUncheckedException(e); + } + + } + + private static File logFile(String basePath) { + return file(basePath, "-log.txt"); + } + + private static File file(String base, String suffix) { + return new File((base == null || base.trim().isEmpty() ? "operations" : base) + suffix).getAbsoluteFile(); + } + + static class PendingOperation { + + final SerializedOperationStart start; + + final List progress = new ArrayList<>(); + + PendingOperation(SerializedOperationStart start) { + this.start = start; + } + + } + + public static Object toSerializableModel(Object object) { + if (object instanceof CustomOperationTraceSerialization) { + return ((CustomOperationTraceSerialization) object).getCustomOperationTraceSerializableModel(); + } else { + return object; + } + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/invocation/DefaultGradle.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/invocation/DefaultGradle.java new file mode 100644 index 0000000..149f140 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/invocation/DefaultGradle.java @@ -0,0 +1,532 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.invocation; + +import com.google.common.collect.ImmutableList; +import groovy.lang.Closure; +import org.gradle.BuildListener; +import org.gradle.BuildResult; +import org.gradle.StartParameter; +import org.gradle.api.Action; +import org.gradle.api.Project; +import org.gradle.api.ProjectEvaluationListener; +import org.gradle.api.UnknownDomainObjectException; +import org.gradle.api.initialization.IncludedBuild; +import org.gradle.api.initialization.Settings; +import org.gradle.api.internal.BuildScopeListenerRegistrationListener; +import org.gradle.api.internal.GradleInternal; +import org.gradle.api.internal.MutationGuards; +import org.gradle.api.internal.SettingsInternal; +import org.gradle.api.internal.StartParameterInternal; +import org.gradle.api.internal.file.FileResolver; +import org.gradle.api.internal.initialization.ClassLoaderScope; +import org.gradle.api.internal.initialization.ScriptHandlerFactory; +import org.gradle.api.internal.plugins.DefaultObjectConfigurationAction; +import org.gradle.api.internal.plugins.PluginManagerInternal; +import org.gradle.api.internal.project.AbstractPluginAware; +import org.gradle.api.internal.project.CrossProjectConfigurator; +import org.gradle.api.internal.project.ProjectInternal; +import org.gradle.api.internal.project.ProjectRegistry; +import org.gradle.api.invocation.Gradle; +import org.gradle.api.services.BuildServiceRegistry; +import org.gradle.configuration.ScriptPluginFactory; +import org.gradle.configuration.internal.ListenerBuildOperationDecorator; +import org.gradle.execution.taskgraph.TaskExecutionGraphInternal; +import org.gradle.initialization.ClassLoaderScopeRegistry; +import org.gradle.internal.Cast; +import org.gradle.internal.InternalBuildAdapter; +import org.gradle.internal.MutableActionSet; +import org.gradle.internal.build.BuildState; +import org.gradle.internal.build.PublicBuildPath; +import org.gradle.internal.composite.IncludedBuildInternal; +import org.gradle.internal.enterprise.core.GradleEnterprisePluginManager; +import org.gradle.internal.event.ListenerBroadcast; +import org.gradle.internal.event.ListenerManager; +import org.gradle.internal.installation.CurrentGradleInstallation; +import org.gradle.internal.installation.GradleInstallation; +import org.gradle.internal.resource.TextUriResourceLoader; +import org.gradle.internal.service.ServiceRegistry; +import org.gradle.internal.service.scopes.ServiceRegistryFactory; +import org.gradle.listener.ClosureBackedMethodInvocationDispatch; +import org.gradle.util.GradleVersion; +import org.gradle.util.Path; + +import javax.inject.Inject; +import java.io.File; +import java.util.Collection; +import java.util.List; + +public abstract class DefaultGradle extends AbstractPluginAware implements GradleInternal { + + private SettingsInternal settings; + private ProjectInternal rootProject; + private ProjectInternal defaultProject; + private final GradleInternal parent; + private final StartParameter startParameter; + private final ServiceRegistry services; + private final ListenerBroadcast buildListenerBroadcast; + private final ListenerBroadcast projectEvaluationListenerBroadcast; + private final CrossProjectConfigurator crossProjectConfigurator; + private List includedBuilds; + private final MutableActionSet rootProjectActions = new MutableActionSet(); + private boolean projectsLoaded; + private Path identityPath; + private ClassLoaderScope classLoaderScope; + private ClassLoaderScope baseProjectClassLoaderScope; + + public DefaultGradle(GradleInternal parent, StartParameter startParameter, ServiceRegistryFactory parentRegistry) { + this.parent = parent; + this.startParameter = startParameter; + this.services = parentRegistry.createFor(this); + this.crossProjectConfigurator = services.get(CrossProjectConfigurator.class); + buildListenerBroadcast = getListenerManager().createAnonymousBroadcaster(BuildListener.class); + projectEvaluationListenerBroadcast = getListenerManager().createAnonymousBroadcaster(ProjectEvaluationListener.class); + + buildListenerBroadcast.add(new InternalBuildAdapter() { + @Override + public void projectsLoaded(Gradle gradle) { + if (!rootProjectActions.isEmpty()) { + services.get(CrossProjectConfigurator.class).rootProject(rootProject, rootProjectActions); + } + projectsLoaded = true; + } + }); + + if (parent == null) { + services.get(GradleEnterprisePluginManager.class).registerMissingPluginWarning(this); + } + } + + @Override + public String toString() { + return rootProject == null ? "build" : ("build '" + rootProject.getName() + "'"); + } + + @Override + public Path getIdentityPath() { + if (identityPath == null) { + identityPath = services.get(PublicBuildPath.class).getBuildPath(); + } + return identityPath; + } + + @Override + public String contextualize(String description) { + if (isRootBuild()) { + return description; + } else { + Path contextPath = getIdentityPath(); + String context = contextPath == null ? getStartParameter().getCurrentDir().getName() : contextPath.getPath(); + return description + " (" + context + ")"; + } + } + + @Override + public GradleInternal getParent() { + return parent; + } + + @Override + public GradleInternal getRoot() { + GradleInternal parent = getParent(); + if (parent == null) { + return this; + } else { + return parent.getRoot(); + } + } + + @Override + public boolean isRootBuild() { + return parent == null; + } + + @Override + public BuildState getOwner() { + return getServices().get(BuildState.class); + } + + @Override + public String getGradleVersion() { + return GradleVersion.current().getVersion(); + } + + @Override + public File getGradleHomeDir() { + GradleInstallation gradleInstallation = getCurrentGradleInstallation().getInstallation(); + return gradleInstallation == null ? null : gradleInstallation.getGradleHome(); + } + + @Override + public File getGradleUserHomeDir() { + return startParameter.getGradleUserHomeDir(); + } + + @Override + public StartParameterInternal getStartParameter() { + return (StartParameterInternal) startParameter; + } + + @Override + public ClassLoaderScope baseProjectClassLoaderScope() { + if (baseProjectClassLoaderScope == null) { + throw new IllegalStateException("baseProjectClassLoaderScope not yet set"); + } + return baseProjectClassLoaderScope; + } + + @Override + public void setBaseProjectClassLoaderScope(ClassLoaderScope classLoaderScope) { + if (classLoaderScope == null) { + throw new IllegalArgumentException("classLoaderScope must not be null"); + } + if (baseProjectClassLoaderScope != null) { + throw new IllegalStateException("baseProjectClassLoaderScope is already set"); + } + + this.baseProjectClassLoaderScope = classLoaderScope; + } + + @Override + public SettingsInternal getSettings() { + if (settings == null) { + throw new IllegalStateException("The settings are not yet available for " + this + "."); + } + return settings; + } + + @Override + public void setSettings(SettingsInternal settings) { + this.settings = settings; + } + + @Override + public ProjectInternal getRootProject() { + if (rootProject == null) { + throw new IllegalStateException("The root project is not yet available for " + this + "."); + } + return rootProject; + } + + @Override + public void setRootProject(ProjectInternal rootProject) { + this.rootProject = rootProject; + } + + @Override + public void rootProject(Action action) { + rootProject("Gradle.rootProject", action); + } + + private void rootProject(String registrationPoint, Action action) { + if (projectsLoaded) { + assert rootProject != null; + action.execute(rootProject); + } else { + // only need to decorate when this callback is delayed + rootProjectActions.add(getListenerBuildOperationDecorator().decorate(registrationPoint, action)); + } + } + + @Override + public void allprojects(final Action action) { + rootProject("Gradle.allprojects", new Action() { + @Override + public void execute(Project project) { + project.allprojects(action); + } + }); + } + + @Override + public ProjectInternal getDefaultProject() { + return defaultProject; + } + + @Override + public void setDefaultProject(ProjectInternal defaultProject) { + this.defaultProject = defaultProject; + } + + @Inject + @Override + public abstract TaskExecutionGraphInternal getTaskGraph(); + + @Override + public ProjectEvaluationListener addProjectEvaluationListener(ProjectEvaluationListener listener) { + addListener("Gradle.addProjectEvaluationListener", listener); + return listener; + } + + @Override + public void removeProjectEvaluationListener(ProjectEvaluationListener listener) { + removeListener(listener); + } + + private void assertProjectMutatingMethodAllowed(String methodName) { + MutationGuards.of(crossProjectConfigurator).assertMutationAllowed(methodName, this, Gradle.class); + } + + @Override + public void beforeProject(Closure closure) { + assertProjectMutatingMethodAllowed("beforeProject(Closure)"); + projectEvaluationListenerBroadcast.add(new ClosureBackedMethodInvocationDispatch("beforeEvaluate", getListenerBuildOperationDecorator().decorate("Gradle.beforeProject", Cast.>uncheckedNonnullCast(closure)))); + } + + @Override + public void beforeProject(Action action) { + assertProjectMutatingMethodAllowed("beforeProject(Action)"); + projectEvaluationListenerBroadcast.add("beforeEvaluate", getListenerBuildOperationDecorator().decorate("Gradle.beforeProject", action)); + } + + @Override + public void afterProject(Closure closure) { + assertProjectMutatingMethodAllowed("afterProject(Closure)"); + projectEvaluationListenerBroadcast.add(new ClosureBackedMethodInvocationDispatch("afterEvaluate", getListenerBuildOperationDecorator().decorate("Gradle.afterProject", Cast.>uncheckedNonnullCast(closure)))); + } + + @Override + public void afterProject(Action action) { + assertProjectMutatingMethodAllowed("afterProject(Action)"); + projectEvaluationListenerBroadcast.add("afterEvaluate", getListenerBuildOperationDecorator().decorate("Gradle.afterProject", action)); + } + + @Override + public void beforeSettings(Closure closure) { + buildListenerBroadcast.add(new ClosureBackedMethodInvocationDispatch("beforeSettings", closure)); + } + + @Override + public void beforeSettings(Action action) { + buildListenerBroadcast.add("beforeSettings", action); + } + + @Override + public void settingsEvaluated(Closure closure) { + buildListenerBroadcast.add(new ClosureBackedMethodInvocationDispatch("settingsEvaluated", closure)); + } + + @Override + public void settingsEvaluated(Action action) { + buildListenerBroadcast.add("settingsEvaluated", action); + } + + @Override + public void projectsLoaded(Closure closure) { + assertProjectMutatingMethodAllowed("projectsLoaded(Closure)"); + buildListenerBroadcast.add(new ClosureBackedMethodInvocationDispatch("projectsLoaded", getListenerBuildOperationDecorator().decorate("Gradle.projectsLoaded", Cast.>uncheckedNonnullCast(closure)))); + } + + @Override + public void projectsLoaded(Action action) { + assertProjectMutatingMethodAllowed("projectsLoaded(Action)"); + buildListenerBroadcast.add("projectsLoaded", getListenerBuildOperationDecorator().decorate("Gradle.projectsLoaded", action)); + } + + @Override + public void projectsEvaluated(Closure closure) { + assertProjectMutatingMethodAllowed("projectsEvaluated(Closure)"); + buildListenerBroadcast.add(new ClosureBackedMethodInvocationDispatch("projectsEvaluated", getListenerBuildOperationDecorator().decorate("Gradle.projectsEvaluated", Cast.>uncheckedNonnullCast(closure)))); + } + + @Override + public void projectsEvaluated(Action action) { + assertProjectMutatingMethodAllowed("projectsEvaluated(Action)"); + buildListenerBroadcast.add("projectsEvaluated", getListenerBuildOperationDecorator().decorate("Gradle.projectsEvaluated", action)); + } + + @Override + public void buildFinished(Closure closure) { + notifyListenerRegistration("Gradle.buildFinished", closure); + buildListenerBroadcast.add(new ClosureBackedMethodInvocationDispatch("buildFinished", closure)); + } + + @Override + public void buildFinished(Action action) { + notifyListenerRegistration("Gradle.buildFinished", action); + buildListenerBroadcast.add("buildFinished", action); + } + + @Override + public void addListener(Object listener) { + addListener("Gradle.addListener", listener); + } + + private void addListener(String registrationPoint, Object listener) { + notifyListenerRegistration(registrationPoint, listener); + getListenerManager().addListener(getListenerBuildOperationDecorator().decorateUnknownListener(registrationPoint, listener)); + } + + private void notifyListenerRegistration(String registrationPoint, Object listener) { + getListenerManager().getBroadcaster(BuildScopeListenerRegistrationListener.class) + .onBuildScopeListenerRegistration(listener, registrationPoint, this); + } + + @Override + public void removeListener(Object listener) { + // do same decoration as in addListener to remove correctly + getListenerManager().removeListener(getListenerBuildOperationDecorator().decorateUnknownListener(null, listener)); + } + + @Override + public void useLogger(Object logger) { + getListenerManager().useLogger(logger); + } + + @Override + public ProjectEvaluationListener getProjectEvaluationBroadcaster() { + return projectEvaluationListenerBroadcast.getSource(); + } + + @Override + public void addBuildListener(BuildListener buildListener) { + addListener("Gradle.addBuildListener", buildListener); + } + + @Override + public BuildListener getBuildListenerBroadcaster() { + return buildListenerBroadcast.getSource(); + } + + @Override + public Gradle getGradle() { + return this; + } + + @Override + @Inject + public abstract BuildServiceRegistry getSharedServices(); + + @Override + public Collection getIncludedBuilds() { + return Cast.uncheckedCast(includedBuilds()); + } + + @Override + public void setIncludedBuilds(Collection includedBuilds) { + this.includedBuilds = ImmutableList.copyOf(includedBuilds); + } + + @Override + public List includedBuilds() { + if (includedBuilds == null) { + throw new IllegalStateException("Included builds are not yet available for this build."); + } + return includedBuilds; + } + + @Override + public IncludedBuild includedBuild(final String name) { + for (IncludedBuild includedBuild : includedBuilds()) { + if (includedBuild.getName().equals(name)) { + return includedBuild; + } + } + throw new UnknownDomainObjectException("Included build '" + name + "' not found in " + this + "."); + } + + @Override + public ServiceRegistry getServices() { + return services; + } + + @Override + @Inject + public ServiceRegistryFactory getServiceRegistryFactory() { + throw new UnsupportedOperationException(); + } + + @Override + protected DefaultObjectConfigurationAction createObjectConfigurationAction() { + return new DefaultObjectConfigurationAction( + getFileResolver(), + getScriptPluginFactory(), + getScriptHandlerFactory(), + getClassLoaderScope(), + getResourceLoaderFactory(), + this + ); + } + + @Override + public void setClassLoaderScope(ClassLoaderScope classLoaderScope) { + if (this.classLoaderScope != null) { + throw new IllegalStateException("Class loader scope already used"); + } + this.classLoaderScope = classLoaderScope; + } + + @Override + public ClassLoaderScope getClassLoaderScope() { + if (classLoaderScope == null) { + classLoaderScope = services.get(ClassLoaderScopeRegistry.class).getCoreAndPluginsScope(); + } + return classLoaderScope; + } + + @Override + @Inject + public abstract ProjectRegistry getProjectRegistry(); + + @Inject + protected TextUriResourceLoader.Factory getResourceLoaderFactory() { + throw new UnsupportedOperationException(); + } + + @Inject + protected ScriptHandlerFactory getScriptHandlerFactory() { + throw new UnsupportedOperationException(); + } + + @Inject + protected ScriptPluginFactory getScriptPluginFactory() { + throw new UnsupportedOperationException(); + } + + @Inject + protected FileResolver getFileResolver() { + throw new UnsupportedOperationException(); + } + + @Inject + protected CurrentGradleInstallation getCurrentGradleInstallation() { + throw new UnsupportedOperationException(); + } + + @Inject + protected ListenerManager getListenerManager() { + throw new UnsupportedOperationException(); + } + + @Inject + protected ListenerBuildOperationDecorator getListenerBuildOperationDecorator() { + throw new UnsupportedOperationException(); + } + + @Override + @Inject + public PluginManagerInternal getPluginManager() { + throw new UnsupportedOperationException(); + } + + @Override + @Inject + public PublicBuildPath getPublicBuildPath() { + throw new UnsupportedOperationException(); + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/process/internal/CurrentProcess.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/process/internal/CurrentProcess.java new file mode 100644 index 0000000..495a30d --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/process/internal/CurrentProcess.java @@ -0,0 +1,53 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.process.internal; + +import org.gradle.api.internal.file.FileCollectionFactory; +import org.gradle.internal.jvm.JavaInfo; +import org.gradle.internal.jvm.Jvm; + +import java.lang.management.ManagementFactory; + +public class CurrentProcess { + private final JavaInfo jvm; + private final JvmOptions effectiveJvmOptions; + + public CurrentProcess(FileCollectionFactory fileCollectionFactory) { + this(Jvm.current(), inferJvmOptions(fileCollectionFactory)); + } + + protected CurrentProcess(JavaInfo jvm, JvmOptions effectiveJvmOptions) { + this.jvm = jvm; + this.effectiveJvmOptions = effectiveJvmOptions; + } + + public JvmOptions getJvmOptions() { + return effectiveJvmOptions; + } + + public JavaInfo getJvm() { + return jvm; + } + + private static JvmOptions inferJvmOptions(FileCollectionFactory fileCollectionFactory) { + // Try to infer the effective jvm options for the currently running process. + // We only care about 'managed' jvm args, anything else is unimportant to the running build + JvmOptions jvmOptions = new JvmOptions(fileCollectionFactory); + jvmOptions.setAllJvmArgs(ManagementFactory.getRuntimeMXBean().getInputArguments()); + return jvmOptions; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/process/internal/worker/WorkerProcessBuilder.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/process/internal/worker/WorkerProcessBuilder.java new file mode 100644 index 0000000..c156433 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/process/internal/worker/WorkerProcessBuilder.java @@ -0,0 +1,68 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.process.internal.worker; + +import org.gradle.api.Action; +import org.gradle.api.logging.LogLevel; + +import java.io.File; +import java.net.URL; +import java.util.List; + +/** + *

A builder which configures and creates worker processes.

+ * + *

A worker process runs an {@link Action} instance. The given action instance is serialized across into the worker process and executed. + * The worker action is supplied with a {@link WorkerProcessContext} which it can use to receive messages from and send messages to the server process (ie this process). + *

+ * + *

The server process (ie this process) can send messages to and receive message from the worker process using the methods on {@link WorkerProcess#getConnection()}.

+ */ +public interface WorkerProcessBuilder extends WorkerProcessSettings { + @Override + WorkerProcessBuilder applicationClasspath(Iterable files); + + @Override + WorkerProcessBuilder applicationModulePath(Iterable files); + + @Override + WorkerProcessBuilder setBaseName(String baseName); + + @Override + WorkerProcessBuilder setLogLevel(LogLevel logLevel); + + @Override + WorkerProcessBuilder sharedPackages(Iterable packages); + + @Override + WorkerProcessBuilder sharedPackages(String... packages); + + Action getWorker(); + + void setImplementationClasspath(List implementationClasspath); + + void setImplementationModulePath(List implementationModulePath); + + void enableJvmMemoryInfoPublishing(boolean shouldPublish); + + /** + * Creates the worker process. The process is not started until {@link WorkerProcess#start()} is called. + * + *

This method can be called multiple times, to create multiple worker processes.

+ */ + WorkerProcess build(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/process/internal/worker/child/WorkerProcessClassPathProvider.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/process/internal/worker/child/WorkerProcessClassPathProvider.java new file mode 100644 index 0000000..59ba057 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/process/internal/worker/child/WorkerProcessClassPathProvider.java @@ -0,0 +1,322 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.process.internal.worker.child; + +import com.google.common.collect.Lists; +import org.gradle.api.Action; +import org.gradle.api.GradleException; +import org.gradle.api.JavaVersion; +import org.gradle.api.internal.ClassPathProvider; +import org.gradle.api.internal.classpath.ModuleRegistry; +import org.gradle.api.specs.Spec; +import org.gradle.cache.CacheRepository; +import org.gradle.cache.FileLockManager; +import org.gradle.cache.PersistentCache; +import org.gradle.cache.internal.filelock.LockOptionsBuilder; +import org.gradle.internal.Factory; +import org.gradle.internal.UncheckedException; +import org.gradle.internal.classloader.ClassLoaderHierarchy; +import org.gradle.internal.classloader.ClassLoaderSpec; +import org.gradle.internal.classloader.ClassLoaderUtils; +import org.gradle.internal.classloader.ClassLoaderVisitor; +import org.gradle.internal.classloader.FilteringClassLoader; +import org.gradle.internal.classloader.SystemClassLoaderSpec; +import org.gradle.internal.classpath.ClassPath; +import org.gradle.internal.classpath.DefaultClassPath; +import org.gradle.internal.reflect.JavaMethod; +import org.gradle.internal.reflect.JavaReflectionUtil; +import org.gradle.internal.reflect.NoSuchMethodException; +import org.gradle.internal.reflect.NoSuchPropertyException; +import org.gradle.internal.reflect.PropertyAccessor; +import org.gradle.internal.reflect.PropertyMutator; +import org.gradle.internal.stream.EncodedStream; +import org.gradle.internal.util.Trie; +import org.gradle.process.internal.worker.GradleWorkerMain; +import org.objectweb.asm.ClassReader; +import org.objectweb.asm.ClassVisitor; +import org.objectweb.asm.ClassWriter; +import org.objectweb.asm.Type; +import org.objectweb.asm.commons.ClassRemapper; +import org.objectweb.asm.commons.Remapper; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; +import java.util.zip.ZipEntry; +import java.util.zip.ZipOutputStream; + +public class WorkerProcessClassPathProvider implements ClassPathProvider { + private static final Logger LOGGER = LoggerFactory.getLogger(WorkerProcessClassPathProvider.class); + private final CacheRepository cacheRepository; + private final ModuleRegistry moduleRegistry; + private final Object lock = new Object(); + private ClassPath workerClassPath; + + public static final String[] RUNTIME_MODULES = new String[] { + "gradle-core-api", + "gradle-core", + "gradle-logging", + "gradle-messaging", + "gradle-base-services", + "gradle-cli", + "gradle-native", + "gradle-dependency-management", + "gradle-workers", + "gradle-worker-processes", + "gradle-process-services", + "gradle-persistent-cache", + "gradle-model-core", + "gradle-jvm-services", + "gradle-files", + "gradle-file-collections", + "gradle-file-temp", + "gradle-hashing", + "gradle-snapshots", + "gradle-base-annotations", + "gradle-build-operations" + }; + + public static final String[] RUNTIME_EXTERNAL_MODULES = new String[] { + "slf4j-api", + "jul-to-slf4j", + "native-platform", + "kryo", + "commons-lang", + "guava", + "javax.inject", + "groovy", + "groovy-ant", + "groovy-json", + "groovy-xml", + "asm" + }; + + // This list is ordered by the number of classes we load from each jar descending + private static final String[] WORKER_OPTIMIZED_LOADING_ORDER = new String[] { + "gradle-base-services", + "guava", + "gradle-messaging", + "gradle-model-core", + "gradle-logging", + "gradle-core-api", + "gradle-workers", + "native-platform", + "gradle-core", + "gradle-native", + "gradle-file-collections", + "gradle-language-java", + "gradle-worker-processes", + "gradle-process-services", + "slf4j-api", + "gradle-language-jvm", + "gradle-persistent-cache", + "gradle-files", + "gradle-hashing", + "gradle-snapshots", + "gradle-worker", + "groovy", + "groovy-ant", + "groovy-json", + "groovy-templates", + "groovy-xml", + "kryo", + "gradle-platform-base", + "gradle-cli", + "jul-to-slf4j", + "javax.inject", + "gradle-jvm-services", + "asm" + }; + + public WorkerProcessClassPathProvider(CacheRepository cacheRepository, ModuleRegistry moduleRegistry) { + this.cacheRepository = cacheRepository; + this.moduleRegistry = moduleRegistry; + } + + @Override + public ClassPath findClassPath(String name) { + if (name.equals("WORKER_MAIN")) { + synchronized (lock) { + if (workerClassPath == null) { + PersistentCache workerClassPathCache = cacheRepository + .cache("workerMain") + .withLockOptions(LockOptionsBuilder.mode(FileLockManager.LockMode.Exclusive)) + .withInitializer(new CacheInitializer()) + .open(); + try { + workerClassPath = DefaultClassPath.of(jarFile(workerClassPathCache)); + } finally { + workerClassPathCache.close(); + } + } + LOGGER.debug("Using worker process classpath: {}", workerClassPath); + return workerClassPath; + } + } + + // Gradle core plus worker implementation classes + if (name.equals("CORE_WORKER_RUNTIME")) { + ClassPath classpath = ClassPath.EMPTY; + classpath = classpath.plus(moduleRegistry.getModule("gradle-core").getAllRequiredModulesClasspath()); + // If a real Gradle installation is used, the following modules will be force-loaded anyway by gradle-core through the getClassPath("GRADLE_EXTENSIONS") call in the DefaultClassLoaderRegistry constructor + // See also: DynamicModulesClassPathProvider.GRADLE_EXTENSION_MODULES + classpath = classpath.plus(moduleRegistry.getModule("gradle-dependency-management").getAllRequiredModulesClasspath()); + classpath = classpath.plus(moduleRegistry.getModule("gradle-plugin-use").getAllRequiredModulesClasspath()); + classpath = classpath.plus(moduleRegistry.getModule("gradle-workers").getAllRequiredModulesClasspath()); + return classpath; + } + + // Just the minimal stuff necessary for the worker infrastructure + if (name.equals("MINIMUM_WORKER_RUNTIME")) { + ClassPath classpath = ClassPath.EMPTY; + for (String module : RUNTIME_MODULES) { + classpath = classpath.plus(moduleRegistry.getModule(module).getImplementationClasspath()); + } + for (String externalModule : RUNTIME_EXTERNAL_MODULES) { + classpath = classpath.plus(moduleRegistry.getExternalModule(externalModule).getImplementationClasspath()); + } + classpath = optimizeForClassloading(classpath); + return classpath; + } + + return null; + } + + private static ClassPath optimizeForClassloading(ClassPath classpath) { + ClassPath optimizedForLoading = ClassPath.EMPTY; + List optimizedFiles = Lists.newArrayListWithCapacity(WORKER_OPTIMIZED_LOADING_ORDER.length); + List remainder = Lists.newArrayList(classpath.getAsFiles()); + for (String module : WORKER_OPTIMIZED_LOADING_ORDER) { + Iterator asFiles = remainder.iterator(); + while (asFiles.hasNext()) { + File file = asFiles.next(); + if (file.getName().startsWith(module)) { + optimizedFiles.add(file); + asFiles.remove(); + } + } + if (remainder.isEmpty()) { + break; + } + } + classpath = optimizedForLoading.plus(optimizedFiles).plus(remainder); + return classpath; + } + + private static File jarFile(PersistentCache cache) { + return new File(cache.getBaseDir(), "gradle-worker.jar"); + } + + private static class CacheInitializer implements Action { + private final WorkerClassRemapper remapper = new WorkerClassRemapper(); + + @Override + public void execute(PersistentCache cache) { + try { + File jarFile = jarFile(cache); + LOGGER.debug("Generating worker process classes to {}.", jarFile); + ZipOutputStream outputStream = new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(jarFile))); + try { + for (Class classToMap : getClassesForWorkerJar()) { + remapClass(classToMap, outputStream); + } + } finally { + outputStream.close(); + } + } catch (Exception e) { + throw new GradleException("Could not generate worker process bootstrap classes.", e); + } + } + + private Set> getClassesForWorkerJar() { + // TODO - calculate this list of classes dynamically + List> classes = Arrays.asList( + GradleWorkerMain.class, + BootstrapSecurityManager.class, + EncodedStream.EncodedInput.class, + ClassLoaderUtils.class, + FilteringClassLoader.class, + ClassLoaderHierarchy.class, + ClassLoaderVisitor.class, + ClassLoaderSpec.class, + SystemClassLoaderSpec.class, + JavaReflectionUtil.class, + JavaMethod.class, + GradleException.class, + NoSuchPropertyException.class, + NoSuchMethodException.class, + UncheckedException.class, + PropertyAccessor.class, + PropertyMutator.class, + Factory.class, + Spec.class, + Action.class, + Trie.class, + JavaVersion.class); + Set> result = new HashSet>(classes); + for (Class klass : classes) { + result.addAll(Arrays.asList(klass.getDeclaredClasses())); + } + + return result; + } + + private void remapClass(Class classToMap, ZipOutputStream jar) throws IOException { + String internalName = Type.getInternalName(classToMap); + String resourceName = internalName.concat(".class"); + URL resource = WorkerProcessClassPathProvider.class.getClassLoader().getResource(resourceName); + if (resource == null) { + throw new IllegalStateException("Could not locate classpath resource for class " + classToMap.getName()); + } + InputStream inputStream = resource.openStream(); + ClassReader classReader; + try { + classReader = new ClassReader(inputStream); + } finally { + inputStream.close(); + } + ClassWriter classWriter = new ClassWriter(0); + ClassVisitor remappingVisitor = new ClassRemapper(classWriter, remapper); + classReader.accept(remappingVisitor, ClassReader.EXPAND_FRAMES); + byte[] remappedClass = classWriter.toByteArray(); + String remappedClassName = remapper.map(internalName).concat(".class"); + jar.putNextEntry(new ZipEntry(remappedClassName)); + jar.write(remappedClass); + } + + private static class WorkerClassRemapper extends Remapper { + @Override + public String map(String typeName) { + if (typeName.startsWith("org/gradle/")) { + return "worker/" + typeName; + } + return typeName; + } + } + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/process/internal/worker/request/RequestArgumentSerializers.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/process/internal/worker/request/RequestArgumentSerializers.java new file mode 100644 index 0000000..ef46784 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/core/org/gradle/process/internal/worker/request/RequestArgumentSerializers.java @@ -0,0 +1,55 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.process.internal.worker.request; + +import org.gradle.internal.serialize.Decoder; +import org.gradle.internal.serialize.DefaultSerializerRegistry; +import org.gradle.internal.serialize.Encoder; +import org.gradle.internal.serialize.Message; +import org.gradle.internal.serialize.Serializer; +import org.gradle.internal.serialize.SerializerRegistry; + +public class RequestArgumentSerializers { + private final SerializerRegistry registry = new DefaultSerializerRegistry(); + + public Serializer getSerializer(ClassLoader defaultClassLoader) { + registry.register(Object.class, new JavaObjectSerializer(defaultClassLoader)); + return registry.build(Object.class); + } + + public void register(Class type, Serializer serializer) { + registry.register(type, serializer); + } + + public static class JavaObjectSerializer implements Serializer { + private final ClassLoader classLoader; + + public JavaObjectSerializer(ClassLoader classLoader) { + this.classLoader = classLoader; + } + + @Override + public Object read(Decoder decoder) throws Exception { + return Message.receive(decoder.getInputStream(), classLoader); + } + + @Override + public void write(Encoder encoder, Object value) throws Exception { + Message.send(value, encoder.getOutputStream()); + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ImmutableModuleIdentifierFactory.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ImmutableModuleIdentifierFactory.java new file mode 100644 index 0000000..4ab2f48 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ImmutableModuleIdentifierFactory.java @@ -0,0 +1,29 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts; + +import org.gradle.api.artifacts.ModuleIdentifier; +import org.gradle.api.artifacts.ModuleVersionIdentifier; +import org.gradle.internal.service.scopes.Scope.Global; +import org.gradle.internal.service.scopes.ServiceScope; + +@ServiceScope(Global.class) +public interface ImmutableModuleIdentifierFactory { + ModuleIdentifier module(String group, String name); + ModuleVersionIdentifier moduleWithVersion(String group, String name, String version); + ModuleVersionIdentifier moduleWithVersion(Module module); + ModuleVersionIdentifier moduleWithVersion(ModuleIdentifier targetModuleId, String version); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ModuleComponentSelectorSerializer.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ModuleComponentSelectorSerializer.java new file mode 100644 index 0000000..c683233 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ModuleComponentSelectorSerializer.java @@ -0,0 +1,127 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Lists; +import org.gradle.api.artifacts.VersionConstraint; +import org.gradle.api.artifacts.component.ModuleComponentSelector; +import org.gradle.api.capabilities.Capability; +import org.gradle.api.internal.artifacts.dependencies.DefaultImmutableVersionConstraint; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.AttributeContainerSerializer; +import org.gradle.api.internal.attributes.AttributeContainerInternal; +import org.gradle.api.internal.attributes.ImmutableAttributes; +import org.gradle.internal.component.external.model.ImmutableCapability; +import org.gradle.internal.serialize.Decoder; +import org.gradle.internal.serialize.Encoder; +import org.gradle.internal.serialize.Serializer; + +import java.io.IOException; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import static org.gradle.internal.component.external.model.DefaultModuleComponentSelector.newSelector; + +public class ModuleComponentSelectorSerializer implements Serializer { + private final AttributeContainerSerializer attributeContainerSerializer; + + public ModuleComponentSelectorSerializer(AttributeContainerSerializer attributeContainerSerializer) { + this.attributeContainerSerializer = attributeContainerSerializer; + } + + @Override + public ModuleComponentSelector read(Decoder decoder) throws IOException { + String group = decoder.readString(); + String name = decoder.readString(); + VersionConstraint versionConstraint = readVersionConstraint(decoder); + ImmutableAttributes attributes = readAttributes(decoder); + List capabilities = readCapabilities(decoder); + return newSelector(DefaultModuleIdentifier.newId(group, name), versionConstraint, attributes, capabilities); + } + + public VersionConstraint readVersionConstraint(Decoder decoder) throws IOException { + String required = decoder.readString(); + String preferred = decoder.readString(); + String strictly = decoder.readString(); + int cpt = decoder.readSmallInt(); + List rejects = Lists.newArrayListWithCapacity(cpt); + for (int i = 0; i < cpt; i++) { + rejects.add(decoder.readString()); + } + String branch = decoder.readNullableString(); + return new DefaultImmutableVersionConstraint(preferred, required, strictly, rejects, branch); + } + + @Override + public void write(Encoder encoder, ModuleComponentSelector value) throws IOException { + encoder.writeString(value.getGroup()); + encoder.writeString(value.getModule()); + writeVersionConstraint(encoder, value.getVersionConstraint()); + writeAttributes(encoder, ((AttributeContainerInternal)value.getAttributes()).asImmutable()); + writeCapabilities(encoder, value.getRequestedCapabilities()); + } + + public void write(Encoder encoder, String group, String module, VersionConstraint version, ImmutableAttributes attributes, Collection capabilities) throws IOException { + encoder.writeString(group); + encoder.writeString(module); + writeVersionConstraint(encoder, version); + writeAttributes(encoder, attributes); + writeCapabilities(encoder, capabilities); + } + + public void writeVersionConstraint(Encoder encoder, VersionConstraint cst) throws IOException { + encoder.writeString(cst.getRequiredVersion()); + encoder.writeString(cst.getPreferredVersion()); + encoder.writeString(cst.getStrictVersion()); + List rejectedVersions = cst.getRejectedVersions(); + encoder.writeSmallInt(rejectedVersions.size()); + for (String rejectedVersion : rejectedVersions) { + encoder.writeString(rejectedVersion); + } + encoder.writeNullableString(cst.getBranch()); + } + + private ImmutableAttributes readAttributes(Decoder decoder) throws IOException { + return attributeContainerSerializer.read(decoder); + } + + private void writeAttributes(Encoder encoder, ImmutableAttributes attributes) throws IOException { + attributeContainerSerializer.write(encoder, attributes); + } + + private List readCapabilities(Decoder decoder) throws IOException { + int size = decoder.readSmallInt(); + if (size == 0) { + return Collections.emptyList(); + } + ImmutableList.Builder builder = ImmutableList.builderWithExpectedSize(size); + for (int i=0; i capabilities) throws IOException { + encoder.writeSmallInt(capabilities.size()); + for (Capability capability : capabilities) { + encoder.writeString(capability.getGroup()); + encoder.writeString(capability.getName()); + encoder.writeNullableString(capability.getVersion()); + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/configurations/TasksFromDependentProjects.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/configurations/TasksFromDependentProjects.java new file mode 100644 index 0000000..5b93f60 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/configurations/TasksFromDependentProjects.java @@ -0,0 +1,83 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.configurations; + +import org.gradle.api.Project; +import org.gradle.api.Task; +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.artifacts.ProjectDependency; +import org.gradle.api.internal.tasks.AbstractTaskDependency; +import org.gradle.api.internal.tasks.TaskDependencyResolveContext; + +import java.util.Set; + +class TasksFromDependentProjects extends AbstractTaskDependency { + + private final String taskName; + private final String configurationName; + private final TaskDependencyChecker checker; + + public TasksFromDependentProjects(String taskName, String configurationName) { + this(taskName, configurationName, new TaskDependencyChecker()); + } + + public TasksFromDependentProjects(String taskName, String configurationName, TaskDependencyChecker checker) { + this.taskName = taskName; + this.configurationName = configurationName; + this.checker = checker; + } + + @Override + public void visitDependencies(TaskDependencyResolveContext context) { + Project thisProject = context.getTask().getProject(); + Set tasksWithName = thisProject.getRootProject().getTasksByName(taskName, true); + for (Task nextTask : tasksWithName) { + if (context.getTask() != nextTask) { + boolean isDependency = checker.isDependent(thisProject, configurationName, nextTask.getProject()); + if (isDependency) { + context.add(nextTask); + } + } + } + } + + static class TaskDependencyChecker { + //checks if candidate project is dependent of the origin project with given configuration + boolean isDependent(Project originProject, String configurationName, Project candidateProject) { + Configuration configuration = candidateProject.getConfigurations().findByName(configurationName); + return configuration != null && doesConfigurationDependOnProject(configuration, originProject); + } + + private static boolean doesConfigurationDependOnProject(Configuration configuration, Project project) { + Set projectDependencies = configuration.getAllDependencies().withType(ProjectDependency.class); + for (ProjectDependency projectDependency : projectDependencies) { + if (projectDependency.getDependencyProject().equals(project)) { + return true; + } + } + return false; + } + } + + public String getTaskName() { + return taskName; + } + + public String getConfigurationName() { + return configurationName; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/configurations/dynamicversion/Expiry.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/configurations/dynamicversion/Expiry.java new file mode 100644 index 0000000..edaffdb --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/configurations/dynamicversion/Expiry.java @@ -0,0 +1,25 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.configurations.dynamicversion; + +import java.time.Duration; + +public interface Expiry { + boolean isMustCheck(); + + Duration getKeepFor(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/dsl/DefaultComponentModuleMetadataHandler.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/dsl/DefaultComponentModuleMetadataHandler.java new file mode 100644 index 0000000..197d229 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/dsl/DefaultComponentModuleMetadataHandler.java @@ -0,0 +1,40 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.dsl; + +import org.gradle.api.Action; +import org.gradle.api.artifacts.ComponentModuleMetadataDetails; +import org.gradle.api.artifacts.dsl.ComponentModuleMetadataHandler; +import org.gradle.api.internal.artifacts.ComponentModuleMetadataProcessor; +import org.gradle.api.internal.artifacts.ImmutableModuleIdentifierFactory; + +public class DefaultComponentModuleMetadataHandler implements ComponentModuleMetadataHandler, ComponentModuleMetadataProcessor { + private final ComponentModuleMetadataContainer moduleMetadataContainer; + + public DefaultComponentModuleMetadataHandler(ImmutableModuleIdentifierFactory moduleIdentifierFactory) { + this.moduleMetadataContainer = new ComponentModuleMetadataContainer(moduleIdentifierFactory); + } + + @Override + public void module(Object moduleNotation, Action rule) { + rule.execute(moduleMetadataContainer.module(moduleNotation)); + } + + @Override + public ModuleReplacementsData getModuleReplacements() { + return moduleMetadataContainer; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/dsl/DefaultRepositoryHandler.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/dsl/DefaultRepositoryHandler.java new file mode 100644 index 0000000..11da50f --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/dsl/DefaultRepositoryHandler.java @@ -0,0 +1,274 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.dsl; + +import com.google.common.collect.Lists; +import groovy.lang.Closure; +import org.gradle.api.Action; +import org.gradle.api.InvalidUserCodeException; +import org.gradle.api.artifacts.dsl.RepositoryHandler; +import org.gradle.api.artifacts.repositories.ArtifactRepository; +import org.gradle.api.artifacts.repositories.ExclusiveContentRepository; +import org.gradle.api.artifacts.repositories.FlatDirectoryArtifactRepository; +import org.gradle.api.artifacts.repositories.InclusiveRepositoryContentDescriptor; +import org.gradle.api.artifacts.repositories.IvyArtifactRepository; +import org.gradle.api.artifacts.repositories.MavenArtifactRepository; +import org.gradle.api.artifacts.repositories.RepositoryContentDescriptor; +import org.gradle.api.internal.CollectionCallbackActionDecorator; +import org.gradle.api.internal.ConfigureByMapAction; +import org.gradle.api.internal.artifacts.BaseRepositoryFactory; +import org.gradle.api.internal.artifacts.DefaultArtifactRepositoryContainer; +import org.gradle.internal.Actions; +import org.gradle.internal.Cast; +import org.gradle.internal.Factory; +import org.gradle.internal.deprecation.DeprecationLogger; +import org.gradle.internal.reflect.Instantiator; +import org.gradle.util.internal.ConfigureUtil; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static org.gradle.util.internal.CollectionUtils.flattenCollections; + +public class DefaultRepositoryHandler extends DefaultArtifactRepositoryContainer implements RepositoryHandlerInternal { + + public static final String GRADLE_PLUGIN_PORTAL_REPO_NAME = "Gradle Central Plugin Repository"; + public static final String DEFAULT_BINTRAY_JCENTER_REPO_NAME = "BintrayJCenter"; + public static final String BINTRAY_JCENTER_URL = "https://jcenter.bintray.com/"; + public static final String GOOGLE_REPO_NAME = "Google"; + + public static final String FLAT_DIR_DEFAULT_NAME = "flatDir"; + private static final String MAVEN_REPO_DEFAULT_NAME = "maven"; + private static final String IVY_REPO_DEFAULT_NAME = "ivy"; + + private final BaseRepositoryFactory repositoryFactory; + private final Instantiator instantiator; + private boolean exclusiveContentInUse = false; + + public DefaultRepositoryHandler(BaseRepositoryFactory repositoryFactory, Instantiator instantiator, CollectionCallbackActionDecorator decorator) { + super(instantiator, decorator); + this.repositoryFactory = repositoryFactory; + this.instantiator = instantiator; + } + + @Override + public FlatDirectoryArtifactRepository flatDir(Action action) { + return addRepository(repositoryFactory.createFlatDirRepository(), FLAT_DIR_DEFAULT_NAME, action); + } + + @Override + @SuppressWarnings("rawtypes") + public FlatDirectoryArtifactRepository flatDir(Closure configureClosure) { + return flatDir(ConfigureUtil.configureUsing(configureClosure)); + } + + @Override + public FlatDirectoryArtifactRepository flatDir(Map args) { + Map modifiedArgs = new HashMap<>(args); + if (modifiedArgs.containsKey("dirs")) { + modifiedArgs.put("dirs", flattenCollections(modifiedArgs.get("dirs"))); + } + return flatDir(new ConfigureByMapAction<>(modifiedArgs)); + } + + @Override + public ArtifactRepository gradlePluginPortal() { + return addRepository(repositoryFactory.createGradlePluginPortal(), GRADLE_PLUGIN_PORTAL_REPO_NAME); + } + + @Override + public ArtifactRepository gradlePluginPortal(Action action) { + return addRepository(repositoryFactory.createGradlePluginPortal(), GRADLE_PLUGIN_PORTAL_REPO_NAME, action); + } + + @Override + public MavenArtifactRepository mavenCentral() { + return addRepository(repositoryFactory.createMavenCentralRepository(), DEFAULT_MAVEN_CENTRAL_REPO_NAME); + } + + @Override + public MavenArtifactRepository mavenCentral(Action action) { + return addRepository(repositoryFactory.createMavenCentralRepository(), DEFAULT_MAVEN_CENTRAL_REPO_NAME, action); + } + + @Deprecated + @Override + public MavenArtifactRepository jcenter() { + deprecateJCenter("jcenter()", "mavenCentral()"); + return addRepository(repositoryFactory.createJCenterRepository(), DEFAULT_BINTRAY_JCENTER_REPO_NAME); + } + + @Deprecated + @Override + public MavenArtifactRepository jcenter(Action action) { + deprecateJCenter("jcenter(Action)", "mavenCentral(Action"); + return addRepository(repositoryFactory.createJCenterRepository(), DEFAULT_BINTRAY_JCENTER_REPO_NAME, action); + } + + private void deprecateJCenter(String method, String replacement) { + DeprecationLogger.deprecateMethod(RepositoryHandler.class, method) + .withAdvice("JFrog announced JCenter's sunset in February 2021. Use " + replacement + " instead.") + .willBeRemovedInGradle8() + .withUpgradeGuideSection(6, "jcenter_deprecation") + .nagUser(); + } + + @Override + public MavenArtifactRepository mavenCentral(Map args) { + Map modifiedArgs = new HashMap<>(args); + return addRepository(repositoryFactory.createMavenCentralRepository(), DEFAULT_MAVEN_CENTRAL_REPO_NAME, new ConfigureByMapAction<>(modifiedArgs)); + } + + @Override + public MavenArtifactRepository mavenLocal() { + return addRepository(repositoryFactory.createMavenLocalRepository(), DEFAULT_MAVEN_LOCAL_REPO_NAME); + } + + @Override + public MavenArtifactRepository mavenLocal(Action action) { + return addRepository(repositoryFactory.createMavenLocalRepository(), DEFAULT_MAVEN_LOCAL_REPO_NAME, action); + } + + @Override + public MavenArtifactRepository google() { + return addRepository(repositoryFactory.createGoogleRepository(), GOOGLE_REPO_NAME); + } + + @Override + public MavenArtifactRepository google(Action action) { + return addRepository(repositoryFactory.createGoogleRepository(), GOOGLE_REPO_NAME, action); + } + + @Override + public MavenArtifactRepository maven(Action action) { + return addRepository(repositoryFactory.createMavenRepository(), MAVEN_REPO_DEFAULT_NAME, action); + } + + @Override + @SuppressWarnings("rawtypes") + public MavenArtifactRepository maven(Closure closure) { + return maven(ConfigureUtil.configureUsing(closure)); + } + + @Override + public IvyArtifactRepository ivy(Action action) { + return addRepository(repositoryFactory.createIvyRepository(), IVY_REPO_DEFAULT_NAME, action); + } + + @Override + @SuppressWarnings("rawtypes") + public IvyArtifactRepository ivy(Closure closure) { + return ivy(ConfigureUtil.configureUsing(closure)); + } + + @Override + public void exclusiveContent(Action action) { + ExclusiveContentRepositorySpec spec = Cast.uncheckedCast(instantiator.newInstance(ExclusiveContentRepositorySpec.class, this)); + spec.apply(action); + exclusiveContentInUse = true; + } + + @Override + public boolean isExclusiveContentInUse() { + return exclusiveContentInUse; + } + + private static Action transformForExclusivity(Action config) { + return desc -> config.execute(new InclusiveRepositoryContentDescriptor() { + @Override + public void includeGroup(String group) { + desc.excludeGroup(group); + } + + @Override + public void includeGroupByRegex(String groupRegex) { + desc.excludeGroupByRegex(groupRegex); + } + + @Override + public void includeModule(String group, String moduleName) { + desc.excludeModule(group, moduleName); + } + + @Override + public void includeModuleByRegex(String groupRegex, String moduleNameRegex) { + desc.excludeModuleByRegex(groupRegex, moduleNameRegex); + } + + @Override + public void includeVersion(String group, String moduleName, String version) { + desc.excludeVersion(group, moduleName, version); + } + + @Override + public void includeVersionByRegex(String groupRegex, String moduleNameRegex, String versionRegex) { + desc.excludeVersionByRegex(groupRegex, moduleNameRegex, versionRegex); + } + }); + } + + public static class ExclusiveContentRepositorySpec implements ExclusiveContentRepository { + private final RepositoryHandler repositories; + private final List> forRepositories = Lists.newArrayListWithExpectedSize(2); + private Action filter; + + public ExclusiveContentRepositorySpec(RepositoryHandler repositories) { + this.repositories = repositories; + } + + @Override + public ExclusiveContentRepository forRepository(Factory repositoryProducer) { + forRepositories.add(repositoryProducer); + return this; + } + + @Override + public ExclusiveContentRepository forRepositories(ArtifactRepository... repositories) { + Stream.of(repositories).forEach(r -> forRepositories.add(() -> r)); + return this; + } + + @Override + public ExclusiveContentRepository filter(Action config) { + filter = filter == null ? config : Actions.composite(filter, config); + return this; + } + + void apply(Action action) { + action.execute(this); + if (forRepositories.isEmpty()) { + throw new InvalidUserCodeException("You must declare the repository using forRepository { ... }"); + } + if (filter == null) { + throw new InvalidUserCodeException("You must specify the filter for the repository using filter { ... }"); + } + Set targetRepositories = forRepositories.stream().map(Factory::create).collect(Collectors.toSet()); + Action forExclusivity = transformForExclusivity(filter); + this.repositories.all(repo -> { + if (targetRepositories.contains(repo)) { + repo.content(filter); + } else { + repo.content(forExclusivity); + } + }); + } + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/dsl/MetadataDescriptorFactory.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/dsl/MetadataDescriptorFactory.java new file mode 100644 index 0000000..99e2a0e --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/dsl/MetadataDescriptorFactory.java @@ -0,0 +1,60 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.dsl; + +import org.gradle.api.artifacts.ivy.IvyModuleDescriptor; +import org.gradle.api.artifacts.maven.PomModuleDescriptor; +import org.gradle.api.internal.artifacts.DefaultPomModuleDescriptor; +import org.gradle.api.internal.artifacts.ivyservice.DefaultIvyModuleDescriptor; +import org.gradle.internal.component.external.model.ModuleComponentResolveMetadata; +import org.gradle.internal.component.external.model.ivy.IvyModuleResolveMetadata; +import org.gradle.internal.component.external.model.maven.MavenModuleResolveMetadata; + +class MetadataDescriptorFactory { + + private final ModuleComponentResolveMetadata metadata; + + public MetadataDescriptorFactory(ModuleComponentResolveMetadata metadata) { + this.metadata = metadata; + } + + public T createDescriptor(Class descriptorClass) { + if (isIvyMetadata(descriptorClass, metadata)) { + IvyModuleResolveMetadata ivyMetadata = (IvyModuleResolveMetadata) metadata; + IvyModuleDescriptor descriptor = new DefaultIvyModuleDescriptor(ivyMetadata.getExtraAttributes(), ivyMetadata.getBranch(), ivyMetadata.getStatus()); + return descriptorClass.cast(descriptor); + } else if (isPomMetadata(descriptorClass, metadata)) { + MavenModuleResolveMetadata mavenMetadata = (MavenModuleResolveMetadata) metadata; + PomModuleDescriptor descriptor = new DefaultPomModuleDescriptor(mavenMetadata); + return descriptorClass.cast(descriptor); + } + return null; + } + + public static boolean isMatchingMetadata(Class descriptor, ModuleComponentResolveMetadata metadata) { + return isPomMetadata(descriptor, metadata) || isIvyMetadata(descriptor, metadata); + } + + private static boolean isIvyMetadata(Class descriptor, ModuleComponentResolveMetadata metadata) { + return IvyModuleDescriptor.class.isAssignableFrom(descriptor) && metadata instanceof IvyModuleResolveMetadata; + } + + private static boolean isPomMetadata(Class descriptor, ModuleComponentResolveMetadata metadata) { + return PomModuleDescriptor.class.isAssignableFrom(descriptor) && metadata instanceof MavenModuleResolveMetadata; + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/dsl/dependencies/DependencyLockingState.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/dsl/dependencies/DependencyLockingState.java new file mode 100644 index 0000000..16c0731 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/dsl/dependencies/DependencyLockingState.java @@ -0,0 +1,52 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.dsl.dependencies; + +import org.gradle.api.artifacts.component.ModuleComponentIdentifier; + +import java.util.Set; + +/** + * Describes the lock state for a given configuration. + */ +public interface DependencyLockingState { + + /** + * Indicates if the lock state must be strictly validated. + * + * If {@code true}, each locked dependency is added as a strict constraint, + * and the resolution result must exactly match the set of locked dependencies. + * + * If {@code false}, each locked dependency is added a regular (lenient) constraint, + * and the resolution result is not verified against the set of locked dependencies. + * + * @return {@code true} if lock state was found, {@code false} otherwise + */ + boolean mustValidateLockState(); + + /** + * Returns the set of locking constraints found. + * Note that an empty set can mean either that lock state was not defined or that lock state is an empty set. + * Disambiguation can be done by calling {@link #mustValidateLockState()}. + * + * @return The set of module versions to lock. + * @see #mustValidateLockState() + */ + Set getLockedDependencies(); + + LockEntryFilter getIgnoredEntryFilter(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/dependencysubstitution/ModuleSelectorStringNotationConverter.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/dependencysubstitution/ModuleSelectorStringNotationConverter.java new file mode 100644 index 0000000..a471010 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/dependencysubstitution/ModuleSelectorStringNotationConverter.java @@ -0,0 +1,67 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.ivyservice.dependencysubstitution; + +import org.gradle.api.artifacts.component.ComponentSelector; +import org.gradle.api.internal.artifacts.ImmutableModuleIdentifierFactory; +import org.gradle.api.internal.artifacts.dependencies.DefaultImmutableVersionConstraint; +import org.gradle.internal.component.external.model.DefaultModuleComponentSelector; +import org.gradle.internal.exceptions.DiagnosticsVisitor; +import org.gradle.internal.typeconversion.TypedNotationConverter; +import org.gradle.internal.typeconversion.UnsupportedNotationException; +import org.gradle.util.internal.GUtil; + +import static org.gradle.api.internal.notations.ModuleNotationValidation.*; + +public class ModuleSelectorStringNotationConverter extends TypedNotationConverter { + private final ImmutableModuleIdentifierFactory moduleIdentifierFactory; + + public ModuleSelectorStringNotationConverter(ImmutableModuleIdentifierFactory moduleIdentifierFactory) { + super(String.class); + this.moduleIdentifierFactory = moduleIdentifierFactory; + } + + /** + * Empty String for either group or module name is not allowed. + */ + @Override + protected ComponentSelector parseType(String notation) { + assert notation != null; + String[] split = notation.split(":"); + + if (split.length < 2 || split.length > 3) { + throw new UnsupportedNotationException(notation); + } + String group = validate(split[0].trim(), notation); + String name = validate(split[1].trim(), notation); + + if (split.length == 2) { + return new UnversionedModuleComponentSelector(moduleIdentifierFactory.module(group, name)); + } + String version = split[2].trim(); + if (!GUtil.isTrue(version)) { + throw new UnsupportedNotationException(notation); + } + return DefaultModuleComponentSelector.newSelector(moduleIdentifierFactory.module(group, name), DefaultImmutableVersionConstraint.of(version)); + } + + @Override + public void describe(DiagnosticsVisitor visitor) { + visitor.candidate("String describing the module in 'group:name' format").example("'org.gradle:gradle-core'."); + visitor.candidate("String describing the selector in 'group:name:version' format").example("'org.gradle:gradle-core:1.+'."); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/ivyresolve/parser/BuildableIvyArtifact.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/ivyresolve/parser/BuildableIvyArtifact.java new file mode 100644 index 0000000..1bcac00 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/ivyresolve/parser/BuildableIvyArtifact.java @@ -0,0 +1,46 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser; + +import org.gradle.internal.component.model.DefaultIvyArtifactName; +import org.gradle.internal.component.model.IvyArtifactName; + +import java.util.LinkedHashSet; +import java.util.Set; + +class BuildableIvyArtifact { + + private final IvyArtifactName ivyArtifactName; + private final Set configurations = new LinkedHashSet<>(); + + public BuildableIvyArtifact(String name, String type, String ext, String classifier) { + this.ivyArtifactName = new DefaultIvyArtifactName(name, type, ext, classifier); + } + + public BuildableIvyArtifact addConfiguration(String confName) { + configurations.add(confName); + return this; + } + + public IvyArtifactName getArtifact() { + return ivyArtifactName; + } + + public Set getConfigurations() { + return configurations; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/ivyresolve/parser/PomReader.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/ivyresolve/parser/PomReader.java new file mode 100644 index 0000000..cd2a0f1 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/ivyresolve/parser/PomReader.java @@ -0,0 +1,735 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser; + +import com.google.common.collect.Lists; +import org.apache.commons.io.IOUtils; +import org.apache.ivy.core.IvyPatternHelper; +import org.gradle.api.artifacts.ModuleIdentifier; +import org.gradle.api.artifacts.ModuleVersionIdentifier; +import org.gradle.api.internal.artifacts.DefaultModuleVersionIdentifier; +import org.gradle.api.internal.artifacts.ImmutableModuleIdentifierFactory; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.data.MavenDependencyKey; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.data.PomDependencyMgt; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.data.PomProfile; +import org.gradle.internal.UncheckedException; +import org.gradle.internal.classloader.ClassLoaderUtils; +import org.gradle.internal.resource.local.LocallyAvailableExternalResource; +import org.w3c.dom.Comment; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.EntityResolver; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.SAXParseException; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import static org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.PomDomParser.AddDTDFilterInputStream; +import static org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.PomDomParser.getAllChilds; +import static org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.PomDomParser.getFirstChildElement; +import static org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.PomDomParser.getFirstChildText; +import static org.gradle.api.internal.artifacts.ivyservice.ivyresolve.parser.PomDomParser.getTextContent; + +/** + * Copied from org.apache.ivy.plugins.parser.m2.PomReader. + */ +public class PomReader implements PomParent { + + private static final String PACKAGING = "packaging"; + private static final String DEPENDENCY = "dependency"; + private static final String DEPENDENCIES = "dependencies"; + private static final String DEPENDENCY_MGT = "dependencyManagement"; + private static final String PROJECT = "project"; + private static final String MODEL = "model"; + private static final String GROUP_ID = "groupId"; + private static final String ARTIFACT_ID = "artifactId"; + private static final String VERSION = "version"; + private static final String DESCRIPTION = "description"; + private static final String PARENT = "parent"; + private static final String SCOPE = "scope"; + private static final String CLASSIFIER = "classifier"; + private static final String OPTIONAL = "optional"; + private static final String EXCLUSIONS = "exclusions"; + private static final String EXCLUSION = "exclusion"; + private static final String DISTRIBUTION_MGT = "distributionManagement"; + private static final String RELOCATION = "relocation"; + private static final String PROPERTIES = "properties"; + private static final String TYPE = "type"; + private static final String PROFILES = "profiles"; + private static final String PROFILE = "profile"; + private static final String PROFILE_ID = "id"; + private static final String PROFILE_ACTIVATION = "activation"; + private static final String PROFILE_ACTIVATION_ACTIVE_BY_DEFAULT = "activeByDefault"; + private static final String PROFILE_ACTIVATION_PROPERTY = "property"; + private static final byte[] M2_ENTITIES_RESOURCE; + private static final DocumentBuilderFactory DOCUMENT_BUILDER_FACTORY; + + static { + byte[] bytes; + try { + bytes = IOUtils.toByteArray(org.apache.ivy.plugins.parser.m2.PomReader.class.getResourceAsStream("m2-entities.ent")); + } catch (IOException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + M2_ENTITIES_RESOURCE = bytes; + + // Set the context classloader the bootstrap classloader, to work around the way that JAXP locates implementation classes + // This should ensure that the JAXP classes provided by the JVM are used, rather than some other implementation + ClassLoader original = Thread.currentThread().getContextClassLoader(); + Thread.currentThread().setContextClassLoader(ClassLoaderUtils.getPlatformClassLoader()); + try { + DOCUMENT_BUILDER_FACTORY = DocumentBuilderFactory.newInstance(); + DOCUMENT_BUILDER_FACTORY.setValidating(false); + } finally { + Thread.currentThread().setContextClassLoader(original); + } + } + + private static final EntityResolver M2_ENTITY_RESOLVER = new EntityResolver() { + @Override + public InputSource resolveEntity(String publicId, String systemId) { + if ((systemId != null) && systemId.endsWith("m2-entities.ent")) { + return new InputSource(new ByteArrayInputStream(M2_ENTITIES_RESOURCE)); + } + return null; + } + }; + + private PomParent pomParent = new RootPomParent(); + private final Map pomProperties = new HashMap<>(); + private final Map effectiveProperties = new HashMap<>(); + private List declaredDependencyMgts; + private List declaredActivePomProfiles; + private Map resolvedDependencyMgts; + private final Map importedDependencyMgts = new LinkedHashMap<>(); + private Map resolvedDependencies; + private final ImmutableModuleIdentifierFactory moduleIdentifierFactory; + + private final Element projectElement; + private final Element parentElement; + + public PomReader(final LocallyAvailableExternalResource resource, ImmutableModuleIdentifierFactory moduleIdentifierFactory, Map childPomProperties) throws SAXException { + this.moduleIdentifierFactory = moduleIdentifierFactory; + setPomProperties(childPomProperties); + final String systemId = resource.getFile().toURI().toASCIIString(); + Document pomDomDoc = resource.withContent(inputStream -> { + try { + return parseToDom(inputStream, systemId); + } catch (Exception e) { + throw new MetaDataParseException("POM", resource, e); + } + }).getResult(); + projectElement = pomDomDoc.getDocumentElement(); + if (!PROJECT.equals(projectElement.getNodeName()) && !MODEL.equals(projectElement.getNodeName())) { + throw new SAXParseException("project must be the root tag", systemId, systemId, 0, 0); + } + parentElement = getFirstChildElement(projectElement, PARENT); + + setDefaultParentGavProperties(); + setPomProperties(parseProperties(projectElement)); + setActiveProfileProperties(); + } + + public PomReader(final LocallyAvailableExternalResource resource, ImmutableModuleIdentifierFactory moduleIdentifierFactory) throws SAXException { + this(resource, moduleIdentifierFactory, Collections.emptyMap()); + } + + public void setPomParent(PomParent pomParent) { + this.pomParent = pomParent; + for (Map.Entry entry : pomParent.getProperties().entrySet()) { + maybeSetEffectiveProperty(entry.getKey(), entry.getValue()); + } + } + + private void setDefaultParentGavProperties() { + maybeSetGavProperties(GavProperty.PARENT_GROUP_ID, getParentGroupId()); + maybeSetGavProperties(GavProperty.PARENT_VERSION, getParentVersion()); + maybeSetGavProperties(GavProperty.PARENT_ARTIFACT_ID, getParentArtifactId()); + } + + private void maybeSetGavProperties(GavProperty gavProperty, String propertyValue) { + for (String name : gavProperty.getNames()) { + maybeSetEffectiveProperty(name, propertyValue); + } + } + + private void setPomProperties(Map pomProperties) { + if (!pomProperties.isEmpty()) { + this.pomProperties.putAll(pomProperties); + for (Map.Entry pomProperty : pomProperties.entrySet()) { + maybeSetEffectiveProperty(pomProperty.getKey(), pomProperty.getValue()); + } + } + } + + /** + * Sets properties for all active profiles. Properties from an active profile override existing POM properties. + */ + private void setActiveProfileProperties() { + for (PomProfile activePomProfile : parseActivePomProfiles()) { + for (Map.Entry property : activePomProfile.getProperties().entrySet()) { + effectiveProperties.put(property.getKey(), property.getValue()); + } + } + } + + /** + * Add a property if not yet set and value is not null. + * This guarantee that property keep the first value that is put on it and that the properties + * are never null. + */ + private void maybeSetEffectiveProperty(String prop, String val) { + if (!effectiveProperties.containsKey(prop) && val != null) { + effectiveProperties.put(prop, val); + } + } + + private enum GavProperty { + PARENT_GROUP_ID("parent.groupId", "project.parent.groupId"), + PARENT_ARTIFACT_ID("parent.artifactId", "project.parent.artifactId"), + PARENT_VERSION("parent.version", "project.parent.version"), + GROUP_ID("project.groupId", "pom.groupId", "groupId"), + ARTIFACT_ID("project.artifactId", "pom.artifactId", "artifactId"), + VERSION("project.version", "pom.version", "version"); + + private final String[] names; + + GavProperty(String... names) { + this.names = names; + } + + public String[] getNames() { + return names; + } + } + + @Override + public String toString() { + return projectElement.getOwnerDocument().getDocumentURI(); + } + + private static DocumentBuilder getDocBuilder(EntityResolver entityResolver) { + try { + DocumentBuilder docBuilder = DOCUMENT_BUILDER_FACTORY.newDocumentBuilder(); + if (entityResolver != null) { + docBuilder.setEntityResolver(entityResolver); + } + return docBuilder; + } catch (ParserConfigurationException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + + private static Document parseToDom(InputStream stream, String systemId) throws IOException, SAXException { + // Set the context classloader the bootstrap classloader, to work around the way that JAXP locates implementation classes + // This should ensure that the JAXP classes provided by the JVM are used, rather than some other implementation + ClassLoader original = Thread.currentThread().getContextClassLoader(); + Thread.currentThread().setContextClassLoader(ClassLoaderUtils.getPlatformClassLoader()); + try { + InputStream dtdStream = new AddDTDFilterInputStream(stream); + return getDocBuilder(M2_ENTITY_RESOLVER).parse(dtdStream, systemId); + } finally { + Thread.currentThread().setContextClassLoader(original); + } + } + + public boolean hasParent() { + return parentElement != null; + } + + @Override + public Map getProperties() { + return effectiveProperties; + } + + public void addImportedDependencyMgts(Map inherited) { + if (resolvedDependencyMgts != null) { + throw new IllegalStateException("Cannot add imported dependency management elements after dependency management elements have been resolved for this POM."); + } + importedDependencyMgts.putAll(inherited); + } + + private void checkNotNull(String value, String name) { + checkNotNull(value, name, null); + } + + private void checkNotNull(String value, String name, String element) { + if (value == null) { + String attributeName = element == null ? name : element + " " + name; + throw new RuntimeException("Missing required attribute: " + attributeName); + } + } + + public String getGroupId() { + String groupId = getFirstChildText(projectElement, GROUP_ID); + if (groupId == null) { + groupId = getFirstChildText(parentElement, GROUP_ID); + } + checkNotNull(groupId, GROUP_ID); + return replaceProps(groupId); + } + + public String getParentGroupId() { + String groupId = getFirstChildText(parentElement, GROUP_ID); + if (groupId == null) { + groupId = getFirstChildText(projectElement, GROUP_ID); + } + checkNotNull(groupId, GROUP_ID); + return replaceProps(groupId); + } + + public String getArtifactId() { + String val = getFirstChildText(projectElement, ARTIFACT_ID); + if (val == null) { + val = getFirstChildText(parentElement, ARTIFACT_ID); + } + checkNotNull(val, ARTIFACT_ID); + return replaceProps(val); + } + + public String getParentArtifactId() { + String val = getFirstChildText(parentElement, ARTIFACT_ID); + if (val == null) { + val = getFirstChildText(projectElement, ARTIFACT_ID); + } + checkNotNull(val, ARTIFACT_ID); + return replaceProps(val); + } + + public String getVersion() { + String val = getFirstChildText(projectElement, VERSION); + if (val == null) { + val = getFirstChildText(parentElement, VERSION); + } + return replaceProps(val); + } + + public String getParentVersion() { + String val = getFirstChildText(parentElement, VERSION); + if (val == null) { + val = getFirstChildText(projectElement, VERSION); + } + return replaceProps(val); + } + + public String getPackaging() { + String val = getFirstChildText(projectElement, PACKAGING); + if (val == null) { + val = "jar"; + } + return replaceProps(val); + } + + public boolean hasGradleMetadataMarker() { + NodeList childNodes = projectElement.getChildNodes(); + for (int i = 0; i < childNodes.getLength(); i++) { + Node node = childNodes.item(i); + if (node instanceof Comment) { + String comment = node.getNodeValue(); + if (comment.contains(MetaDataParser.GRADLE_6_METADATA_MARKER) || comment.contains(MetaDataParser.GRADLE_METADATA_MARKER)) { + return true; + } + } + } + return false; + } + + public ModuleVersionIdentifier getRelocation() { + Element distrMgt = getFirstChildElement(projectElement, DISTRIBUTION_MGT); + Element relocation = getFirstChildElement(distrMgt, RELOCATION); + if (relocation == null) { + return null; + } else { + String relocGroupId = getFirstChildText(relocation, GROUP_ID); + String relocArtId = getFirstChildText(relocation, ARTIFACT_ID); + String relocVersion = getFirstChildText(relocation, VERSION); + relocGroupId = relocGroupId == null ? getGroupId() : relocGroupId; + relocArtId = relocArtId == null ? getArtifactId() : relocArtId; + relocVersion = relocVersion == null ? getVersion() : relocVersion; + return DefaultModuleVersionIdentifier.newId(relocGroupId, relocArtId, relocVersion); + } + } + + /** + * Returns all dependencies for this POM, including those inherited from parent POMs. + */ + @Override + public Map getDependencies() { + if (resolvedDependencies == null) { + resolvedDependencies = resolveDependencies(); + } + return resolvedDependencies; + } + + private Map resolveDependencies() { + Map dependencies = new LinkedHashMap<>(); + + for (PomDependencyData dependency : getDependencyData(projectElement)) { + dependencies.put(dependency.getId(), dependency); + } + + // Maven adds inherited dependencies last + for (Map.Entry entry : pomParent.getDependencies().entrySet()) { + if (!dependencies.containsKey(entry.getKey())) { + dependencies.put(entry.getKey(), entry.getValue()); + } + } + + for (PomProfile pomProfile : parseActivePomProfiles()) { + for (PomDependencyData dependency : pomProfile.getDependencies()) { + dependencies.put(dependency.getId(), dependency); + } + } + + return dependencies; + } + + private List getDependencyData(Element parentElement) { + List depElements = new ArrayList<>(); + Element dependenciesElement = getFirstChildElement(parentElement, DEPENDENCIES); + if (dependenciesElement != null) { + NodeList childs = dependenciesElement.getChildNodes(); + for (int i = 0; i < childs.getLength(); i++) { + Node node = childs.item(i); + if (node instanceof Element && DEPENDENCY.equals(node.getNodeName())) { + depElements.add(new PomDependencyData((Element) node)); + } + } + } + + return depElements; + } + + /** + * Returns all dependency management elements for this POM, including those inherited from parent and imported POMs. + */ + @Override + public Map getDependencyMgt() { + if (resolvedDependencyMgts == null) { + resolvedDependencyMgts = resolveDependencyMgt(); + } + return resolvedDependencyMgts; + } + + private Map resolveDependencyMgt() { + Map dependencies = new LinkedHashMap<>(); + dependencies.putAll(pomParent.getDependencyMgt()); + dependencies.putAll(importedDependencyMgts); + for (PomDependencyMgt dependencyMgt : parseDependencyMgt()) { + dependencies.put(dependencyMgt.getId(), dependencyMgt); + } + return dependencies; + } + + /** + * Parses the dependency management elements declared in this POM without removing the duplicates. + * + * @return Parsed dependency management elements + */ + public List parseDependencyMgt() { + if (declaredDependencyMgts == null) { + List dependencyMgts = getDependencyMgt(projectElement); + + for (PomProfile pomProfile : parseActivePomProfiles()) { + dependencyMgts.addAll(pomProfile.getDependencyMgts()); + } + + declaredDependencyMgts = dependencyMgts; + } + + return declaredDependencyMgts; + } + + private List getDependencyMgt(Element parentElement) { + List depMgmtElements = new ArrayList<>(); + Element dependenciesElement = getFirstChildElement(parentElement, DEPENDENCY_MGT); + dependenciesElement = getFirstChildElement(dependenciesElement, DEPENDENCIES); + + if (dependenciesElement != null) { + NodeList childs = dependenciesElement.getChildNodes(); + for (int i = 0; i < childs.getLength(); i++) { + Node node = childs.item(i); + if (node instanceof Element && DEPENDENCY.equals(node.getNodeName())) { + depMgmtElements.add(new PomDependencyMgtElement((Element) node)); + } + } + } + + return depMgmtElements; + } + + @Override + public PomDependencyMgt findDependencyDefaults(MavenDependencyKey dependencyKey) { + return getDependencyMgt().get(dependencyKey); + } + + public void resolveGAV() { + setGavPropertyValue(GavProperty.GROUP_ID, getGroupId()); + setGavPropertyValue(GavProperty.ARTIFACT_ID, getArtifactId()); + setGavPropertyValue(GavProperty.VERSION, getVersion()); + } + + private void setGavPropertyValue(GavProperty gavProperty, String propertyValue) { + for (String name : gavProperty.getNames()) { + effectiveProperties.put(name, propertyValue); + } + } + + public class PomDependencyMgtElement implements PomDependencyMgt { + private final Element depElement; + + PomDependencyMgtElement(Element depElement) { + this.depElement = depElement; + } + + @Override + public MavenDependencyKey getId() { + return new MavenDependencyKey(getGroupId(), getArtifactId(), getType(), getClassifier()); + } + + /* (non-Javadoc) + * @see org.apache.ivy.plugins.parser.m2.PomDependencyMgt#getGroupId() + */ + @Override + public String getGroupId() { + String val = getFirstChildText(depElement, GROUP_ID); + checkNotNull(val, GROUP_ID, DEPENDENCY); + return replaceProps(val); + } + + /* (non-Javadoc) + * @see org.apache.ivy.plugins.parser.m2.PomDependencyMgt#getArtifactId() + */ + @Override + public String getArtifactId() { + String val = getFirstChildText(depElement, ARTIFACT_ID); + checkNotNull(val, ARTIFACT_ID, DEPENDENCY); + return replaceProps(val); + } + + /* (non-Javadoc) + * @see org.apache.ivy.plugins.parser.m2.PomDependencyMgt#getVersion() + */ + @Override + public String getVersion() { + String val = getFirstChildText(depElement, VERSION); + return replaceProps(val); + } + + @Override + public String getScope() { + String val = getFirstChildText(depElement, SCOPE); + return replaceProps(val); + } + + @Override + public String getType() { + String val = getFirstChildText(depElement, TYPE); + val = replaceProps(val); + + if (val == null) { + val = "jar"; + } + + return val; + } + + @Override + public String getClassifier() { + String val = getFirstChildText(depElement, CLASSIFIER); + return replaceProps(val); + } + + @Override + public List getExcludedModules() { + Element exclusionsElement = getFirstChildElement(depElement, EXCLUSIONS); + if (exclusionsElement != null) { + NodeList childs = exclusionsElement.getChildNodes(); + List exclusions = Lists.newArrayList(); + for (int i = 0; i < childs.getLength(); i++) { + Node node = childs.item(i); + if (node instanceof Element && EXCLUSION.equals(node.getNodeName())) { + String groupId = getFirstChildText((Element) node, GROUP_ID); + String artifactId = getFirstChildText((Element) node, ARTIFACT_ID); + if ((groupId != null) || (artifactId != null)) { + exclusions.add(moduleIdentifierFactory.module(groupId != null ? groupId : "*", artifactId != null ? artifactId : "*")); + } + } + } + return exclusions; + } + return Collections.emptyList(); + } + } + + public class PomDependencyData extends PomDependencyMgtElement { + private final Element depElement; + + PomDependencyData(Element depElement) { + super(depElement); + this.depElement = depElement; + } + + public boolean isOptional() { + Element e = getFirstChildElement(depElement, OPTIONAL); + return (e != null) && "true".equalsIgnoreCase(getTextContent(e)); + } + } + + public class PomProfileElement implements PomProfile { + private final Element element; + private List declaredDependencyMgts; + private List declaredDependencies; + + PomProfileElement(Element element) { + this.element = element; + } + + @Override + public String getId() { + return getFirstChildText(element, PROFILE_ID); + } + + @Override + public Map getProperties() { + return parseProperties(element); + } + + @Override + public List getDependencyMgts() { + if (declaredDependencyMgts == null) { + declaredDependencyMgts = getDependencyMgt(element); + } + + return declaredDependencyMgts; + } + + @Override + public List getDependencies() { + if (declaredDependencies == null) { + declaredDependencies = getDependencyData(element); + } + + return declaredDependencies; + } + } + + /** + * Parses all active profiles that can be found in POM. + * + * @return Active POM profiles + */ + private List parseActivePomProfiles() { + if (declaredActivePomProfiles == null) { + List activeByDefaultPomProfiles = new ArrayList<>(); + List activeByAbsenceOfPropertyPomProfiles = new ArrayList<>(); + Element profilesElement = getFirstChildElement(projectElement, PROFILES); + + if (profilesElement != null) { + for (Element profileElement : getAllChilds(profilesElement)) { + if (PROFILE.equals(profileElement.getNodeName())) { + Element activationElement = getFirstChildElement(profileElement, PROFILE_ACTIVATION); + + if (activationElement != null) { + String activeByDefault = getFirstChildText(activationElement, PROFILE_ACTIVATION_ACTIVE_BY_DEFAULT); + + if ("true".equals(activeByDefault)) { + activeByDefaultPomProfiles.add(new PomProfileElement(profileElement)); + } else { + Element propertyElement = getFirstChildElement(activationElement, PROFILE_ACTIVATION_PROPERTY); + + if (propertyElement != null) { + if (isActivationPropertyActivated(propertyElement)) { + activeByAbsenceOfPropertyPomProfiles.add(new PomProfileElement(profileElement)); + } + } + } + } + } + } + } + + declaredActivePomProfiles = determineActiveProfiles(activeByDefaultPomProfiles, activeByAbsenceOfPropertyPomProfiles); + } + + return declaredActivePomProfiles; + } + + /** + * If a profile is identified as active through any other activation method than activeByDefault, none of the existing + * profiles marked as activeByDefault apply. + * + * @param activeByDefaultPomProfiles Parsed profiles that are active by default + * @param activeByAbsenceOfPropertyPomProfiles Parsed profiles that are activated by absence of property + * @return List of active profiles that are not activeByDefault + */ + private List determineActiveProfiles(List activeByDefaultPomProfiles, List activeByAbsenceOfPropertyPomProfiles) { + return !activeByAbsenceOfPropertyPomProfiles.isEmpty() ? activeByAbsenceOfPropertyPomProfiles : activeByDefaultPomProfiles; + } + + /** + * Checks if activation property is active through absence of system property. + * + * @param propertyElement Property element + * @return Activation indicator + * @see Maven documentation + */ + private boolean isActivationPropertyActivated(Element propertyElement) { + String propertyName = getFirstChildText(propertyElement, "name"); + return propertyName.startsWith("!"); + } + + /** + * @return properties of both current and children poms. + */ + Map getAllPomProperties() { + return pomProperties; + } + + private Map parseProperties(Element parentElement) { + Map pomProperties = new HashMap<>(); + Element propsEl = getFirstChildElement(parentElement, PROPERTIES); + if (propsEl != null) { + propsEl.normalize(); + } + for (Element prop : getAllChilds(propsEl)) { + pomProperties.put(prop.getNodeName(), getTextContent(prop)); + } + return pomProperties; + } + + private String replaceProps(String val) { + if (val == null) { + return null; + } else { + return IvyPatternHelper.substituteVariables(val, effectiveProperties).trim(); + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/modulecache/ModuleMetadataSerializer.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/modulecache/ModuleMetadataSerializer.java new file mode 100644 index 0000000..9fb1b83 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/modulecache/ModuleMetadataSerializer.java @@ -0,0 +1,762 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.ivyservice.modulecache; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; +import com.google.common.collect.LinkedHashMultimap; +import com.google.common.collect.Lists; +import com.google.common.collect.SetMultimap; +import org.gradle.api.artifacts.component.ModuleComponentIdentifier; +import org.gradle.api.artifacts.component.ModuleComponentSelector; +import org.gradle.api.attributes.AttributeContainer; +import org.gradle.api.capabilities.Capability; +import org.gradle.api.internal.artifacts.DefaultModuleIdentifier; +import org.gradle.api.internal.artifacts.ImmutableModuleIdentifierFactory; +import org.gradle.api.internal.artifacts.ModuleComponentSelectorSerializer; +import org.gradle.api.internal.artifacts.ivyservice.NamespaceId; +import org.gradle.api.internal.artifacts.ivyservice.moduleconverter.dependencies.DefaultExcludeRuleConverter; +import org.gradle.api.internal.artifacts.ivyservice.moduleconverter.dependencies.ExcludeRuleConverter; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.AttributeContainerSerializer; +import org.gradle.api.internal.artifacts.repositories.metadata.IvyMutableModuleMetadataFactory; +import org.gradle.api.internal.artifacts.repositories.metadata.MavenMutableModuleMetadataFactory; +import org.gradle.api.internal.artifacts.repositories.resolver.MavenUniqueSnapshotComponentIdentifier; +import org.gradle.api.internal.attributes.ImmutableAttributes; +import org.gradle.internal.component.external.descriptor.Artifact; +import org.gradle.internal.component.external.descriptor.Configuration; +import org.gradle.internal.component.external.descriptor.DefaultExclude; +import org.gradle.internal.component.external.descriptor.MavenScope; +import org.gradle.internal.component.external.model.CapabilityInternal; +import org.gradle.internal.component.external.model.ComponentVariant; +import org.gradle.internal.component.external.model.DefaultModuleComponentIdentifier; +import org.gradle.internal.component.external.model.DefaultShadowedCapability; +import org.gradle.internal.component.external.model.ExternalDependencyDescriptor; +import org.gradle.internal.component.external.model.ImmutableCapability; +import org.gradle.internal.component.external.model.ModuleComponentResolveMetadata; +import org.gradle.internal.component.external.model.MutableComponentVariant; +import org.gradle.internal.component.external.model.MutableModuleComponentResolveMetadata; +import org.gradle.internal.component.external.model.ShadowedCapability; +import org.gradle.internal.component.external.model.ivy.IvyDependencyDescriptor; +import org.gradle.internal.component.external.model.ivy.IvyModuleResolveMetadata; +import org.gradle.internal.component.external.model.ivy.MutableIvyModuleResolveMetadata; +import org.gradle.internal.component.external.model.maven.MavenDependencyDescriptor; +import org.gradle.internal.component.external.model.maven.MavenDependencyType; +import org.gradle.internal.component.external.model.maven.MavenModuleResolveMetadata; +import org.gradle.internal.component.external.model.maven.MutableMavenModuleResolveMetadata; +import org.gradle.internal.component.model.DefaultIvyArtifactName; +import org.gradle.internal.component.model.Exclude; +import org.gradle.internal.component.model.ExcludeMetadata; +import org.gradle.internal.component.model.IvyArtifactName; +import org.gradle.internal.serialize.Decoder; +import org.gradle.internal.serialize.Encoder; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public class ModuleMetadataSerializer { + private static final byte TYPE_IVY = 1; + private static final byte TYPE_MAVEN = 2; + + private final ModuleComponentSelectorSerializer componentSelectorSerializer; + private final MavenMutableModuleMetadataFactory mavenMetadataFactory; + private final IvyMutableModuleMetadataFactory ivyMetadataFactory; + private final AttributeContainerSerializer attributeContainerSerializer; + private final ModuleSourcesSerializer moduleSourcesSerializer; + + public ModuleMetadataSerializer(AttributeContainerSerializer attributeContainerSerializer, MavenMutableModuleMetadataFactory mavenMetadataFactory, IvyMutableModuleMetadataFactory ivyMetadataFactory, ModuleSourcesSerializer moduleSourcesSerializer) { + this.mavenMetadataFactory = mavenMetadataFactory; + this.ivyMetadataFactory = ivyMetadataFactory; + this.attributeContainerSerializer = attributeContainerSerializer; + this.componentSelectorSerializer = new ModuleComponentSelectorSerializer(attributeContainerSerializer); + this.moduleSourcesSerializer = moduleSourcesSerializer; + } + + public MutableModuleComponentResolveMetadata read(Decoder decoder, ImmutableModuleIdentifierFactory moduleIdentifierFactory, Map deduplicationDependencyCache) throws IOException { + return new Reader(decoder, moduleIdentifierFactory, attributeContainerSerializer, componentSelectorSerializer, mavenMetadataFactory, ivyMetadataFactory, moduleSourcesSerializer).read(deduplicationDependencyCache); + } + + public void write(Encoder encoder, ModuleComponentResolveMetadata metadata, Map deduplicationDependencyCache) throws IOException { + new Writer(encoder, attributeContainerSerializer, componentSelectorSerializer, moduleSourcesSerializer).write(metadata, deduplicationDependencyCache); + } + + private static class Writer { + private final Encoder encoder; + private final AttributeContainerSerializer attributeContainerSerializer; + private final ModuleComponentSelectorSerializer componentSelectorSerializer; + private final ModuleSourcesSerializer moduleSourcesSerializer; + + private Writer(Encoder encoder, AttributeContainerSerializer attributeContainerSerializer, ModuleComponentSelectorSerializer componentSelectorSerializer, ModuleSourcesSerializer moduleSourcesSerializer) { + this.encoder = encoder; + this.attributeContainerSerializer = attributeContainerSerializer; + this.componentSelectorSerializer = componentSelectorSerializer; + this.moduleSourcesSerializer = moduleSourcesSerializer; + } + + public void write(ModuleComponentResolveMetadata metadata, Map deduplicationDependencyCache) throws IOException { + if (metadata instanceof IvyModuleResolveMetadata) { + write((IvyModuleResolveMetadata) metadata); + } else if (metadata instanceof MavenModuleResolveMetadata) { + write((MavenModuleResolveMetadata) metadata, deduplicationDependencyCache); + } else { + throw new IllegalArgumentException("Unexpected metadata type: " + metadata.getClass()); + } + } + + private void write(MavenModuleResolveMetadata metadata, Map deduplicationDependencyCache) throws IOException { + encoder.writeByte(TYPE_MAVEN); + writeInfoSection(metadata); + writeNullableString(metadata.getSnapshotTimestamp()); + writeMavenDependencies(metadata.getDependencies(), deduplicationDependencyCache); + writeSharedInfo(metadata); + writeNullableString(metadata.getPackaging()); + writeBoolean(metadata.isRelocated()); + writeVariants(metadata); + } + + private void writeVariants(ModuleComponentResolveMetadata metadata) throws IOException { + encoder.writeSmallInt(metadata.getVariants().size()); + for (ComponentVariant variant : metadata.getVariants()) { + encoder.writeString(variant.getName()); + writeAttributes(variant.getAttributes()); + writeVariantDependencies(variant.getDependencies()); + writeVariantConstraints(variant.getDependencyConstraints()); + writeVariantFiles(variant.getFiles()); + writeVariantCapabilities(variant.getCapabilities().getCapabilities()); + encoder.writeBoolean(variant.isExternalVariant()); + } + } + + private void writeVariantConstraints(ImmutableList constraints) throws IOException { + encoder.writeSmallInt(constraints.size()); + for (ComponentVariant.DependencyConstraint constraint : constraints) { + componentSelectorSerializer.write(encoder, constraint.getGroup(), constraint.getModule(), constraint.getVersionConstraint(), constraint.getAttributes(), Collections.emptyList()); + encoder.writeNullableString(constraint.getReason()); + } + } + + private void writeVariantDependencies(List dependencies) throws IOException { + encoder.writeSmallInt(dependencies.size()); + for (ComponentVariant.Dependency dependency : dependencies) { + componentSelectorSerializer.write(encoder, dependency.getGroup(), dependency.getModule(), dependency.getVersionConstraint(), dependency.getAttributes(), dependency.getRequestedCapabilities()); + encoder.writeNullableString(dependency.getReason()); + writeVariantDependencyExcludes(dependency.getExcludes()); + encoder.writeBoolean(dependency.isEndorsingStrictVersions()); + writeNullableArtifact(dependency.getDependencyArtifact()); + } + } + + private void writeVariantDependencyExcludes(List excludes) throws IOException { + writeCount(excludes.size()); + for (ExcludeMetadata exclude : excludes) { + writeString(exclude.getModuleId().getGroup()); + writeString(exclude.getModuleId().getName()); + } + } + + private void writeAttributes(AttributeContainer attributes) throws IOException { + attributeContainerSerializer.write(encoder, attributes); + } + + private void writeVariantFiles(List files) throws IOException { + encoder.writeSmallInt(files.size()); + for (ComponentVariant.File file : files) { + encoder.writeString(file.getName()); + encoder.writeString(file.getUri()); + } + } + + private void writeVariantCapabilities(List capabilities) throws IOException { + encoder.writeSmallInt(capabilities.size()); + for (Capability capability: capabilities) { + boolean shadowed = capability instanceof ShadowedCapability; + if (shadowed) { + ShadowedCapability shadowedCapability = (ShadowedCapability) capability; + encoder.writeNullableString(shadowedCapability.getAppendix()); + capability = shadowedCapability.getShadowedCapability(); + } else { + encoder.writeNullableString(null); + } + encoder.writeString(capability.getGroup()); + encoder.writeString(capability.getName()); + encoder.writeString(capability.getVersion()); + } + } + + + private void write(IvyModuleResolveMetadata metadata) throws IOException { + encoder.writeByte(TYPE_IVY); + writeInfoSection(metadata); + writeExtraInfo(metadata.getExtraAttributes()); + writeConfigurations(metadata.getConfigurationDefinitions().values()); + writeIvyDependencies(metadata.getDependencies()); + writeArtifacts(metadata.getArtifactDefinitions()); + writeExcludeRules(metadata.getExcludes()); + writeSharedInfo(metadata); + writeNullableString(metadata.getBranch()); + writeVariants(metadata); + } + + private void writeSharedInfo(ModuleComponentResolveMetadata metadata) throws IOException { + encoder.writeBoolean(metadata.isMissing()); + encoder.writeBoolean(metadata.isChanging()); + encoder.writeBoolean(metadata.isExternalVariant()); + encoder.writeString(metadata.getStatus()); + writeStringList(metadata.getStatusScheme()); + moduleSourcesSerializer.write(encoder, metadata.getSources()); + } + + private void writeId(ModuleComponentIdentifier componentIdentifier) throws IOException { + writeString(componentIdentifier.getGroup()); + writeString(componentIdentifier.getModule()); + writeString(componentIdentifier.getVersion()); + } + + private void writeInfoSection(ModuleComponentResolveMetadata metadata) throws IOException { + writeId(metadata.getId()); + writeAttributes(metadata.getAttributes()); + } + + private void writeExtraInfo(Map extraInfo) throws IOException { + writeCount(extraInfo.size()); + for (Map.Entry entry : extraInfo.entrySet()) { + NamespaceId namespaceId = entry.getKey(); + writeString(namespaceId.getNamespace()); + writeString(namespaceId.getName()); + writeString(entry.getValue()); + } + } + + private void writeConfigurations(Collection configurations) throws IOException { + writeCount(configurations.size()); + for (Configuration conf : configurations) { + writeConfiguration(conf); + } + } + + private void writeConfiguration(Configuration conf) throws IOException { + writeString(conf.getName()); + writeBoolean(conf.isTransitive()); + writeBoolean(conf.isVisible()); + writeStringList(conf.getExtendsFrom()); + } + + private void writeArtifacts(List artifacts) throws IOException { + writeCount(artifacts.size()); + for (Artifact artifact : artifacts) { + IvyArtifactName artifactName = artifact.getArtifactName(); + writeString(artifactName.getName()); + writeString(artifactName.getType()); + writeNullableString(artifactName.getExtension()); + writeNullableString(artifactName.getClassifier()); + writeStringSet(artifact.getConfigurations()); + } + } + + private void writeIvyDependencies(List dependencies) throws IOException { + writeCount(dependencies.size()); + for (IvyDependencyDescriptor dd : dependencies) { + writeIvyDependency(dd); + } + } + + private void writeMavenDependencies(List dependencies, Map deduplicationDependencyCache) throws IOException { + writeCount(dependencies.size()); + for (MavenDependencyDescriptor dd : dependencies) { + writeMavenDependency(dd, deduplicationDependencyCache); + } + } + + private void writeIvyDependency(IvyDependencyDescriptor ivyDependency) throws IOException { + componentSelectorSerializer.write(encoder, ivyDependency.getSelector()); + writeDependencyConfigurationMapping(ivyDependency); + writeArtifacts(ivyDependency.getDependencyArtifacts()); + writeExcludeRules(ivyDependency.getAllExcludes()); + writeString(ivyDependency.getDynamicConstraintVersion()); + writeBoolean(ivyDependency.isChanging()); + writeBoolean(ivyDependency.isTransitive()); + writeBoolean(ivyDependency.isOptional()); + } + + private void writeDependencyConfigurationMapping(IvyDependencyDescriptor dep) throws IOException { + SetMultimap confMappings = dep.getConfMappings(); + writeCount(confMappings.keySet().size()); + for (String conf : confMappings.keySet()) { + writeString(conf); + writeStringSet(confMappings.get(conf)); + } + } + + private void writeExcludeRules(List excludes) throws IOException { + writeCount(excludes.size()); + for (Exclude exclude : excludes) { + writeString(exclude.getModuleId().getGroup()); + writeString(exclude.getModuleId().getName()); + IvyArtifactName artifact = exclude.getArtifact(); + writeNullableArtifact(artifact); + writeStringArray(exclude.getConfigurations().toArray(new String[0])); + writeNullableString(exclude.getMatcher()); + } + } + + private void writeMavenDependency(MavenDependencyDescriptor mavenDependency, Map deduplicationDependencyCache) throws IOException { + int nextMapping = deduplicationDependencyCache.size(); + Integer mapping = deduplicationDependencyCache.putIfAbsent(mavenDependency, nextMapping); + if (mapping != null) { + // Save a reference to the dependency that was written before + encoder.writeSmallInt(mapping); + } else { + encoder.writeSmallInt(nextMapping); + componentSelectorSerializer.write(encoder, mavenDependency.getSelector()); + writeNullableArtifact(mavenDependency.getDependencyArtifact()); + writeMavenExcludeRules(mavenDependency.getAllExcludes()); + encoder.writeSmallInt(mavenDependency.getScope().ordinal()); + encoder.writeSmallInt(mavenDependency.getType().ordinal()); + } + } + + private void writeNullableArtifact(IvyArtifactName artifact) throws IOException { + if (artifact == null) { + writeBoolean(false); + } else { + writeBoolean(true); + writeString(artifact.getName()); + writeString(artifact.getType()); + writeNullableString(artifact.getExtension()); + writeNullableString(artifact.getClassifier()); + } + } + + private void writeMavenExcludeRules(List excludes) throws IOException { + writeCount(excludes.size()); + for (ExcludeMetadata exclude : excludes) { + writeString(exclude.getModuleId().getGroup()); + writeString(exclude.getModuleId().getName()); + } + } + + private void writeCount(int i) throws IOException { + encoder.writeSmallInt(i); + } + + private void writeString(String str) throws IOException { + encoder.writeString(str); + } + + private void writeNullableString(String str) throws IOException { + encoder.writeNullableString(str); + } + + private void writeBoolean(boolean b) throws IOException { + encoder.writeBoolean(b); + } + + private void writeStringArray(String[] values) throws IOException { + writeCount(values.length); + for (String configuration : values) { + writeNullableString(configuration); + } + } + + private void writeStringList(List values) throws IOException { + writeCount(values.size()); + for (String configuration : values) { + writeString(configuration); + } + } + + private void writeStringSet(Set values) throws IOException { + writeCount(values.size()); + for (String configuration : values) { + writeString(configuration); + } + } + } + + private static class Reader { + private final Decoder decoder; + private final ImmutableModuleIdentifierFactory moduleIdentifierFactory; + private final ExcludeRuleConverter excludeRuleConverter; + private final AttributeContainerSerializer attributeContainerSerializer; + private final ModuleComponentSelectorSerializer componentSelectorSerializer; + private final MavenMutableModuleMetadataFactory mavenMetadataFactory; + private final IvyMutableModuleMetadataFactory ivyMetadataFactory; + private final ModuleSourcesSerializer moduleSourcesSerializer; + private ModuleComponentIdentifier id; + private ImmutableAttributes attributes; + + private Reader(Decoder decoder, + ImmutableModuleIdentifierFactory moduleIdentifierFactory, + AttributeContainerSerializer attributeContainerSerializer, + ModuleComponentSelectorSerializer componentSelectorSerializer, MavenMutableModuleMetadataFactory mavenMutableModuleMetadataFactory, + IvyMutableModuleMetadataFactory ivyMetadataFactory, + ModuleSourcesSerializer moduleSourcesSerializer) { + this.decoder = decoder; + this.moduleIdentifierFactory = moduleIdentifierFactory; + this.excludeRuleConverter = new DefaultExcludeRuleConverter(moduleIdentifierFactory); + this.attributeContainerSerializer = attributeContainerSerializer; + this.componentSelectorSerializer = componentSelectorSerializer; + this.mavenMetadataFactory = mavenMutableModuleMetadataFactory; + this.ivyMetadataFactory = ivyMetadataFactory; + this.moduleSourcesSerializer = moduleSourcesSerializer; + } + + public MutableModuleComponentResolveMetadata read(Map deduplicationDependencyCache) throws IOException { + byte type = decoder.readByte(); + switch (type) { + case TYPE_IVY: + return readIvy(); + case TYPE_MAVEN: + return readMaven(deduplicationDependencyCache); + default: + throw new IllegalArgumentException("Unexpected metadata type found."); + } + } + + private void readSharedInfo(MutableModuleComponentResolveMetadata metadata) throws IOException { + metadata.setMissing(decoder.readBoolean()); + metadata.setChanging(decoder.readBoolean()); + metadata.setExternalVariant(decoder.readBoolean()); + metadata.setStatus(decoder.readString()); + metadata.setStatusScheme(readStringList()); + metadata.setSources(moduleSourcesSerializer.read(decoder)); + } + + private MutableModuleComponentResolveMetadata readMaven(Map deduplicationDependencyCache) throws IOException { + readInfoSection(); + String snapshotTimestamp = readNullableString(); + if (snapshotTimestamp != null) { + id = new MavenUniqueSnapshotComponentIdentifier(id, snapshotTimestamp); + } + + List dependencies = readMavenDependencies(deduplicationDependencyCache); + MutableMavenModuleResolveMetadata metadata = mavenMetadataFactory.create(id, dependencies); + readSharedInfo(metadata); + metadata.setSnapshotTimestamp(snapshotTimestamp); + metadata.setPackaging(readNullableString()); + metadata.setRelocated(readBoolean()); + metadata.setAttributes(attributes); + readVariants(metadata); + return metadata; + } + + private void readVariants(MutableModuleComponentResolveMetadata metadata) throws IOException { + int count = decoder.readSmallInt(); + for (int i = 0; i < count; i++) { + String name = decoder.readString(); + ImmutableAttributes attributes = readAttributes(); + MutableComponentVariant variant = metadata.addVariant(name, attributes); + readVariantDependencies(variant); + readVariantConstraints(variant); + readVariantFiles(variant); + readVariantCapabilities(variant); + boolean externalVariant = decoder.readBoolean(); + variant.setAvailableExternally(externalVariant); + } + } + + private ImmutableAttributes readAttributes() throws IOException { + return attributeContainerSerializer.read(decoder); + } + + private void readVariantDependencies(MutableComponentVariant variant) throws IOException { + int count = decoder.readSmallInt(); + for (int i = 0; i < count; i++) { + ModuleComponentSelector selector = componentSelectorSerializer.read(decoder); + String reason = decoder.readNullableString(); + ImmutableList excludes = readVariantDependencyExcludes(); + boolean endorsing = decoder.readBoolean(); + IvyArtifactName dependencyArtifact = readNullableArtifact(); + variant.addDependency(selector.getGroup(), selector.getModule(), selector.getVersionConstraint(), excludes, reason, (ImmutableAttributes) selector.getAttributes(), selector.getRequestedCapabilities(), endorsing, dependencyArtifact); + } + } + + private void readVariantConstraints(MutableComponentVariant variant) throws IOException { + int count = decoder.readSmallInt(); + for (int i = 0; i < count; i++) { + ModuleComponentSelector selector = componentSelectorSerializer.read(decoder); + String reason = decoder.readNullableString(); + variant.addDependencyConstraint(selector.getGroup(), selector.getModule(), selector.getVersionConstraint(), reason, (ImmutableAttributes) selector.getAttributes()); + } + } + + private ImmutableList readVariantDependencyExcludes() throws IOException { + ImmutableList.Builder builder = new ImmutableList.Builder<>(); + int len = readCount(); + for (int i = 0; i < len; i++) { + String group = readString(); + String module = readString(); + builder.add(excludeRuleConverter.createExcludeRule(group, module)); + } + return builder.build(); + } + + private void readVariantFiles(MutableComponentVariant variant) throws IOException { + int count = decoder.readSmallInt(); + for (int i = 0; i < count; i++) { + variant.addFile(decoder.readString(), decoder.readString()); + } + } + + private void readVariantCapabilities(MutableComponentVariant variant) throws IOException { + int capabilitiesCount = decoder.readSmallInt(); + for (int j = 0; j < capabilitiesCount; j++) { + String appendix = decoder.readNullableString(); + CapabilityInternal capability = new ImmutableCapability(decoder.readString(), decoder.readString(), decoder.readString()); + if (appendix != null) { + capability = new DefaultShadowedCapability(capability, appendix); + } + variant.addCapability(capability); + } + } + + private MutableModuleComponentResolveMetadata readIvy() throws IOException { + readInfoSection(); + Map extraAttributes = readExtraInfo(); + List configurations = readConfigurations(); + List dependencies = readIvyDependencies(); + List artifacts = readArtifacts(); + List excludes = readModuleExcludes(); + MutableIvyModuleResolveMetadata metadata = ivyMetadataFactory.create(id, dependencies, configurations, artifacts, excludes); + readSharedInfo(metadata); + String branch = readNullableString(); + metadata.setBranch(branch); + metadata.setExtraAttributes(extraAttributes); + metadata.setAttributes(attributes); + readVariants(metadata); + return metadata; + } + + private void readInfoSection() throws IOException { + id = readId(); + attributes = readAttributes(); + } + + private ModuleComponentIdentifier readId() throws IOException { + return DefaultModuleComponentIdentifier.newId(DefaultModuleIdentifier.newId(readString(), readString()), readString()); + } + + private Map readExtraInfo() throws IOException { + int len = readCount(); + Map result = new LinkedHashMap<>(len); + for (int i = 0; i < len; i++) { + NamespaceId namespaceId = new NamespaceId(readString(), readString()); + String value = readString(); + result.put(namespaceId, value); + } + return result; + } + + private List readConfigurations() throws IOException { + int len = readCount(); + List configurations = new ArrayList<>(len); + for (int i = 0; i < len; i++) { + Configuration configuration = readConfiguration(); + configurations.add(configuration); + } + return configurations; + } + + private Configuration readConfiguration() throws IOException { + String name = readString(); + boolean transitive = readBoolean(); + boolean visible = readBoolean(); + List extendsFrom = readStringList(); + return new Configuration(name, transitive, visible, extendsFrom); + } + + private List readArtifacts() throws IOException { + int size = readCount(); + List result = Lists.newArrayListWithCapacity(size); + for (int i = 0; i < size; i++) { + IvyArtifactName ivyArtifactName = new DefaultIvyArtifactName(readString(), readString(), readNullableString(), readNullableString()); + result.add(new Artifact(ivyArtifactName, readStringSet())); + } + return result; + } + + private List readIvyDependencies() throws IOException { + int len = readCount(); + List result = Lists.newArrayListWithCapacity(len); + for (int i = 0; i < len; i++) { + result.add(readIvyDependency()); + } + return result; + } + + private IvyDependencyDescriptor readIvyDependency() throws IOException { + ModuleComponentSelector requested = componentSelectorSerializer.read(decoder); + SetMultimap configMappings = readDependencyConfigurationMapping(); + List artifacts = readDependencyArtifactDescriptors(); + List excludes = readDependencyExcludes(); + String dynamicConstraintVersion = readString(); + boolean changing = readBoolean(); + boolean transitive = readBoolean(); + boolean optional = readBoolean(); + return new IvyDependencyDescriptor(requested, dynamicConstraintVersion, changing, transitive, optional, configMappings, artifacts, excludes); + } + + private SetMultimap readDependencyConfigurationMapping() throws IOException { + int size = readCount(); + SetMultimap result = LinkedHashMultimap.create(); + for (int i = 0; i < size; i++) { + String from = readString(); + Set to = readStringSet(); + result.putAll(from, to); + } + return result; + } + + private List readDependencyArtifactDescriptors() throws IOException { + int size = readCount(); + List result = Lists.newArrayListWithCapacity(size); + for (int i = 0; i < size; i++) { + IvyArtifactName ivyArtifactName = new DefaultIvyArtifactName(readString(), readString(), readNullableString(), readNullableString()); + result.add(new Artifact(ivyArtifactName, readStringSet())); + } + return result; + } + + private List readDependencyExcludes() throws IOException { + int len = readCount(); + List result = Lists.newArrayListWithCapacity(len); + for (int i = 0; i < len; i++) { + DefaultExclude rule = readExcludeRule(); + result.add(rule); + } + return result; + } + + private List readModuleExcludes() throws IOException { + int len = readCount(); + List result = new ArrayList<>(len); + for (int i = 0; i < len; i++) { + result.add(readExcludeRule()); + } + return result; + } + + private DefaultExclude readExcludeRule() throws IOException { + String moduleOrg = readString(); + String moduleName = readString(); + IvyArtifactName artifactName = readNullableArtifact(); + String[] confs = readStringArray(); + String matcher = readNullableString(); + return new DefaultExclude(moduleIdentifierFactory.module(moduleOrg, moduleName), artifactName, confs, matcher); + } + + private IvyArtifactName readNullableArtifact() throws IOException { + boolean hasArtifact = readBoolean(); + IvyArtifactName artifactName = null; + if (hasArtifact) { + String artifact = readString(); + String type = readString(); + String ext = readNullableString(); + String classifier = readNullableString(); + artifactName = new DefaultIvyArtifactName(artifact, type, ext, classifier); + } + return artifactName; + } + + private List readMavenDependencies(Map deduplicationDependencyCache) throws IOException { + int len = readCount(); + List result = Lists.newArrayListWithCapacity(len); + for (int i = 0; i < len; i++) { + result.add(readMavenDependency(deduplicationDependencyCache)); + } + return result; + } + + private MavenDependencyDescriptor readMavenDependency(Map deduplicationDependencyCache) throws IOException { + int mapping = decoder.readSmallInt(); + if (mapping == deduplicationDependencyCache.size()) { + ModuleComponentSelector requested = componentSelectorSerializer.read(decoder); + IvyArtifactName artifactName = readNullableArtifact(); + List mavenExcludes = readMavenDependencyExcludes(); + MavenScope scope = MavenScope.values()[decoder.readSmallInt()]; + MavenDependencyType type = MavenDependencyType.values()[decoder.readSmallInt()]; + MavenDependencyDescriptor mavenDependencyDescriptor = new MavenDependencyDescriptor(scope, type, requested, artifactName, mavenExcludes); + deduplicationDependencyCache.put(mapping, mavenDependencyDescriptor); + return mavenDependencyDescriptor; + } else { + MavenDependencyDescriptor mavenDependencyDescriptor = deduplicationDependencyCache.get(mapping); + assert mavenDependencyDescriptor != null; + return mavenDependencyDescriptor; + } + } + + private List readMavenDependencyExcludes() throws IOException { + int len = readCount(); + List result = Lists.newArrayListWithCapacity(len); + for (int i = 0; i < len; i++) { + String moduleOrg = readString(); + String moduleName = readString(); + DefaultExclude rule = new DefaultExclude(moduleIdentifierFactory.module(moduleOrg, moduleName)); + result.add(rule); + } + return result; + } + + private int readCount() throws IOException { + return decoder.readSmallInt(); + } + + private String readString() throws IOException { + return decoder.readString(); + } + + private String readNullableString() throws IOException { + return decoder.readNullableString(); + } + + private boolean readBoolean() throws IOException { + return decoder.readBoolean(); + } + + private String[] readStringArray() throws IOException { + int size = readCount(); + String[] array = new String[size]; + for (int i = 0; i < size; i++) { + array[i] = readNullableString(); + } + return array; + } + + private List readStringList() throws IOException { + int size = readCount(); + ImmutableList.Builder builder = ImmutableList.builderWithExpectedSize(size); + for (int i = 0; i < size; i++) { + builder.add(readString()); + } + return builder.build(); + } + + private Set readStringSet() throws IOException { + int size = readCount(); + ImmutableSet.Builder builder = ImmutableSet.builderWithExpectedSize(size); + for (int i = 0; i < size; i++) { + builder.add(readString()); + } + return builder.build(); + } + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/modulecache/ResolvedArtifactCaches.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/modulecache/ResolvedArtifactCaches.java new file mode 100644 index 0000000..4123f07 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/modulecache/ResolvedArtifactCaches.java @@ -0,0 +1,80 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.ivyservice.modulecache; + +import com.google.common.collect.MapMaker; +import com.google.common.collect.Maps; +import org.gradle.api.artifacts.component.ComponentArtifactIdentifier; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.BaseModuleComponentRepository; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ModuleComponentRepository; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.ResolvableArtifact; +import org.gradle.api.logging.Logger; +import org.gradle.api.logging.Logging; +import org.gradle.internal.concurrent.Stoppable; + +import java.util.Map; + +/** + * Caches the dependency metadata (descriptors, artifact files) in memory. + */ +public class ResolvedArtifactCaches implements Stoppable { + + private final static Logger LOG = Logging.getLogger(ResolvedArtifactCaches.class); + + private final Map> cachePerRepo = new MapMaker().makeMap(); + + /** + * For a remote repository, the only thing required is a resolved artifact cache. + * The rest of the in-memory caching is handled by the CachingModuleComponentRepository. + */ + public ModuleComponentRepository provideResolvedArtifactCache(ModuleComponentRepository input) { + Map caches = getResolvedArtifactCache(input); + return new ResolvedArtifactCacheProvidingModuleComponentRepository(caches, input); + } + + private Map getResolvedArtifactCache(ModuleComponentRepository input) { + Map resolvedArtifactCache = cachePerRepo.get(input.getId()); + if (resolvedArtifactCache == null) { + LOG.debug("Creating new in-memory cache for repo '{}' [{}].", input.getName(), input.getId()); + resolvedArtifactCache = Maps.newConcurrentMap(); + cachePerRepo.put(input.getId(), resolvedArtifactCache); + } else { + LOG.debug("Reusing in-memory cache for repo '{}' [{}].", input.getName(), input.getId()); + } + return resolvedArtifactCache; + } + + @Override + public void stop() { + cachePerRepo.clear(); + } + + private static class ResolvedArtifactCacheProvidingModuleComponentRepository extends BaseModuleComponentRepository { + + private final Map resolvedArtifactCache; + + public ResolvedArtifactCacheProvidingModuleComponentRepository(Map resolvedArtifactsCache, ModuleComponentRepository delegate) { + super(delegate); + this.resolvedArtifactCache = resolvedArtifactsCache; + } + + @Override + public Map getArtifactCache() { + return resolvedArtifactCache; + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolutionstrategy/DefaultCachePolicy.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolutionstrategy/DefaultCachePolicy.java new file mode 100644 index 0000000..c2b314a --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolutionstrategy/DefaultCachePolicy.java @@ -0,0 +1,343 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy; + +import org.gradle.api.Action; +import org.gradle.api.artifacts.ArtifactIdentifier; +import org.gradle.api.artifacts.ModuleIdentifier; +import org.gradle.api.artifacts.ModuleVersionIdentifier; +import org.gradle.api.artifacts.ResolvedModuleVersion; +import org.gradle.api.artifacts.component.ModuleComponentIdentifier; +import org.gradle.api.internal.artifacts.DefaultModuleVersionIdentifier; +import org.gradle.api.internal.artifacts.cache.ArtifactResolutionControl; +import org.gradle.api.internal.artifacts.cache.DependencyResolutionControl; +import org.gradle.api.internal.artifacts.cache.ModuleResolutionControl; +import org.gradle.api.internal.artifacts.cache.ResolutionControl; +import org.gradle.api.internal.artifacts.configurations.MutationValidator; +import org.gradle.api.internal.artifacts.configurations.dynamicversion.CachePolicy; +import org.gradle.api.internal.artifacts.configurations.dynamicversion.Expiry; +import org.gradle.api.internal.artifacts.ivyservice.modulecache.dynamicversions.DefaultResolvedModuleVersion; + +import java.io.File; +import java.time.Duration; +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +import static org.gradle.api.internal.artifacts.configurations.MutationValidator.MutationType.STRATEGY; + +public class DefaultCachePolicy implements CachePolicy { + private static final int SECONDS_IN_DAY = 24 * 60 * 60; + private static final int MILLISECONDS_IN_DAY = SECONDS_IN_DAY * 1000; + + final List> dependencyCacheRules; + final List> moduleCacheRules; + final List> artifactCacheRules; + private MutationValidator mutationValidator = MutationValidator.IGNORE; + private long keepDynamicVersionsFor = MILLISECONDS_IN_DAY; + private long keepChangingModulesFor = MILLISECONDS_IN_DAY; + + public DefaultCachePolicy() { + this.dependencyCacheRules = new ArrayList<>(); + this.moduleCacheRules = new ArrayList<>(); + this.artifactCacheRules = new ArrayList<>(); + + cacheDynamicVersionsFor(SECONDS_IN_DAY, TimeUnit.SECONDS); + cacheChangingModulesFor(SECONDS_IN_DAY, TimeUnit.SECONDS); + cacheMissingArtifactsFor(SECONDS_IN_DAY, TimeUnit.SECONDS); + } + + DefaultCachePolicy(DefaultCachePolicy policy) { + this.dependencyCacheRules = new ArrayList<>(policy.dependencyCacheRules); + this.moduleCacheRules = new ArrayList<>(policy.moduleCacheRules); + this.artifactCacheRules = new ArrayList<>(policy.artifactCacheRules); + } + + /** + * Sets the validator to invoke prior to each mutation. + */ + public void setMutationValidator(MutationValidator validator) { + this.mutationValidator = validator; + } + + @Override + public void setOffline() { + eachDependency(DependencyResolutionControl::useCachedResult); + eachModule(ModuleResolutionControl::useCachedResult); + eachArtifact(ArtifactResolutionControl::useCachedResult); + } + + @Override + public void setRefreshDependencies() { + eachDependency(dependencyResolutionControl -> dependencyResolutionControl.refresh()); + eachModule(moduleResolutionControl -> moduleResolutionControl.refresh()); + eachArtifact(artifactResolutionControl -> artifactResolutionControl.refresh()); + } + + public void cacheDynamicVersionsFor(final int value, final TimeUnit unit) { + keepDynamicVersionsFor = unit.toMillis(value); + eachDependency(dependencyResolutionControl -> { + if (!dependencyResolutionControl.getCachedResult().isEmpty()) { + dependencyResolutionControl.cacheFor(value, unit); + } + }); + } + + public void cacheChangingModulesFor(final int value, final TimeUnit units) { + keepChangingModulesFor = units.toMillis(value); + eachModule(moduleResolutionControl -> { + if (moduleResolutionControl.isChanging()) { + moduleResolutionControl.cacheFor(value, units); + } + }); + eachArtifact(artifactResolutionControl -> { + if (artifactResolutionControl.belongsToChangingModule()) { + artifactResolutionControl.cacheFor(value, units); + } + }); + } + + private void cacheMissingArtifactsFor(final int value, final TimeUnit units) { + eachArtifact(artifactResolutionControl -> { + if (artifactResolutionControl.getCachedResult() == null) { + artifactResolutionControl.cacheFor(value, units); + } + }); + } + + /** + * Apply a rule to control resolution of dependencies. + * + * @param rule the rule to apply + */ + private void eachDependency(Action rule) { + mutationValidator.validateMutation(STRATEGY); + dependencyCacheRules.add(0, rule); + } + + /** + * Apply a rule to control resolution of modules. + * + * @param rule the rule to apply + */ + private void eachModule(Action rule) { + mutationValidator.validateMutation(STRATEGY); + moduleCacheRules.add(0, rule); + } + + /** + * Apply a rule to control resolution of artifacts. + * + * @param rule the rule to apply + */ + private void eachArtifact(Action rule) { + mutationValidator.validateMutation(STRATEGY); + artifactCacheRules.add(0, rule); + } + + @Override + public Expiry versionListExpiry(ModuleIdentifier moduleIdentifier, Set moduleVersions, Duration age) { + CachedDependencyResolutionControl dependencyResolutionControl = new CachedDependencyResolutionControl(moduleIdentifier, moduleVersions, age.toMillis(), keepDynamicVersionsFor); + + for (Action rule : dependencyCacheRules) { + rule.execute(dependencyResolutionControl); + if (dependencyResolutionControl.ruleMatch()) { + break; + } + } + + return dependencyResolutionControl; + } + + @Override + public Expiry missingModuleExpiry(ModuleComponentIdentifier component, Duration age) { + return mustRefreshModule(component, null, age, false); + } + + @Override + public Expiry moduleExpiry(ModuleComponentIdentifier component, ResolvedModuleVersion resolvedModuleVersion, Duration age) { + return mustRefreshModule(component, resolvedModuleVersion, age, false); + } + + @Override + public Expiry moduleExpiry(ResolvedModuleVersion resolvedModuleVersion, Duration age, boolean changing) { + return mustRefreshModule(resolvedModuleVersion.getId(), resolvedModuleVersion, age, changing); + } + + @Override + public Expiry changingModuleExpiry(ModuleComponentIdentifier component, ResolvedModuleVersion resolvedModuleVersion, Duration age) { + return mustRefreshModule(component, resolvedModuleVersion, age, true); + } + + private Expiry mustRefreshModule(ModuleComponentIdentifier component, ResolvedModuleVersion version, Duration age, boolean changingModule) { + return mustRefreshModule(DefaultModuleVersionIdentifier.newId(component.getModuleIdentifier(), component.getVersion()), version, age, changingModule); + } + + private CachedModuleResolutionControl mustRefreshModule(ModuleVersionIdentifier moduleVersionId, ResolvedModuleVersion version, Duration age, boolean changingModule) { + CachedModuleResolutionControl moduleResolutionControl = new CachedModuleResolutionControl(moduleVersionId, version, changingModule, age.toMillis(), changingModule ? keepChangingModulesFor: Long.MAX_VALUE); + + for (Action rule : moduleCacheRules) { + rule.execute(moduleResolutionControl); + if (moduleResolutionControl.ruleMatch()) { + break; + } + } + + return moduleResolutionControl; + } + + @Override + public Expiry moduleArtifactsExpiry(ModuleVersionIdentifier moduleVersionId, Set artifacts, + Duration age, boolean belongsToChangingModule, boolean moduleDescriptorInSync) { + CachedModuleResolutionControl resolutionControl = mustRefreshModule(moduleVersionId, new DefaultResolvedModuleVersion(moduleVersionId), age, belongsToChangingModule); + if (belongsToChangingModule && !moduleDescriptorInSync) { + resolutionControl.refresh(); + } + return resolutionControl; + } + + @Override + public Expiry artifactExpiry(ArtifactIdentifier artifactIdentifier, File cachedArtifactFile, Duration age, boolean belongsToChangingModule, boolean moduleDescriptorInSync) { + CachedArtifactResolutionControl artifactResolutionControl = new CachedArtifactResolutionControl(artifactIdentifier, cachedArtifactFile, age.toMillis(), keepChangingModulesFor, belongsToChangingModule); + for (Action rule : artifactCacheRules) { + rule.execute(artifactResolutionControl); + if (artifactResolutionControl.ruleMatch()) { + break; + } + } + if (belongsToChangingModule && !moduleDescriptorInSync) { + artifactResolutionControl.refresh(); + } + return artifactResolutionControl; + } + + DefaultCachePolicy copy() { + return new DefaultCachePolicy(this); + } + + private abstract static class AbstractResolutionControl implements ResolutionControl, Expiry { + private final A request; + private final B cachedResult; + private final long ageMillis; + private long keepForMillis; + private boolean ruleMatch; + private boolean mustCheck; + + private AbstractResolutionControl(A request, B cachedResult, long ageMillis, long keepForMillis) { + this.request = request; + this.cachedResult = cachedResult; + this.ageMillis = correctForClockShift(ageMillis); + this.keepForMillis = keepForMillis; + } + + /** + * If the age < 0, then it's probable that we've had a clock shift. In this case, treat the age as 1ms. + */ + private long correctForClockShift(long ageMillis) { + if (ageMillis < 0) { + return 1; + } + return ageMillis; + } + + @Override + public A getRequest() { + return request; + } + + @Override + public B getCachedResult() { + return cachedResult; + } + + @Override + public void cacheFor(int value, TimeUnit units) { + keepForMillis = TimeUnit.MILLISECONDS.convert(value, units); + setMustCheck(ageMillis > keepForMillis); + } + + @Override + public void useCachedResult() { + setMustCheck(false); + } + + @Override + public void refresh() { + setMustCheck(true); + } + + private void setMustCheck(boolean val) { + ruleMatch = true; + mustCheck = val; + } + + public boolean ruleMatch() { + return ruleMatch; + } + + @Override + public Duration getKeepFor() { + if (mustCheck && ageMillis > 0) { + // Must check and was not cached in this build, so do not keep the value + return Duration.ZERO; + } + if (keepForMillis == Long.MAX_VALUE) { + return Duration.ofMillis(Long.MAX_VALUE); + } + return Duration.ofMillis(Math.max(0, keepForMillis - ageMillis)); + } + + @Override + public boolean isMustCheck() { + return mustCheck && ageMillis > 0; + } + } + + private class CachedDependencyResolutionControl extends AbstractResolutionControl> implements DependencyResolutionControl { + private CachedDependencyResolutionControl(ModuleIdentifier request, Set result, long ageMillis, long keepForMillis) { + super(request, result, ageMillis, keepForMillis); + } + } + + private class CachedModuleResolutionControl extends AbstractResolutionControl implements ModuleResolutionControl { + private final boolean changing; + + private CachedModuleResolutionControl(ModuleVersionIdentifier moduleVersionId, ResolvedModuleVersion cachedVersion, boolean changing, long ageMillis, long keepForMillis) { + super(moduleVersionId, cachedVersion, ageMillis, keepForMillis); + this.changing = changing; + } + + @Override + public boolean isChanging() { + return changing; + } + } + + private class CachedArtifactResolutionControl extends AbstractResolutionControl implements ArtifactResolutionControl { + private final boolean belongsToChangingModule; + + private CachedArtifactResolutionControl(ArtifactIdentifier artifactIdentifier, File cachedResult, long ageMillis, long keepForMillis, boolean belongsToChangingModule) { + super(artifactIdentifier, cachedResult, ageMillis, keepForMillis); + this.belongsToChangingModule = belongsToChangingModule; + } + + @Override + public boolean belongsToChangingModule() { + return belongsToChangingModule; + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/DefaultArtifactDependencyResolver.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/DefaultArtifactDependencyResolver.java new file mode 100644 index 0000000..10401fd --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/DefaultArtifactDependencyResolver.java @@ -0,0 +1,231 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.ivyservice.resolveengine; + +import com.google.common.collect.Lists; +import org.gradle.api.Action; +import org.gradle.api.InvalidUserCodeException; +import org.gradle.api.artifacts.DependencySubstitution; +import org.gradle.api.attributes.AttributesSchema; +import org.gradle.api.internal.FeaturePreviews; +import org.gradle.api.internal.artifacts.ArtifactDependencyResolver; +import org.gradle.api.internal.artifacts.ComponentSelectorConverter; +import org.gradle.api.internal.artifacts.GlobalDependencyResolutionRules; +import org.gradle.api.internal.artifacts.ResolveContext; +import org.gradle.api.internal.artifacts.configurations.ConflictResolution; +import org.gradle.api.internal.artifacts.configurations.ResolutionStrategyInternal; +import org.gradle.api.internal.artifacts.ivyservice.clientmodule.ClientModuleResolver; +import org.gradle.api.internal.artifacts.ivyservice.dependencysubstitution.CachingDependencySubstitutionApplicator; +import org.gradle.api.internal.artifacts.ivyservice.dependencysubstitution.DefaultDependencySubstitutionApplicator; +import org.gradle.api.internal.artifacts.ivyservice.dependencysubstitution.DependencySubstitutionApplicator; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ComponentResolvers; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ResolveIvyFactory; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ResolverProviderFactory; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionComparator; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionParser; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.strategy.VersionSelectorScheme; +import org.gradle.api.internal.artifacts.ivyservice.moduleconverter.dependencies.DependencyDescriptorFactory; +import org.gradle.api.internal.artifacts.ivyservice.projectmodule.ProjectDependencyResolver; +import org.gradle.api.internal.artifacts.ivyservice.resolutionstrategy.CapabilitiesResolutionInternal; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.DependencyArtifactsVisitor; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.artifact.ResolvedArtifactsGraphVisitor; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.excludes.ModuleExclusions; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.CompositeDependencyGraphVisitor; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphVisitor; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.ComponentState; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.conflicts.DefaultCapabilitiesConflictHandler; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.conflicts.DefaultConflictHandler; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.conflicts.LastCandidateCapabilityResolver; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.conflicts.ModuleConflictHandler; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.conflicts.RejectRemainingCandidates; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.conflicts.UserConfiguredCapabilityResolver; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.ComponentSelectionDescriptorFactory; +import org.gradle.api.internal.artifacts.repositories.ResolutionAwareRepository; +import org.gradle.api.internal.artifacts.type.ArtifactTypeRegistry; +import org.gradle.api.internal.attributes.AttributesSchemaInternal; +import org.gradle.api.internal.attributes.ImmutableAttributesFactory; +import org.gradle.api.specs.Spec; +import org.gradle.internal.Actions; +import org.gradle.internal.component.model.DependencyMetadata; +import org.gradle.internal.instantiation.InstantiatorFactory; +import org.gradle.internal.model.CalculatedValueContainerFactory; +import org.gradle.internal.operations.BuildOperationExecutor; +import org.gradle.internal.reflect.Instantiator; +import org.gradle.internal.resolve.caching.ComponentMetadataSupplierRuleExecutor; +import org.gradle.internal.resolve.resolver.ComponentMetaDataResolver; +import org.gradle.internal.resolve.resolver.DependencyToComponentIdResolver; +import org.gradle.internal.resolve.resolver.ResolveContextToComponentResolver; +import org.gradle.internal.resolve.result.BuildableComponentResolveResult; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; + +import static org.gradle.api.internal.artifacts.ivyservice.dependencysubstitution.DependencySubstitutionApplicator.NO_OP; + +public class DefaultArtifactDependencyResolver implements ArtifactDependencyResolver { + private static final Logger LOGGER = LoggerFactory.getLogger(DefaultArtifactDependencyResolver.class); + private final DependencyDescriptorFactory dependencyDescriptorFactory; + private final List resolverFactories; + private final ProjectDependencyResolver projectDependencyResolver; + private final ResolveIvyFactory ivyFactory; + private final VersionComparator versionComparator; + private final ModuleExclusions moduleExclusions; + private final BuildOperationExecutor buildOperationExecutor; + private final ComponentSelectorConverter componentSelectorConverter; + private final ImmutableAttributesFactory attributesFactory; + private final VersionSelectorScheme versionSelectorScheme; + private final VersionParser versionParser; + private final ComponentMetadataSupplierRuleExecutor componentMetadataSupplierRuleExecutor; + private final Instantiator instantiator; + private final ComponentSelectionDescriptorFactory componentSelectionDescriptorFactory; + private final FeaturePreviews featurePreviews; + private final CalculatedValueContainerFactory calculatedValueContainerFactory; + + public DefaultArtifactDependencyResolver(BuildOperationExecutor buildOperationExecutor, + List resolverFactories, + ProjectDependencyResolver projectDependencyResolver, + ResolveIvyFactory ivyFactory, + DependencyDescriptorFactory dependencyDescriptorFactory, + VersionComparator versionComparator, + ModuleExclusions moduleExclusions, + ComponentSelectorConverter componentSelectorConverter, + ImmutableAttributesFactory attributesFactory, + VersionSelectorScheme versionSelectorScheme, + VersionParser versionParser, + ComponentMetadataSupplierRuleExecutor componentMetadataSupplierRuleExecutor, + InstantiatorFactory instantiatorFactory, + ComponentSelectionDescriptorFactory componentSelectionDescriptorFactory, + FeaturePreviews featurePreviews, + CalculatedValueContainerFactory calculatedValueContainerFactory) { + this.resolverFactories = resolverFactories; + this.projectDependencyResolver = projectDependencyResolver; + this.ivyFactory = ivyFactory; + this.dependencyDescriptorFactory = dependencyDescriptorFactory; + this.versionComparator = versionComparator; + this.moduleExclusions = moduleExclusions; + this.buildOperationExecutor = buildOperationExecutor; + this.componentSelectorConverter = componentSelectorConverter; + this.attributesFactory = attributesFactory; + this.versionSelectorScheme = versionSelectorScheme; + this.versionParser = versionParser; + this.componentMetadataSupplierRuleExecutor = componentMetadataSupplierRuleExecutor; + this.instantiator = instantiatorFactory.decorateScheme().instantiator(); + this.componentSelectionDescriptorFactory = componentSelectionDescriptorFactory; + this.featurePreviews = featurePreviews; + this.calculatedValueContainerFactory = calculatedValueContainerFactory; + } + + @Override + public void resolve(ResolveContext resolveContext, List repositories, GlobalDependencyResolutionRules metadataHandler, Spec edgeFilter, DependencyGraphVisitor graphVisitor, DependencyArtifactsVisitor artifactsVisitor, AttributesSchemaInternal consumerSchema, ArtifactTypeRegistry artifactTypeRegistry, boolean includeSyntheticDependencies) { + LOGGER.debug("Resolving {}", resolveContext); + + validateResolutionStrategy(resolveContext.getResolutionStrategy()); + + ComponentResolversChain resolvers = createResolvers(resolveContext, repositories, metadataHandler, artifactTypeRegistry, consumerSchema); + DependencyGraphBuilder builder = createDependencyGraphBuilder(resolvers, resolveContext.getResolutionStrategy(), metadataHandler, edgeFilter, consumerSchema, moduleExclusions, buildOperationExecutor); + + DependencyGraphVisitor artifactsGraphVisitor = new ResolvedArtifactsGraphVisitor(artifactsVisitor, resolvers.getArtifactSelector()); + + // Resolve the dependency graph + builder.resolve(resolveContext, new CompositeDependencyGraphVisitor(graphVisitor, artifactsGraphVisitor), includeSyntheticDependencies); + } + + private static void validateResolutionStrategy(ResolutionStrategyInternal resolutionStrategy) { + if (resolutionStrategy.isDependencyLockingEnabled()) { + if (resolutionStrategy.isFailingOnDynamicVersions()) { + failOnDependencyLockingConflictingWith("fail on dynamic versions"); + } else if (resolutionStrategy.isFailingOnChangingVersions()) { + failOnDependencyLockingConflictingWith("fail on changing versions"); + } + } + } + + private static void failOnDependencyLockingConflictingWith(String conflicting) { + throw new InvalidUserCodeException("Resolution strategy has both dependency locking and " + conflicting + " enabled. You must choose between the two modes."); + + } + + private DependencyGraphBuilder createDependencyGraphBuilder(ComponentResolversChain componentSource, + ResolutionStrategyInternal resolutionStrategy, + GlobalDependencyResolutionRules globalRules, + Spec edgeFilter, + AttributesSchemaInternal attributesSchema, + ModuleExclusions moduleExclusions, + BuildOperationExecutor buildOperationExecutor) { + + DependencyToComponentIdResolver componentIdResolver = componentSource.getComponentIdResolver(); + ComponentMetaDataResolver componentMetaDataResolver = new ClientModuleResolver(componentSource.getComponentResolver(), dependencyDescriptorFactory); + + ResolveContextToComponentResolver requestResolver = createResolveContextConverter(); + ModuleConflictHandler conflictHandler = createModuleConflictHandler(resolutionStrategy, globalRules); + DefaultCapabilitiesConflictHandler capabilitiesConflictHandler = createCapabilitiesConflictHandler(resolutionStrategy.getCapabilitiesResolutionRules()); + + DependencySubstitutionApplicator applicator = createDependencySubstitutionApplicator(resolutionStrategy); + return new DependencyGraphBuilder(componentIdResolver, componentMetaDataResolver, requestResolver, conflictHandler, capabilitiesConflictHandler, edgeFilter, attributesSchema, moduleExclusions, buildOperationExecutor, applicator, componentSelectorConverter, attributesFactory, versionSelectorScheme, versionComparator.asVersionComparator(), versionParser); + } + + private DependencySubstitutionApplicator createDependencySubstitutionApplicator(ResolutionStrategyInternal resolutionStrategy) { + Action rule = resolutionStrategy.getDependencySubstitutionRule(); + DependencySubstitutionApplicator applicator; + if (Actions.doNothing() == rule) { + applicator = NO_OP; + } else { + applicator = new CachingDependencySubstitutionApplicator(new DefaultDependencySubstitutionApplicator(componentSelectionDescriptorFactory, rule, instantiator)); + } + return applicator; + } + + private ComponentResolversChain createResolvers(ResolveContext resolveContext, List repositories, GlobalDependencyResolutionRules metadataHandler, ArtifactTypeRegistry artifactTypeRegistry, AttributesSchema consumerSchema) { + List resolvers = Lists.newArrayList(); + for (ResolverProviderFactory factory : resolverFactories) { + factory.create(resolveContext, resolvers); + } + resolvers.add(projectDependencyResolver); + ResolutionStrategyInternal resolutionStrategy = resolveContext.getResolutionStrategy(); + resolvers.add(ivyFactory.create(resolveContext.getName(), resolutionStrategy, repositories, metadataHandler.getComponentMetadataProcessorFactory(), resolveContext.getAttributes(), consumerSchema, attributesFactory, componentMetadataSupplierRuleExecutor)); + return new ComponentResolversChain(resolvers, artifactTypeRegistry, calculatedValueContainerFactory); + } + + private ResolveContextToComponentResolver createResolveContextConverter() { + return new DefaultResolveContextToComponentResolver(); + } + + private ModuleConflictHandler createModuleConflictHandler(ResolutionStrategyInternal resolutionStrategy, GlobalDependencyResolutionRules metadataHandler) { + ConflictResolution conflictResolution = resolutionStrategy.getConflictResolution(); + ModuleConflictResolver conflictResolver = + new ConflictResolverFactory(versionComparator, versionParser).createConflictResolver(conflictResolution); + return new DefaultConflictHandler(conflictResolver, metadataHandler.getModuleMetadataProcessor().getModuleReplacements()); + } + + private DefaultCapabilitiesConflictHandler createCapabilitiesConflictHandler(CapabilitiesResolutionInternal capabilitiesResolutionRules) { + DefaultCapabilitiesConflictHandler handler = new DefaultCapabilitiesConflictHandler(); + handler.registerResolver(new UserConfiguredCapabilityResolver(capabilitiesResolutionRules)); + //handler.registerResolver(new UpgradeCapabilityResolver()); + handler.registerResolver(new LastCandidateCapabilityResolver()); + handler.registerResolver(new RejectRemainingCandidates()); + return handler; + } + + private static class DefaultResolveContextToComponentResolver implements ResolveContextToComponentResolver { + @Override + public void resolve(ResolveContext resolveContext, BuildableComponentResolveResult result) { + result.resolved(resolveContext.toRootComponentMetaData()); + } + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/graph/conflicts/DefaultConflictHandler.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/graph/conflicts/DefaultConflictHandler.java new file mode 100644 index 0000000..9ace922 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/graph/conflicts/DefaultConflictHandler.java @@ -0,0 +1,115 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.conflicts; + +import org.gradle.api.Action; +import org.gradle.api.artifacts.ModuleIdentifier; +import org.gradle.api.internal.artifacts.dsl.ModuleReplacementsData; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.ComponentResolutionState; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.ConflictResolverDetails; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.ModuleConflictResolver; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.ComponentState; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.ComponentSelectionDescriptorInternal; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.ComponentSelectionReasons; +import org.gradle.api.logging.Logger; +import org.gradle.api.logging.Logging; +import org.gradle.internal.Describables; +import org.gradle.internal.UncheckedException; + +import javax.annotation.Nullable; +import java.util.Set; + +import static org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.conflicts.PotentialConflictFactory.potentialConflict; + +public class DefaultConflictHandler implements ModuleConflictHandler { + + private final static Logger LOGGER = Logging.getLogger(DefaultConflictHandler.class); + + private final CompositeConflictResolver compositeResolver = new CompositeConflictResolver<>(); + private final ConflictContainer conflicts = new ConflictContainer<>(); + private final ModuleReplacementsData moduleReplacements; + + public DefaultConflictHandler(ModuleConflictResolver conflictResolver, ModuleReplacementsData moduleReplacements) { + this.moduleReplacements = moduleReplacements; + this.compositeResolver.addFirst(conflictResolver); + } + + @Override + public ModuleConflictResolver getResolver() { + return compositeResolver; + } + + /** + * Registers new newModule and returns an instance of a conflict if conflict exists. + */ + @Override + @Nullable + public PotentialConflict registerCandidate(CandidateModule candidate) { + ModuleReplacementsData.Replacement replacement = moduleReplacements.getReplacementFor(candidate.getId()); + ModuleIdentifier replacedBy = replacement == null ? null : replacement.getTarget(); + return potentialConflict(conflicts.newElement(candidate.getId(), candidate.getVersions(), replacedBy)); + } + + /** + * Informs if there are any batched up conflicts. + */ + @Override + public boolean hasConflicts() { + return !conflicts.isEmpty(); + } + + /** + * Resolves the conflict by delegating to the conflict resolver who selects single version from given candidates. Executes provided action against the conflict resolution result object. + */ + @Override + public void resolveNextConflict(Action resolutionAction) { + assert hasConflicts(); + ConflictContainer.Conflict conflict = conflicts.popConflict(); + ConflictResolverDetails details = new DefaultConflictResolverDetails<>(conflict.candidates); + compositeResolver.select(details); + if (details.hasFailure()) { + throw UncheckedException.throwAsUncheckedException(details.getFailure()); + } + ComponentResolutionState selected = details.getSelected(); + ConflictResolutionResult result = new DefaultConflictResolutionResult(conflict.participants, selected); + resolutionAction.execute(result); + if (selected != null) { + maybeSetReason(conflict.participants, selected); + } + LOGGER.debug("Selected {} from conflicting modules {}.", selected, conflict.candidates); + } + + private void maybeSetReason(Set partifipants, ComponentResolutionState selected) { + for (ModuleIdentifier identifier : partifipants) { + ModuleReplacementsData.Replacement replacement = moduleReplacements.getReplacementFor(identifier); + if (replacement != null) { + String reason = replacement.getReason(); + ComponentSelectionDescriptorInternal moduleReplacement = ComponentSelectionReasons.SELECTED_BY_RULE.withDescription(Describables.of(identifier, "replaced with", replacement.getTarget())); + if (reason != null) { + moduleReplacement = moduleReplacement.withDescription(Describables.of(reason)); + } + selected.addCause(moduleReplacement); + } + } + } + + @Override + public void registerResolver(ModuleConflictResolver conflictResolver) { + compositeResolver.addFirst(conflictResolver); + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/graph/selectors/ComponentStateFactory.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/graph/selectors/ComponentStateFactory.java new file mode 100644 index 0000000..a3a40ad --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/graph/selectors/ComponentStateFactory.java @@ -0,0 +1,25 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.selectors; + +import org.gradle.api.artifacts.ModuleVersionIdentifier; +import org.gradle.api.artifacts.component.ComponentIdentifier; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.ComponentResolutionState; +import org.gradle.internal.component.model.ComponentResolveMetadata; + +public interface ComponentStateFactory { + T getRevision(ComponentIdentifier componentIdentifier, ModuleVersionIdentifier id, ComponentResolveMetadata metadata); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/oldresult/DefaultResolvedConfigurationBuilder.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/oldresult/DefaultResolvedConfigurationBuilder.java new file mode 100644 index 0000000..47bba47 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/ivyservice/resolveengine/oldresult/DefaultResolvedConfigurationBuilder.java @@ -0,0 +1,65 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.ivyservice.resolveengine.oldresult; + +import org.gradle.api.artifacts.Dependency; +import org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.DependencyGraphNode; + +import java.util.HashMap; +import java.util.Map; + +public class DefaultResolvedConfigurationBuilder implements ResolvedConfigurationBuilder { + private final Map modulesMap = new HashMap<>(); + private final TransientConfigurationResultsBuilder builder; + + public DefaultResolvedConfigurationBuilder(TransientConfigurationResultsBuilder builder) { + this.builder = builder; + } + + @Override + public void addFirstLevelDependency(Dependency moduleDependency, DependencyGraphNode dependency) { + builder.firstLevelDependency(dependency.getNodeId()); + //we don't serialise the module dependencies at this stage so we need to keep track + //of the mapping module dependency <-> resolved dependency + modulesMap.put(dependency.getNodeId(), moduleDependency); + } + + @Override + public void done(DependencyGraphNode root) { + builder.done(root.getNodeId()); + } + + @Override + public void addChild(DependencyGraphNode parent, DependencyGraphNode child, int artifactsId) { + builder.parentChildMapping(parent.getNodeId(), child.getNodeId(), artifactsId); + } + + @Override + public void addNodeArtifacts(DependencyGraphNode node, int artifactsId) { + builder.nodeArtifacts(node.getNodeId(), artifactsId); + } + + @Override + public void newResolvedDependency(DependencyGraphNode node) { + builder.resolvedDependency(node.getNodeId(), node.getResolvedConfigurationId()); + } + + @Override + public ResolvedGraphResults complete() { + return new DefaultResolvedGraphResults(modulesMap); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/repositories/descriptor/FlatDirRepositoryDescriptor.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/repositories/descriptor/FlatDirRepositoryDescriptor.java new file mode 100644 index 0000000..99a15c1 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/repositories/descriptor/FlatDirRepositoryDescriptor.java @@ -0,0 +1,49 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.repositories.descriptor; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSortedMap; +import org.gradle.internal.scan.UsedByScanPlugin; + +import java.io.File; +import java.util.Collection; + +public final class FlatDirRepositoryDescriptor extends RepositoryDescriptor { + + @UsedByScanPlugin("doesn't link against this type, but expects these values - See ResolveConfigurationDependenciesBuildOperationType") + private enum Property { + DIRS, + } + + public final ImmutableList dirs; + + public FlatDirRepositoryDescriptor(String name, Collection dirs) { + super(name); + this.dirs = ImmutableList.copyOf(dirs); + } + + @Override + public Type getType() { + return Type.FLAT_DIR; + } + + @Override + protected void addProperties(ImmutableSortedMap.Builder builder) { + builder.put(Property.DIRS.name(), dirs); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/repositories/resolver/DirectDependencyMetadataAdapter.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/repositories/resolver/DirectDependencyMetadataAdapter.java new file mode 100644 index 0000000..1e1c834 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/repositories/resolver/DirectDependencyMetadataAdapter.java @@ -0,0 +1,104 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.repositories.resolver; + +import org.gradle.api.artifacts.DependencyArtifact; +import org.gradle.api.artifacts.DirectDependencyMetadata; +import org.gradle.api.internal.artifacts.dependencies.DefaultDependencyArtifact; +import org.gradle.api.internal.attributes.ImmutableAttributesFactory; +import org.gradle.internal.component.external.descriptor.Artifact; +import org.gradle.internal.component.external.model.ConfigurationBoundExternalDependencyMetadata; +import org.gradle.internal.component.external.model.ExternalDependencyDescriptor; +import org.gradle.internal.component.external.model.GradleDependencyMetadata; +import org.gradle.internal.component.external.model.ModuleDependencyMetadata; +import org.gradle.internal.component.external.model.ivy.IvyDependencyDescriptor; +import org.gradle.internal.component.external.model.maven.MavenDependencyDescriptor; +import org.gradle.internal.component.model.IvyArtifactName; + +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +public class DirectDependencyMetadataAdapter extends AbstractDependencyMetadataAdapter implements DirectDependencyMetadata { + + public DirectDependencyMetadataAdapter(ImmutableAttributesFactory attributesFactory, List container, int originalIndex) { + super(attributesFactory, container, originalIndex); + } + + @Override + public void endorseStrictVersions() { + updateMetadata(getOriginalMetadata().withEndorseStrictVersions(true)); + } + + @Override + public void doNotEndorseStrictVersions() { + updateMetadata(getOriginalMetadata().withEndorseStrictVersions(false)); + } + + @Override + public boolean isEndorsingStrictVersions() { + return getOriginalMetadata().isEndorsingStrictVersions(); + } + + @Override + public List getArtifactSelectors() { + return getIvyArtifacts().stream().map(this::asDependencyArtifact).collect(Collectors.toList()); + } + + private DependencyArtifact asDependencyArtifact(IvyArtifactName ivyArtifactName) { + return new DefaultDependencyArtifact(ivyArtifactName.getName(), ivyArtifactName.getType(), ivyArtifactName.getExtension(), ivyArtifactName.getClassifier(), null); + } + + private List getIvyArtifacts() { + ModuleDependencyMetadata originalMetadata = getOriginalMetadata(); + if (originalMetadata instanceof ConfigurationBoundExternalDependencyMetadata) { + ConfigurationBoundExternalDependencyMetadata externalMetadata = (ConfigurationBoundExternalDependencyMetadata) originalMetadata; + ExternalDependencyDescriptor descriptor = externalMetadata.getDependencyDescriptor(); + if (descriptor instanceof MavenDependencyDescriptor) { + return fromMavenDescriptor((MavenDependencyDescriptor) descriptor); + } + if (descriptor instanceof IvyDependencyDescriptor) { + return fromIvyDescriptor((IvyDependencyDescriptor) descriptor); + } + } else if (originalMetadata instanceof GradleDependencyMetadata){ + return fromGradleMetadata((GradleDependencyMetadata) originalMetadata); + } + return Collections.emptyList(); + } + + private List fromGradleMetadata(GradleDependencyMetadata metadata) { + IvyArtifactName artifact = metadata.getDependencyArtifact(); + if(artifact != null) { + return Collections.singletonList(artifact); + } + return Collections.emptyList(); + } + + private List fromIvyDescriptor(IvyDependencyDescriptor descriptor) { + List artifacts = descriptor.getDependencyArtifacts(); + return artifacts.stream().map(Artifact::getArtifactName).collect(Collectors.toList()); + } + + private List fromMavenDescriptor(MavenDependencyDescriptor descriptor) { + IvyArtifactName artifact = descriptor.getDependencyArtifact(); + if(artifact != null) { + return Collections.singletonList(artifact); + } + return Collections.emptyList(); + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/repositories/resolver/MavenResolver.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/repositories/resolver/MavenResolver.java new file mode 100644 index 0000000..53c1006 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/repositories/resolver/MavenResolver.java @@ -0,0 +1,296 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.repositories.resolver; + +import com.google.common.collect.ImmutableSet; +import org.gradle.api.artifacts.ComponentMetadataListerDetails; +import org.gradle.api.artifacts.ComponentMetadataSupplierDetails; +import org.gradle.api.artifacts.component.ModuleComponentIdentifier; +import org.gradle.api.internal.artifacts.ivyservice.ivyresolve.ModuleComponentRepositoryAccess; +import org.gradle.api.internal.artifacts.repositories.maven.MavenMetadata; +import org.gradle.api.internal.artifacts.repositories.maven.MavenMetadataLoader; +import org.gradle.api.internal.artifacts.repositories.metadata.ImmutableMetadataSources; +import org.gradle.api.internal.artifacts.repositories.metadata.MetadataArtifactProvider; +import org.gradle.api.internal.artifacts.repositories.transport.RepositoryTransport; +import org.gradle.api.internal.component.ArtifactType; +import org.gradle.api.resources.MissingResourceException; +import org.gradle.internal.action.InstantiatingAction; +import org.gradle.internal.component.external.model.FixedComponentArtifacts; +import org.gradle.internal.component.external.model.MetadataSourcedComponentArtifacts; +import org.gradle.internal.component.external.model.ModuleComponentArtifactIdentifier; +import org.gradle.internal.component.external.model.ModuleComponentArtifactMetadata; +import org.gradle.internal.component.external.model.maven.MavenModuleResolveMetadata; +import org.gradle.internal.component.external.model.maven.MutableMavenModuleResolveMetadata; +import org.gradle.internal.component.model.ComponentOverrideMetadata; +import org.gradle.internal.component.model.ConfigurationMetadata; +import org.gradle.internal.component.model.ModuleSources; +import org.gradle.internal.component.model.MutableModuleSources; +import org.gradle.internal.hash.ChecksumService; +import org.gradle.internal.reflect.Instantiator; +import org.gradle.internal.resolve.result.BuildableArtifactSetResolveResult; +import org.gradle.internal.resolve.result.BuildableComponentArtifactsResolveResult; +import org.gradle.internal.resolve.result.BuildableModuleComponentMetaDataResolveResult; +import org.gradle.internal.resolve.result.DefaultResourceAwareResolveResult; +import org.gradle.internal.resolve.result.ResourceAwareResolveResult; +import org.gradle.internal.resource.ExternalResourceName; +import org.gradle.internal.resource.local.FileStore; +import org.gradle.internal.resource.local.LocallyAvailableResourceFinder; + +import javax.annotation.Nullable; +import java.net.URI; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class MavenResolver extends ExternalResourceResolver { + private final URI root; + private final List artifactRoots = new ArrayList<>(); + private final MavenMetadataLoader mavenMetaDataLoader; + + private static final Pattern UNIQUE_SNAPSHOT = Pattern.compile("(?:.+)-(\\d{8}\\.\\d{6}-\\d+)"); + private final MavenLocalRepositoryAccess localAccess = new MavenLocalRepositoryAccess(); + private final MavenRemoteRepositoryAccess remoteAccess = new MavenRemoteRepositoryAccess(); + + public MavenResolver(String name, + URI rootUri, + RepositoryTransport transport, + LocallyAvailableResourceFinder locallyAvailableResourceFinder, + FileStore artifactFileStore, + ImmutableMetadataSources metadataSources, + MetadataArtifactProvider metadataArtifactProvider, + MavenMetadataLoader mavenMetadataLoader, + @Nullable InstantiatingAction componentMetadataSupplierFactory, + @Nullable InstantiatingAction versionListerFactory, + Instantiator injector, + ChecksumService checksumService) { + super(name, transport.isLocal(), + transport.getRepository(), + transport.getResourceAccessor(), + locallyAvailableResourceFinder, + artifactFileStore, + metadataSources, + metadataArtifactProvider, + componentMetadataSupplierFactory, + versionListerFactory, + injector, + checksumService); + this.mavenMetaDataLoader = mavenMetadataLoader; + this.root = rootUri; + updatePatterns(); + } + + @Override + public String toString() { + return "Maven repository '" + getName() + "'"; + } + + @Override + protected Class getSupportedMetadataType() { + return MavenModuleResolveMetadata.class; + } + + public URI getRoot() { + return root; + } + + @Override + protected void doResolveComponentMetaData(ModuleComponentIdentifier moduleComponentIdentifier, ComponentOverrideMetadata prescribedMetaData, BuildableModuleComponentMetaDataResolveResult result) { + if (isNonUniqueSnapshot(moduleComponentIdentifier)) { + MavenUniqueSnapshotModuleSource uniqueSnapshotVersion = findUniqueSnapshotVersion(moduleComponentIdentifier, result); + if (uniqueSnapshotVersion != null) { + MavenUniqueSnapshotComponentIdentifier snapshotIdentifier = composeSnapshotIdentifier(moduleComponentIdentifier, uniqueSnapshotVersion); + resolveUniqueSnapshotDependency(snapshotIdentifier, prescribedMetaData, result, uniqueSnapshotVersion); + return; + } + } else { + MavenUniqueSnapshotModuleSource uniqueSnapshotVersion = composeUniqueSnapshotVersion(moduleComponentIdentifier); + if (uniqueSnapshotVersion != null) { + MavenUniqueSnapshotComponentIdentifier snapshotIdentifier = composeSnapshotIdentifier(moduleComponentIdentifier, uniqueSnapshotVersion); + resolveUniqueSnapshotDependency(snapshotIdentifier, prescribedMetaData, result, uniqueSnapshotVersion); + return; + } + } + + resolveStaticDependency(moduleComponentIdentifier, prescribedMetaData, result, super.createArtifactResolver()); + } + + @Override + protected boolean isMetaDataArtifact(ArtifactType artifactType) { + return artifactType == ArtifactType.MAVEN_POM; + } + + private void resolveUniqueSnapshotDependency(MavenUniqueSnapshotComponentIdentifier module, ComponentOverrideMetadata prescribedMetaData, BuildableModuleComponentMetaDataResolveResult result, MavenUniqueSnapshotModuleSource snapshotSource) { + resolveStaticDependency(module, prescribedMetaData, result, createArtifactResolver(MutableModuleSources.of(snapshotSource))); + } + + @Override + protected ExternalResourceArtifactResolver createArtifactResolver(final ModuleSources moduleSources) { + return moduleSources.withSource(MavenUniqueSnapshotModuleSource.class, source -> { + if (source.isPresent()) { + return new MavenUniqueSnapshotExternalResourceArtifactResolver(super.createArtifactResolver(moduleSources), source.get()); + } else { + return super.createArtifactResolver(moduleSources); + } + }); + } + + public void addArtifactLocation(URI baseUri) { + artifactRoots.add(baseUri); + updatePatterns(); + } + + private M2ResourcePattern getWholePattern() { + return new M2ResourcePattern(root, MavenPattern.M2_PATTERN); + } + + private void updatePatterns() { + setIvyPatterns(Collections.singletonList(getWholePattern())); + + List artifactPatterns = new ArrayList<>(); + artifactPatterns.add(getWholePattern()); + for (URI artifactRoot : artifactRoots) { + artifactPatterns.add(new M2ResourcePattern(artifactRoot, MavenPattern.M2_PATTERN)); + } + setArtifactPatterns(artifactPatterns); + } + + @Nullable + private MavenUniqueSnapshotModuleSource findUniqueSnapshotVersion(ModuleComponentIdentifier module, ResourceAwareResolveResult result) { + M2ResourcePattern wholePattern = getWholePattern(); + if (!wholePattern.isComplete(module)) { + //do not attempt to download maven-metadata.xml for incomplete identifiers + return null; + } + ExternalResourceName metadataLocation = wholePattern.toModuleVersionPath(module).resolve("maven-metadata.xml"); + result.attempted(metadataLocation); + MavenMetadata mavenMetadata = parseMavenMetadata(metadataLocation); + + if (mavenMetadata.timestamp != null) { + // we have found a timestamp, so this is a snapshot unique version + String timestamp = mavenMetadata.timestamp + "-" + mavenMetadata.buildNumber; + return new MavenUniqueSnapshotModuleSource(timestamp); + } + return null; + } + + @Nullable + private MavenUniqueSnapshotModuleSource composeUniqueSnapshotVersion(ModuleComponentIdentifier moduleComponentIdentifier) { + Matcher matcher = UNIQUE_SNAPSHOT.matcher(moduleComponentIdentifier.getVersion()); + if (!matcher.matches()) { + return null; + } + return new MavenUniqueSnapshotModuleSource(matcher.group(1)); + } + + private MavenMetadata parseMavenMetadata(ExternalResourceName metadataLocation) { + try { + return mavenMetaDataLoader.load(metadataLocation); + } catch (MissingResourceException e) { + return new MavenMetadata(); + } + } + + @Override + public ModuleComponentRepositoryAccess getLocalAccess() { + return localAccess; + } + + @Override + public ModuleComponentRepositoryAccess getRemoteAccess() { + return remoteAccess; + } + + public static MutableMavenModuleResolveMetadata processMetaData(MutableMavenModuleResolveMetadata metaData) { + ModuleComponentIdentifier id = metaData.getId(); + if (isNonUniqueSnapshot(id)) { + metaData.setChanging(true); + } + if (isUniqueSnapshot(id)) { + MavenUniqueSnapshotComponentIdentifier mus = (MavenUniqueSnapshotComponentIdentifier) id; + metaData.setSnapshotTimestamp(mus.getTimestamp()); + } + return metaData; + } + + private class MavenLocalRepositoryAccess extends LocalRepositoryAccess { + @Override + protected void resolveModuleArtifacts(MavenModuleResolveMetadata module, ConfigurationMetadata variant, BuildableComponentArtifactsResolveResult result) { + if (!variant.requiresMavenArtifactDiscovery()) { + result.resolved(new MetadataSourcedComponentArtifacts()); + } else if (module.isKnownJarPackaging()) { + ModuleComponentArtifactMetadata artifact = module.artifact("jar", "jar", null); + result.resolved(new FixedComponentArtifacts(ImmutableSet.of(artifact))); + } else if (module.isRelocated()) { + result.resolved(new FixedComponentArtifacts(Collections.emptyList())); + } + } + + @Override + protected void resolveJavadocArtifacts(MavenModuleResolveMetadata module, BuildableArtifactSetResolveResult result) { + // Javadoc artifacts are optional, so we need to probe for them remotely + } + + @Override + protected void resolveSourceArtifacts(MavenModuleResolveMetadata module, BuildableArtifactSetResolveResult result) { + // Source artifacts are optional, so we need to probe for them remotely + } + } + + private class MavenRemoteRepositoryAccess extends RemoteRepositoryAccess { + @Override + protected void resolveModuleArtifacts(MavenModuleResolveMetadata module, ConfigurationMetadata variant, BuildableComponentArtifactsResolveResult result) { + if (module.isPomPackaging()) { + result.resolved(new FixedComponentArtifacts(findOptionalArtifacts(module, "jar", null))); + } else { + ModuleComponentArtifactMetadata artifactMetaData = module.artifact(module.getPackaging(), module.getPackaging(), null); + + if (createArtifactResolver(module.getSources()).artifactExists(artifactMetaData, new DefaultResourceAwareResolveResult())) { + result.resolved(new FixedComponentArtifacts(ImmutableSet.of(artifactMetaData))); + } else { + ModuleComponentArtifactMetadata artifact = module.artifact("jar", "jar", null); + result.resolved(new FixedComponentArtifacts(ImmutableSet.of(artifact))); + } + } + } + + @Override + protected void resolveJavadocArtifacts(MavenModuleResolveMetadata module, BuildableArtifactSetResolveResult result) { + result.resolved(findOptionalArtifacts(module, "javadoc", "javadoc")); + } + + @Override + protected void resolveSourceArtifacts(MavenModuleResolveMetadata module, BuildableArtifactSetResolveResult result) { + result.resolved(findOptionalArtifacts(module, "source", "sources")); + } + } + + private static boolean isUniqueSnapshot(ModuleComponentIdentifier id) { + return id instanceof MavenUniqueSnapshotComponentIdentifier; + } + + protected static boolean isNonUniqueSnapshot(ModuleComponentIdentifier moduleComponentIdentifier) { + return moduleComponentIdentifier.getVersion().endsWith("-SNAPSHOT"); + } + + private MavenUniqueSnapshotComponentIdentifier composeSnapshotIdentifier(ModuleComponentIdentifier moduleComponentIdentifier, MavenUniqueSnapshotModuleSource uniqueSnapshotVersion) { + return new MavenUniqueSnapshotComponentIdentifier( + moduleComponentIdentifier.getModuleIdentifier(), + moduleComponentIdentifier.getVersion(), + uniqueSnapshotVersion.getTimestamp()); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/repositories/resolver/MavenUniqueSnapshotExternalResourceArtifactResolver.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/repositories/resolver/MavenUniqueSnapshotExternalResourceArtifactResolver.java new file mode 100644 index 0000000..692e219 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/repositories/resolver/MavenUniqueSnapshotExternalResourceArtifactResolver.java @@ -0,0 +1,56 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.artifacts.repositories.resolver; + +import org.gradle.internal.component.external.model.DefaultModuleComponentArtifactMetadata; +import org.gradle.internal.component.external.model.ModuleComponentArtifactMetadata; +import org.gradle.internal.component.external.model.UrlBackedArtifactMetadata; +import org.gradle.internal.resolve.result.ResourceAwareResolveResult; +import org.gradle.internal.resource.local.LocallyAvailableExternalResource; + +class MavenUniqueSnapshotExternalResourceArtifactResolver implements ExternalResourceArtifactResolver { + private final ExternalResourceArtifactResolver delegate; + private final MavenUniqueSnapshotModuleSource snapshot; + + public MavenUniqueSnapshotExternalResourceArtifactResolver(ExternalResourceArtifactResolver delegate, MavenUniqueSnapshotModuleSource snapshot) { + this.delegate = delegate; + this.snapshot = snapshot; + } + + @Override + public boolean artifactExists(ModuleComponentArtifactMetadata artifact, ResourceAwareResolveResult result) { + if (artifact instanceof UrlBackedArtifactMetadata) { + return delegate.artifactExists(artifact, result); + } else { + return delegate.artifactExists(timestamp(artifact), result); + } + } + + @Override + public LocallyAvailableExternalResource resolveArtifact(ModuleComponentArtifactMetadata artifact, ResourceAwareResolveResult result) { + if (artifact instanceof UrlBackedArtifactMetadata) { + return delegate.resolveArtifact(artifact, result); + } else { + return delegate.resolveArtifact(timestamp(artifact), result); + } + } + + protected ModuleComponentArtifactMetadata timestamp(ModuleComponentArtifactMetadata artifact) { + MavenUniqueSnapshotComponentIdentifier snapshotComponentIdentifier = + new MavenUniqueSnapshotComponentIdentifier(artifact.getId().getComponentIdentifier(), snapshot.getTimestamp()); + return new DefaultModuleComponentArtifactMetadata(snapshotComponentIdentifier, artifact.getName()); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/transform/ExtraExecutionGraphDependenciesResolverFactory.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/transform/ExtraExecutionGraphDependenciesResolverFactory.java new file mode 100644 index 0000000..c2ac08f --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/api/internal/artifacts/transform/ExtraExecutionGraphDependenciesResolverFactory.java @@ -0,0 +1,34 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.artifacts.transform; + +import org.gradle.api.artifacts.component.ComponentIdentifier; + +/** + * Factory for {@link TransformUpstreamDependenciesResolver} that relies on the information provided to its {@code create} method. + */ +public interface ExtraExecutionGraphDependenciesResolverFactory { + /** + * Creates a {@link TransformUpstreamDependenciesResolver} for the given {@code ComponentIdentifier} and {@code Transformation}. + * + * @param componentIdentifier the identifier of the component whose artifacts will be transformed. + * @param transformation the transformation that will be applied. + * + * @return an {@code ExecutionGraphDependenciesResolver} based on the provided parameters + */ + TransformUpstreamDependenciesResolver create(ComponentIdentifier componentIdentifier, Transformation transformation); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/component/StyledDescriber.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/component/StyledDescriber.java new file mode 100644 index 0000000..7361463 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/component/StyledDescriber.java @@ -0,0 +1,54 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.internal.component; + +import org.gradle.api.attributes.Attribute; +import org.gradle.api.internal.attributes.AttributeDescriber; +import org.gradle.internal.exceptions.StyledException; +import org.gradle.internal.logging.text.StyledTextOutput; + +import java.util.Map; +import java.util.Set; + +class StyledDescriber implements AttributeDescriber { + + private final AttributeDescriber delegate; + + StyledDescriber(AttributeDescriber delegate) { + this.delegate = delegate; + } + + @Override + public Set> getAttributes() { + return delegate.getAttributes(); + } + + @Override + public String describeAttributeSet(Map, ?> attributes) { + return StyledException.style(StyledTextOutput.Style.Header, delegate.describeAttributeSet(attributes)); + } + + @Override + public String describeMissingAttribute(Attribute attribute, Object consumerValue) { + return StyledException.style(StyledTextOutput.Style.Info, delegate.describeMissingAttribute(attribute, consumerValue)); + } + + @Override + public String describeExtraAttribute(Attribute attribute, Object producerValue) { + return StyledException.style(StyledTextOutput.Style.Info, delegate.describeExtraAttribute(attribute, producerValue)); + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/component/external/model/AbstractStatelessDerivationStrategy.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/component/external/model/AbstractStatelessDerivationStrategy.java new file mode 100644 index 0000000..70c9329 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/component/external/model/AbstractStatelessDerivationStrategy.java @@ -0,0 +1,37 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.internal.component.external.model; + +public abstract class AbstractStatelessDerivationStrategy implements VariantDerivationStrategy { + private final int hashCode; + + protected AbstractStatelessDerivationStrategy() { + hashCode = this.getClass().getName().hashCode(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + return o != null && getClass() == o.getClass(); + } + + @Override + public int hashCode() { + return hashCode; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/component/external/model/CapabilityInternal.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/component/external/model/CapabilityInternal.java new file mode 100644 index 0000000..475aee7 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/component/external/model/CapabilityInternal.java @@ -0,0 +1,22 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.internal.component.external.model; + +import org.gradle.api.capabilities.Capability; + +public interface CapabilityInternal extends Capability { + String getCapabilityId(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/component/external/model/ivy/IvyConfigurationHelper.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/component/external/model/ivy/IvyConfigurationHelper.java new file mode 100644 index 0000000..5539cc3 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/component/external/model/ivy/IvyConfigurationHelper.java @@ -0,0 +1,123 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.component.external.model.ivy; + +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSet; +import org.gradle.api.artifacts.component.ModuleComponentIdentifier; +import org.gradle.internal.component.external.descriptor.Artifact; +import org.gradle.internal.component.external.model.ConfigurationBoundExternalDependencyMetadata; +import org.gradle.internal.component.external.model.DefaultModuleComponentArtifactMetadata; +import org.gradle.internal.component.external.model.ModuleComponentArtifactMetadata; +import org.gradle.internal.component.external.model.ModuleDependencyMetadata; +import org.gradle.internal.component.model.ConfigurationMetadata; +import org.gradle.internal.component.model.Exclude; +import org.gradle.internal.component.model.ExcludeMetadata; + +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Set; + +class IvyConfigurationHelper { + + private final ImmutableList artifactDefinitions; + private final Map artifacts; + private final ImmutableList excludes; + private final ImmutableList dependencies; + private final ModuleComponentIdentifier componentId; + + IvyConfigurationHelper(ImmutableList artifactDefinitions, Map artifacts, ImmutableList excludes, ImmutableList dependencies, ModuleComponentIdentifier componentId) { + + this.artifactDefinitions = artifactDefinitions; + this.artifacts = artifacts; + this.excludes = excludes; + this.dependencies = dependencies; + this.componentId = componentId; + } + + ImmutableList filterArtifacts(String name, Collection hierarchy) { + Set artifacts = new LinkedHashSet<>(); + collectArtifactsFor(name, artifacts); + for (String parent : hierarchy) { + collectArtifactsFor(parent, artifacts); + } + return ImmutableList.copyOf(artifacts); + } + + private void collectArtifactsFor(String name, Collection dest) { + for (Artifact artifact : artifactDefinitions) { + if (artifact.getConfigurations().contains(name)) { + ModuleComponentArtifactMetadata artifactMetadata = artifacts.get(artifact); + if (artifactMetadata == null) { + artifactMetadata = new DefaultModuleComponentArtifactMetadata(componentId, artifact.getArtifactName()); + artifacts.put(artifact, artifactMetadata); + } + dest.add(artifactMetadata); + } + } + } + + ImmutableList filterExcludes(ImmutableSet hierarchy) { + ImmutableList.Builder filtered = ImmutableList.builder(); + for (Exclude exclude : excludes) { + for (String config : exclude.getConfigurations()) { + if (hierarchy.contains(config)) { + filtered.add(exclude); + break; + } + } + } + return filtered.build(); + } + + ImmutableList filterDependencies(ConfigurationMetadata config) { + ImmutableList.Builder filteredDependencies = ImmutableList.builder(); + for (IvyDependencyDescriptor dependency : dependencies) { + if (include(dependency, config.getName(), config.getHierarchy())) { + filteredDependencies.add(contextualize(config, componentId, dependency)); + } + } + return filteredDependencies.build(); + } + + ModuleDependencyMetadata contextualize(ConfigurationMetadata config, ModuleComponentIdentifier componentId, IvyDependencyDescriptor incoming) { + return new ConfigurationBoundExternalDependencyMetadata(config, componentId, incoming); + } + + private boolean include(IvyDependencyDescriptor dependency, String configName, Collection hierarchy) { + Set dependencyConfigurations = dependency.getConfMappings().keySet(); + for (String moduleConfiguration : dependencyConfigurations) { + if (moduleConfiguration.equals("%") || hierarchy.contains(moduleConfiguration)) { + return true; + } + if (moduleConfiguration.equals("*")) { + boolean include = true; + for (String conf2 : dependencyConfigurations) { + if (conf2.startsWith("!") && conf2.substring(1).equals(configName)) { + include = false; + break; + } + } + if (include) { + return true; + } + } + } + return false; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/resolve/caching/ComponentMetadataSupplierRuleExecutor.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/resolve/caching/ComponentMetadataSupplierRuleExecutor.java new file mode 100644 index 0000000..33f8fb8 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/resolve/caching/ComponentMetadataSupplierRuleExecutor.java @@ -0,0 +1,62 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.internal.resolve.caching; + +import org.gradle.api.Transformer; +import org.gradle.api.artifacts.ComponentMetadata; +import org.gradle.api.artifacts.ComponentMetadataSupplierDetails; +import org.gradle.api.artifacts.ModuleVersionIdentifier; +import org.gradle.api.artifacts.ResolvedModuleVersion; +import org.gradle.cache.CacheRepository; +import org.gradle.cache.internal.InMemoryCacheDecoratorFactory; +import org.gradle.internal.serialize.Serializer; +import org.gradle.internal.snapshot.ValueSnapshotter; +import org.gradle.util.internal.BuildCommencedTimeProvider; + +import java.time.Duration; + +public class ComponentMetadataSupplierRuleExecutor extends CrossBuildCachingRuleExecutor { + private final static Transformer KEY_TO_SNAPSHOTTABLE = Object::toString; + + public ComponentMetadataSupplierRuleExecutor(CacheRepository cacheRepository, + InMemoryCacheDecoratorFactory cacheDecoratorFactory, + ValueSnapshotter snapshotter, + BuildCommencedTimeProvider timeProvider, + Serializer componentMetadataSerializer) { + super("md-supplier", cacheRepository, cacheDecoratorFactory, snapshotter, timeProvider, createValidator(timeProvider), KEY_TO_SNAPSHOTTABLE, componentMetadataSerializer); + } + + public static EntryValidator createValidator(final BuildCommencedTimeProvider timeProvider) { + return (policy, entry) -> { + Duration age = Duration.ofMillis(timeProvider.getCurrentTime() - entry.getTimestamp()); + final ComponentMetadata result = entry.getResult(); + return !policy.moduleExpiry(new SimpleResolvedModuleVersion(result), age, result.isChanging()).isMustCheck(); + }; + } + + private static class SimpleResolvedModuleVersion implements ResolvedModuleVersion { + private final ComponentMetadata result; + + public SimpleResolvedModuleVersion(ComponentMetadata result) { + this.result = result; + } + + @Override + public ModuleVersionIdentifier getId() { + return result.getId(); + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/resolve/result/BuildableComponentArtifactsResolveResult.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/resolve/result/BuildableComponentArtifactsResolveResult.java new file mode 100644 index 0000000..39cc15c --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/resolve/result/BuildableComponentArtifactsResolveResult.java @@ -0,0 +1,23 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.internal.resolve.result; + +import org.gradle.internal.component.model.ComponentArtifacts; +import org.gradle.internal.resolve.ArtifactResolveException; + +public interface BuildableComponentArtifactsResolveResult extends ResolveResult, BuildableTypedResolveResult { + boolean isSuccessful(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/resolve/result/BuildableComponentResolveResult.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/resolve/result/BuildableComponentResolveResult.java new file mode 100644 index 0000000..6b3d54d --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/resolve/result/BuildableComponentResolveResult.java @@ -0,0 +1,44 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.resolve.result; + +import org.gradle.api.artifacts.component.ModuleComponentIdentifier; +import org.gradle.internal.component.model.ComponentResolveMetadata; +import org.gradle.internal.resolve.ModuleVersionResolveException; + +public interface BuildableComponentResolveResult extends ComponentResolveResult, ResourceAwareResolveResult { + /** + * Marks the component as resolved, with the given meta-data. + */ + void resolved(ComponentResolveMetadata metaData); + + /** + * Marks the resolve as failed with the given exception. + */ + BuildableComponentResolveResult failed(ModuleVersionResolveException failure); + + /** + * Marks the component as not found. + */ + void notFound(ModuleComponentIdentifier versionIdentifier); + + /** + * Replaces the meta-data in the result. Result must already be resolved. + */ + void setMetadata(ComponentResolveMetadata metadata); + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/rules/NoInputsRuleAction.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/rules/NoInputsRuleAction.java new file mode 100644 index 0000000..571314c --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/dependency-management/org/gradle/internal/rules/NoInputsRuleAction.java @@ -0,0 +1,58 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.rules; + +import org.gradle.api.Action; + +import java.util.Collections; +import java.util.List; + +public class NoInputsRuleAction implements RuleAction { + private final Action action; + + public NoInputsRuleAction(Action action) { + this.action = action; + } + + @Override + public List> getInputTypes() { + return Collections.emptyList(); + } + + @Override + public void execute(T subject, List inputs) { + action.execute(subject); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + NoInputsRuleAction that = (NoInputsRuleAction) o; + return action.equals(that.action); + } + + @Override + public int hashCode() { + return action.hashCode(); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/diagnostics/org/gradle/api/reporting/dependents/internal/DependentComponentsRenderableDependency.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/diagnostics/org/gradle/api/reporting/dependents/internal/DependentComponentsRenderableDependency.java new file mode 100644 index 0000000..fbe5d3a --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/diagnostics/org/gradle/api/reporting/dependents/internal/DependentComponentsRenderableDependency.java @@ -0,0 +1,118 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.reporting.dependents.internal; + +import com.google.common.collect.Sets; +import org.gradle.api.artifacts.component.LibraryBinaryIdentifier; +import org.gradle.api.tasks.diagnostics.internal.graph.nodes.AbstractRenderableDependency; +import org.gradle.api.tasks.diagnostics.internal.graph.nodes.RenderableDependency; +import org.gradle.platform.base.BinarySpec; +import org.gradle.platform.base.ComponentSpec; +import org.gradle.platform.base.VariantComponentSpec; +import org.gradle.platform.base.internal.ComponentSpecIdentifier; +import org.gradle.platform.base.internal.ComponentSpecInternal; +import org.gradle.platform.base.internal.dependents.DependentBinariesResolvedResult; + +import java.util.LinkedHashSet; +import java.util.Set; + +import static com.google.common.base.Preconditions.checkNotNull; +import static com.google.common.base.Strings.emptyToNull; + +public class DependentComponentsRenderableDependency extends AbstractRenderableDependency { + + public static DependentComponentsRenderableDependency of(ComponentSpec componentSpec, ComponentSpecInternal internalProtocol) { + return of(componentSpec, internalProtocol, new LinkedHashSet<>()); + } + + public static DependentComponentsRenderableDependency of(ComponentSpec componentSpec, ComponentSpecInternal internalProtocol, LinkedHashSet children) { + ComponentSpecIdentifier id = internalProtocol.getIdentifier(); + String name = DependentComponentsUtils.getBuildScopedTerseName(id); + String description = componentSpec.getDisplayName(); + boolean buildable = true; + if (componentSpec instanceof VariantComponentSpec) { + // Consider variant aware components with no buildable binaries as non-buildables + VariantComponentSpec variantComponentSpec = (VariantComponentSpec) componentSpec; + buildable = variantComponentSpec.getBinaries().values().stream().anyMatch(BinarySpec::isBuildable); + } + return new DependentComponentsRenderableDependency(id, name, description, buildable, false, children); + } + + public static DependentComponentsRenderableDependency of(DependentBinariesResolvedResult resolvedResult) { + LibraryBinaryIdentifier id = resolvedResult.getId(); + String name = DependentComponentsUtils.getBuildScopedTerseName(id); + String description = id.getDisplayName(); + boolean buildable = resolvedResult.isBuildable(); + boolean testSuite = resolvedResult.isTestSuite(); + LinkedHashSet children = Sets.newLinkedHashSet(); + for (DependentBinariesResolvedResult childResolutionResult : resolvedResult.getChildren()) { + children.add(of(childResolutionResult)); + } + return new DependentComponentsRenderableDependency(id, name, description, buildable, testSuite, children); + } + + private final Object id; + private final String name; + private final String description; + private final boolean buildable; + private final boolean testSuite; + private final LinkedHashSet children; + + public DependentComponentsRenderableDependency(Object id, String name, String description, boolean buildable, boolean testSuite, LinkedHashSet children) { + checkNotNull(id, "id must not be null"); + checkNotNull(emptyToNull(name), "name must not be null nor empty"); + this.id = id; + this.name = name; + this.description = emptyToNull(description); + this.buildable = buildable; + this.testSuite = testSuite; + this.children = children; + } + + @Override + public Object getId() { + return id; + } + + @Override + public String getName() { + return name; + } + + @Override + public String getDescription() { + return description; + } + + @Override + public ResolutionState getResolutionState() { + return ResolutionState.RESOLVED; + } + + @Override + public Set getChildren() { + return children; + } + + public boolean isBuildable() { + return buildable; + } + + public boolean isTestSuite() { + return testSuite; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/enterprise/org/gradle/internal/enterprise/impl/legacy/DefaultBuildScanScopeIds.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/enterprise/org/gradle/internal/enterprise/impl/legacy/DefaultBuildScanScopeIds.java new file mode 100644 index 0000000..6e8cc7f --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/enterprise/org/gradle/internal/enterprise/impl/legacy/DefaultBuildScanScopeIds.java @@ -0,0 +1,50 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.enterprise.impl.legacy; + +import org.gradle.internal.scan.scopeids.BuildScanScopeIds; +import org.gradle.internal.scopeids.id.BuildInvocationScopeId; +import org.gradle.internal.scopeids.id.UserScopeId; +import org.gradle.internal.scopeids.id.WorkspaceScopeId; + +public class DefaultBuildScanScopeIds implements BuildScanScopeIds { + + private final BuildInvocationScopeId buildInvocationId; + private final WorkspaceScopeId workspaceId; + private final UserScopeId userId; + + public DefaultBuildScanScopeIds(BuildInvocationScopeId buildInvocationId, WorkspaceScopeId workspaceId, UserScopeId userId) { + this.buildInvocationId = buildInvocationId; + this.workspaceId = workspaceId; + this.userId = userId; + } + + @Override + public String getBuildInvocationId() { + return buildInvocationId.getId().asString(); + } + + @Override + public String getWorkspaceId() { + return workspaceId.getId().asString(); + } + + @Override + public String getUserId() { + return userId.getId().asString(); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/execution/org/gradle/internal/execution/fingerprint/FileCollectionFingerprinterRegistry.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/execution/org/gradle/internal/execution/fingerprint/FileCollectionFingerprinterRegistry.java new file mode 100644 index 0000000..3f263e2 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/execution/org/gradle/internal/execution/fingerprint/FileCollectionFingerprinterRegistry.java @@ -0,0 +1,21 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.execution.fingerprint; + +public interface FileCollectionFingerprinterRegistry { + FileCollectionFingerprinter getFingerprinter(FileNormalizationSpec spec); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/execution/org/gradle/internal/execution/history/changes/DefaultExecutionStateChangeDetector.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/execution/org/gradle/internal/execution/history/changes/DefaultExecutionStateChangeDetector.java new file mode 100644 index 0000000..129be92 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/execution/org/gradle/internal/execution/history/changes/DefaultExecutionStateChangeDetector.java @@ -0,0 +1,239 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.execution.history.changes; + +import com.google.common.collect.ImmutableCollection; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.ImmutableSortedMap; +import org.gradle.api.Describable; +import org.gradle.internal.Cast; +import org.gradle.internal.execution.history.AfterPreviousExecutionState; +import org.gradle.internal.execution.history.BeforeExecutionState; +import org.gradle.internal.fingerprint.CurrentFileCollectionFingerprint; +import org.gradle.internal.snapshot.FileSystemSnapshot; +import org.gradle.internal.snapshot.impl.KnownImplementationSnapshot; + +import static org.gradle.internal.execution.history.impl.OutputSnapshotUtil.findOutputsStillPresentSincePreviousExecution; + +public class DefaultExecutionStateChangeDetector implements ExecutionStateChangeDetector { + @Override + public ExecutionStateChanges detectChanges(AfterPreviousExecutionState lastExecution, BeforeExecutionState thisExecution, Describable executable, IncrementalInputProperties incrementalInputProperties) { + // Capture changes in execution outcome + ChangeContainer previousSuccessState = new PreviousSuccessChanges( + lastExecution.isSuccessful()); + + // Capture changes to implementation + + // After validation, the current implementations can't be unknown when detecting changes. + // Previous implementations can still be unknown, since we store the inputs in the task history even if validation fails. + // When we fail the build for unknown implementations, then the previous implementations also can't be unknown. + KnownImplementationSnapshot currentImplementation = Cast.uncheckedNonnullCast(thisExecution.getImplementation()); + ImmutableList currentAdditionalImplementations = Cast.uncheckedNonnullCast(thisExecution.getAdditionalImplementations()); + ChangeContainer implementationChanges = new ImplementationChanges( + lastExecution.getImplementation(), lastExecution.getAdditionalImplementations(), + currentImplementation, currentAdditionalImplementations, + executable); + + // Capture non-file input changes + ChangeContainer inputPropertyChanges = new PropertyChanges( + lastExecution.getInputProperties().keySet(), + thisExecution.getInputProperties().keySet(), + "Input", + executable); + ChangeContainer inputPropertyValueChanges = new InputValueChanges( + lastExecution.getInputProperties(), + thisExecution.getInputProperties(), + executable); + + // Capture input files state + ChangeContainer inputFilePropertyChanges = new PropertyChanges( + lastExecution.getInputFileProperties().keySet(), + thisExecution.getInputFileProperties().keySet(), + "Input file", + executable); + InputFileChanges nonIncrementalInputFileChanges = incrementalInputProperties.nonIncrementalChanges( + lastExecution.getInputFileProperties(), + thisExecution.getInputFileProperties() + ); + + // Capture output files state + ChangeContainer outputFilePropertyChanges = new PropertyChanges( + lastExecution.getOutputFilesProducedByWork().keySet(), + thisExecution.getOutputFileLocationSnapshots().keySet(), + "Output", + executable); + ImmutableSortedMap remainingPreviouslyProducedOutputs = thisExecution.getDetectedOverlappingOutputs().isPresent() + ? findOutputsStillPresentSincePreviousExecution(lastExecution.getOutputFilesProducedByWork(), thisExecution.getOutputFileLocationSnapshots()) + : thisExecution.getOutputFileLocationSnapshots(); + OutputFileChanges outputFileChanges = new OutputFileChanges( + lastExecution.getOutputFilesProducedByWork(), + remainingPreviouslyProducedOutputs + ); + + // Collect changes that would trigger a rebuild + ChangeContainer rebuildTriggeringChanges = errorHandling(executable, new SummarizingChangeContainer( + previousSuccessState, + implementationChanges, + inputPropertyChanges, + inputPropertyValueChanges, + outputFilePropertyChanges, + outputFileChanges, + inputFilePropertyChanges, + nonIncrementalInputFileChanges + )); + ImmutableList rebuildReasons = collectChanges(rebuildTriggeringChanges); + + if (!rebuildReasons.isEmpty()) { + return new NonIncrementalDetectedExecutionStateChanges( + rebuildReasons, + thisExecution.getInputFileProperties(), + incrementalInputProperties + ); + } else { + // Collect incremental input changes + InputFileChanges directIncrementalInputFileChanges = incrementalInputProperties.incrementalChanges( + lastExecution.getInputFileProperties(), + thisExecution.getInputFileProperties() + ); + InputFileChanges incrementalInputFileChanges = errorHandling(executable, caching(directIncrementalInputFileChanges)); + ImmutableList incrementalInputFileChangeMessages = collectChanges(incrementalInputFileChanges); + return new IncrementalDetectedExecutionStateChanges( + incrementalInputFileChangeMessages, + thisExecution.getInputFileProperties(), + incrementalInputFileChanges, + incrementalInputProperties + ); + } + } + + private static ImmutableList collectChanges(ChangeContainer changes) { + ImmutableList.Builder builder = ImmutableList.builder(); + MessageCollectingChangeVisitor visitor = new MessageCollectingChangeVisitor(builder, ExecutionStateChangeDetector.MAX_OUT_OF_DATE_MESSAGES); + changes.accept(visitor); + return builder.build(); + } + + private static InputFileChanges caching(InputFileChanges wrapped) { + CachingChangeContainer cachingChangeContainer = new CachingChangeContainer(MAX_OUT_OF_DATE_MESSAGES, wrapped); + return new InputFileChangesWrapper(wrapped, cachingChangeContainer); + } + + private static ChangeContainer errorHandling(Describable executable, ChangeContainer wrapped) { + return new ErrorHandlingChangeContainer(executable, wrapped); + } + + private static InputFileChanges errorHandling(Describable executable, InputFileChanges wrapped) { + ErrorHandlingChangeContainer errorHandlingChangeContainer = new ErrorHandlingChangeContainer(executable, wrapped); + return new InputFileChangesWrapper(wrapped, errorHandlingChangeContainer); + } + + private static class InputFileChangesWrapper implements InputFileChanges { + private final InputFileChanges inputFileChangesDelegate; + private final ChangeContainer changeContainerDelegate; + + public InputFileChangesWrapper(InputFileChanges inputFileChangesDelegate, ChangeContainer changeContainerDelegate) { + this.inputFileChangesDelegate = inputFileChangesDelegate; + this.changeContainerDelegate = changeContainerDelegate; + } + + @Override + public boolean accept(String propertyName, ChangeVisitor visitor) { + return inputFileChangesDelegate.accept(propertyName, visitor); + } + + @Override + public boolean accept(ChangeVisitor visitor) { + return changeContainerDelegate.accept(visitor); + } + } + + private static class IncrementalDetectedExecutionStateChanges extends AbstractDetectedExecutionStateChanges { + private final InputFileChanges inputFileChanges; + + public IncrementalDetectedExecutionStateChanges( + ImmutableList allChangeMessages, + ImmutableSortedMap inputFileProperties, + InputFileChanges incrementalInputFileChanges, + IncrementalInputProperties incrementalInputProperties + ) { + super(allChangeMessages, inputFileProperties, incrementalInputProperties); + this.inputFileChanges = incrementalInputFileChanges; + } + + @Override + public InputChangesInternal createInputChanges() { + return new IncrementalInputChanges(inputFileChanges, incrementalInputProperties); + } + } + + private static class NonIncrementalDetectedExecutionStateChanges extends AbstractDetectedExecutionStateChanges { + + public NonIncrementalDetectedExecutionStateChanges( + ImmutableList allChangeMessages, + ImmutableSortedMap inputFileProperties, + IncrementalInputProperties incrementalInputProperties + ) { + super(allChangeMessages, inputFileProperties, incrementalInputProperties); + } + + @Override + public InputChangesInternal createInputChanges() { + return new NonIncrementalInputChanges(inputFileProperties, incrementalInputProperties); + } + } + + private static abstract class AbstractDetectedExecutionStateChanges implements ExecutionStateChanges { + private final ImmutableList allChangeMessages; + protected final ImmutableSortedMap inputFileProperties; + protected final IncrementalInputProperties incrementalInputProperties; + + public AbstractDetectedExecutionStateChanges( + ImmutableList allChangeMessages, + ImmutableSortedMap incrementalInputFileProperties, IncrementalInputProperties incrementalInputProperties) { + this.allChangeMessages = allChangeMessages; + this.inputFileProperties = incrementalInputFileProperties; + this.incrementalInputProperties = incrementalInputProperties; + } + + @Override + public ImmutableList getAllChangeMessages() { + return allChangeMessages; + } + + @Override + public ExecutionStateChanges withEnforcedRebuild(String rebuildReason) { + return new RebuildExecutionStateChanges(rebuildReason, inputFileProperties, incrementalInputProperties); + } + } + + private static class MessageCollectingChangeVisitor implements ChangeVisitor { + private final ImmutableCollection.Builder messages; + private final int max; + private int count; + + public MessageCollectingChangeVisitor(ImmutableCollection.Builder messages, int max) { + this.messages = messages; + this.max = max; + } + + @Override + public boolean visitChange(Change change) { + messages.add(change.getMessage()); + return ++count < max; + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/execution/org/gradle/internal/execution/history/changes/DefaultFileChange.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/execution/org/gradle/internal/execution/history/changes/DefaultFileChange.java new file mode 100644 index 0000000..bc50aab --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/execution/org/gradle/internal/execution/history/changes/DefaultFileChange.java @@ -0,0 +1,157 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.execution.history.changes; + +import com.google.common.base.Objects; +import org.gradle.api.tasks.incremental.InputFileDetails; +import org.gradle.internal.file.FileType; +import org.gradle.work.ChangeType; +import org.gradle.work.FileChange; + +import java.io.File; + +public class DefaultFileChange implements Change, FileChange, InputFileDetails { + private final String path; + private final ChangeTypeInternal change; + private final String title; + private final FileType previousFileType; + private final FileType currentFileType; + private final String normalizedPath; + + public static DefaultFileChange added(String path, String title, FileType currentFileType, String normalizedPath) { + return new DefaultFileChange(path, ChangeTypeInternal.ADDED, title, FileType.Missing, currentFileType, normalizedPath); + } + + public static DefaultFileChange removed(String path, String title, FileType previousFileType, String normalizedPath) { + return new DefaultFileChange(path, ChangeTypeInternal.REMOVED, title, previousFileType, FileType.Missing, normalizedPath); + } + + public static DefaultFileChange modified(String path, String title, FileType previousFileType, FileType currentFileType, String normalizedPath) { + return new DefaultFileChange(path, ChangeTypeInternal.MODIFIED, title, previousFileType, currentFileType, normalizedPath); + } + + private DefaultFileChange(String path, ChangeTypeInternal change, String title, FileType previousFileType, FileType currentFileType, String normalizedPath) { + this.path = path; + this.change = change; + this.title = title; + this.previousFileType = previousFileType; + this.currentFileType = currentFileType; + this.normalizedPath = normalizedPath; + } + + @Override + public String getMessage() { + return title + " file " + path + " " + getDisplayedChangeType().describe() + "."; + } + + private ChangeTypeInternal getDisplayedChangeType() { + if (change != ChangeTypeInternal.MODIFIED) { + return change; + } + if (previousFileType == FileType.Missing) { + return ChangeTypeInternal.ADDED; + } + if (currentFileType == FileType.Missing) { + return ChangeTypeInternal.REMOVED; + } + return ChangeTypeInternal.MODIFIED; + } + + @Override + public String toString() { + return getMessage(); + } + + public String getPath() { + return path; + } + + @Override + public File getFile() { + return new File(path); + } + + @Override + public ChangeType getChangeType() { + return change.getPublicType(); + } + + @Override + public org.gradle.api.file.FileType getFileType() { + FileType typeToConvert = change == ChangeTypeInternal.REMOVED ? previousFileType : currentFileType; + return toPublicFileType(typeToConvert); + } + + public static org.gradle.api.file.FileType toPublicFileType(FileType fileType) { + switch (fileType) { + case RegularFile: + return org.gradle.api.file.FileType.FILE; + case Directory: + return org.gradle.api.file.FileType.DIRECTORY; + case Missing: + return org.gradle.api.file.FileType.MISSING; + default: + throw new AssertionError(); + } + } + + @Override + public String getNormalizedPath() { + return normalizedPath; + } + + public ChangeTypeInternal getType() { + return change; + } + + @Override + public boolean isAdded() { + return change == ChangeTypeInternal.ADDED; + } + + @Override + public boolean isModified() { + return change == ChangeTypeInternal.MODIFIED; + } + + @Override + public boolean isRemoved() { + return change == ChangeTypeInternal.REMOVED; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + DefaultFileChange that = (DefaultFileChange) o; + return Objects.equal(path, that.path) + && change == that.change + && Objects.equal(title, that.title) + && Objects.equal(previousFileType, that.previousFileType) + && Objects.equal(currentFileType, that.currentFileType) + && Objects.equal(normalizedPath, that.normalizedPath); + } + + @Override + public int hashCode() { + return Objects.hashCode(path, change, title, previousFileType, currentFileType, normalizedPath); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/execution/org/gradle/internal/execution/history/changes/ExecutionStateChanges.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/execution/org/gradle/internal/execution/history/changes/ExecutionStateChanges.java new file mode 100644 index 0000000..3200a18 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/execution/org/gradle/internal/execution/history/changes/ExecutionStateChanges.java @@ -0,0 +1,37 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.execution.history.changes; + +import com.google.common.collect.ImmutableList; + +/** + * Represents the complete changes in execution state + */ +public interface ExecutionStateChanges { + + /** + * Returns all change messages for inputs and outputs. + */ + ImmutableList getAllChangeMessages(); + + InputChangesInternal createInputChanges(); + + /** + * Turn these changes into ones forcing a rebuild with the given reason. + */ + ExecutionStateChanges withEnforcedRebuild(String rebuildReason); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/execution/org/gradle/internal/execution/history/changes/PropertyChanges.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/execution/org/gradle/internal/execution/history/changes/PropertyChanges.java new file mode 100644 index 0000000..2386596 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/execution/org/gradle/internal/execution/history/changes/PropertyChanges.java @@ -0,0 +1,61 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.execution.history.changes; + +import com.google.common.collect.ImmutableSortedSet; +import com.google.common.collect.Sets; +import org.gradle.api.Describable; + +import java.util.stream.Stream; + +public class PropertyChanges implements ChangeContainer { + + private final ImmutableSortedSet previous; + private final ImmutableSortedSet current; + private final String title; + private final Describable executable; + + public PropertyChanges( + ImmutableSortedSet previous, + ImmutableSortedSet current, + String title, + Describable executable + ) { + this.previous = previous; + this.current = current; + this.title = title; + this.executable = executable; + } + + @Override + public boolean accept(ChangeVisitor visitor) { + if (previous.equals(current)) { + return true; + } + Stream removedProperties = Sets.difference(previous, current).stream() + .map(removedProperty -> new DescriptiveChange("%s property '%s' has been removed for %s", + title, removedProperty, executable.getDisplayName())); + Stream addedProperties = Sets.difference(current, previous).stream() + .map(addedProperty -> new DescriptiveChange("%s property '%s' has been added for %s", + title, addedProperty, executable.getDisplayName())); + return Stream.concat(removedProperties, addedProperties) + .map(visitor::visitChange) + .filter(shouldContinue -> !shouldContinue) + .findFirst() + .orElse(true); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/file-collections/org/gradle/api/internal/file/collections/DefaultConfigurableFileTree.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/file-collections/org/gradle/api/internal/file/collections/DefaultConfigurableFileTree.java new file mode 100644 index 0000000..e5a2d80 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/file-collections/org/gradle/api/internal/file/collections/DefaultConfigurableFileTree.java @@ -0,0 +1,177 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.file.collections; + +import groovy.lang.Closure; +import org.gradle.api.InvalidUserDataException; +import org.gradle.api.file.ConfigurableFileTree; +import org.gradle.api.file.FileTreeElement; +import org.gradle.api.internal.file.CompositeFileTree; +import org.gradle.api.internal.file.FileCollectionInternal; +import org.gradle.api.internal.tasks.DefaultTaskDependency; +import org.gradle.api.internal.tasks.TaskDependencyFactory; +import org.gradle.api.internal.tasks.TaskDependencyResolveContext; +import org.gradle.api.specs.Spec; +import org.gradle.api.tasks.util.PatternSet; +import org.gradle.internal.Factory; +import org.gradle.internal.file.PathToFileResolver; + +import java.io.File; +import java.util.Set; +import java.util.function.Consumer; + +public class DefaultConfigurableFileTree extends CompositeFileTree implements ConfigurableFileTree { + private Object dir; + private final PatternSet patternSet; + private final PathToFileResolver resolver; + private final DefaultTaskDependency buildDependency; + private final DirectoryFileTreeFactory directoryFileTreeFactory; + + public DefaultConfigurableFileTree(PathToFileResolver resolver, Factory patternSetFactory, TaskDependencyFactory taskDependencyFactory, DirectoryFileTreeFactory directoryFileTreeFactory) { + this.resolver = resolver; + this.directoryFileTreeFactory = directoryFileTreeFactory; + patternSet = patternSetFactory.create(); + buildDependency = taskDependencyFactory.configurableDependency(); + } + + @Override + public PatternSet getPatterns() { + return patternSet; + } + + @Override + public DefaultConfigurableFileTree setDir(Object dir) { + from(dir); + return this; + } + + @Override + public File getDir() { + if (dir == null) { + throw new InvalidUserDataException("A base directory must be specified in the task or via a method argument!"); + } + return resolver.resolve(dir); + } + + @Override + public DefaultConfigurableFileTree from(Object dir) { + this.dir = dir; + return this; + } + + @Override + public String getDisplayName() { + return "directory '" + dir + "'"; + } + + @Override + public Set getIncludes() { + return patternSet.getIncludes(); + } + + @Override + public DefaultConfigurableFileTree setIncludes(Iterable includes) { + patternSet.setIncludes(includes); + return this; + } + + @Override + public Set getExcludes() { + return patternSet.getExcludes(); + } + + @Override + public DefaultConfigurableFileTree setExcludes(Iterable excludes) { + patternSet.setExcludes(excludes); + return this; + } + + @Override + public DefaultConfigurableFileTree include(String... includes) { + patternSet.include(includes); + return this; + } + + @Override + public DefaultConfigurableFileTree include(Iterable includes) { + patternSet.include(includes); + return this; + } + + @Override + public DefaultConfigurableFileTree include(Closure includeSpec) { + patternSet.include(includeSpec); + return this; + } + + @Override + public DefaultConfigurableFileTree include(Spec includeSpec) { + patternSet.include(includeSpec); + return this; + } + + @Override + public DefaultConfigurableFileTree exclude(String... excludes) { + patternSet.exclude(excludes); + return this; + } + + @Override + public DefaultConfigurableFileTree exclude(Iterable excludes) { + patternSet.exclude(excludes); + return this; + } + + @Override + public DefaultConfigurableFileTree exclude(Spec excludeSpec) { + patternSet.exclude(excludeSpec); + return this; + } + + @Override + public DefaultConfigurableFileTree exclude(Closure excludeSpec) { + patternSet.exclude(excludeSpec); + return this; + } + + @Override + protected void visitChildren(Consumer visitor) { + File dir = getDir(); + visitor.accept(new FileTreeAdapter(directoryFileTreeFactory.create(dir, patternSet), patternSetFactory)); + } + + @Override + public void visitDependencies(TaskDependencyResolveContext context) { + context.add(buildDependency); + } + + @Override + public ConfigurableFileTree builtBy(Object... tasks) { + buildDependency.add(tasks); + return this; + } + + @Override + public Set getBuiltBy() { + return buildDependency.getMutableValues(); + } + + @Override + public ConfigurableFileTree setBuiltBy(Iterable tasks) { + buildDependency.setValues(tasks); + return this; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/files/org/gradle/api/internal/file/pattern/PatternMatcher.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/files/org/gradle/api/internal/file/pattern/PatternMatcher.java new file mode 100644 index 0000000..355d5ae --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/files/org/gradle/api/internal/file/pattern/PatternMatcher.java @@ -0,0 +1,109 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.file.pattern; + +import com.google.common.collect.Lists; + +import java.util.List; + +public abstract class PatternMatcher { + public static final PatternMatcher MATCH_ALL = new PatternMatcher() { + @Override + public boolean test(String[] segments, boolean isFile) { + return true; + } + + @Override + public PatternMatcher and(PatternMatcher other) { + return other; + } + + @Override + public PatternMatcher or(PatternMatcher other) { + return this; + } + }; + + public abstract boolean test(String[] segments, boolean isFile); + + public PatternMatcher and(final PatternMatcher other) { + return new And(PatternMatcher.this, other); + } + + public PatternMatcher or(final PatternMatcher other) { + return new Or(PatternMatcher.this, other); + } + + public PatternMatcher negate() { + return new PatternMatcher() { + @Override + public boolean test(String[] segments, boolean isFile) { + return !PatternMatcher.this.test(segments, isFile); + } + }; + } + + private static final class Or extends PatternMatcher { + private final List parts = Lists.newLinkedList(); + + public Or(PatternMatcher patternMatcher, PatternMatcher other) { + parts.add(patternMatcher); + parts.add(other); + } + + @Override + public PatternMatcher or(PatternMatcher other) { + parts.add(other); + return this; + } + + @Override + public boolean test(String[] segments, boolean isFile) { + for (PatternMatcher part : parts) { + if (part.test(segments, isFile)) { + return true; + } + } + return false; + } + } + + private static final class And extends PatternMatcher { + private final List parts = Lists.newLinkedList(); + + public And(PatternMatcher patternMatcher, PatternMatcher other) { + parts.add(patternMatcher); + parts.add(other); + } + + @Override + public PatternMatcher and(PatternMatcher other) { + parts.add(other); + return this; + } + + @Override + public boolean test(String[] segments, boolean isFile) { + for (PatternMatcher part : parts) { + if (!part.test(segments, isFile)) { + return false; + } + } + return true; + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ide-native/org/gradle/ide/xcode/internal/xcodeproj/PBXReference.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ide-native/org/gradle/ide/xcode/internal/xcodeproj/PBXReference.java new file mode 100644 index 0000000..e641316 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ide-native/org/gradle/ide/xcode/internal/xcodeproj/PBXReference.java @@ -0,0 +1,162 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.ide.xcode.internal.xcodeproj; + +import com.google.common.base.CharMatcher; +import com.google.common.base.Optional; +import com.google.common.base.Preconditions; +import org.gradle.api.Named; + +import javax.annotation.Nullable; + +/** + * Superclass for file, directories, and groups. Xcode's virtual file hierarchy are made of these + * objects. + */ +public class PBXReference extends PBXContainerItem implements Named { + private final String name; + @Nullable + private String path; + /** + * The "base" path of the reference. The absolute path is resolved by prepending the resolved + * base path. + */ + private SourceTree sourceTree; + + public PBXReference(String name, @Nullable String path, SourceTree sourceTree) { + this.name = Preconditions.checkNotNull(name); + this.path = path; + this.sourceTree = Preconditions.checkNotNull(sourceTree); + } + + @Override + public String getName() { + return name; + } + + @Nullable + public String getPath() { + return path; + } + + public void setPath(String v) { + path = v; + } + + public SourceTree getSourceTree() { + return sourceTree; + } + + public void setSourceTree(SourceTree v) { + sourceTree = v; + } + + @Override + public String isa() { + return "PBXReference"; + } + + @Override + public int stableHash() { + return name.hashCode(); + } + + @Override + public void serializeInto(XcodeprojSerializer s) { + super.serializeInto(s); + + s.addField("name", name); + if (path != null) { + s.addField("path", path); + } + s.addField("sourceTree", sourceTree.toString()); + } + + @Override + public String toString() { + return String.format( + "%s name=%s path=%s sourceTree=%s", + super.toString(), + getName(), + getPath(), + getSourceTree()); + } + + public enum SourceTree { + /** + * Relative to the path of the group containing this. + */ + GROUP(""), + + /** + * Absolute system path. + */ + ABSOLUTE(""), + /** + * Relative to the build setting {@code BUILT_PRODUCTS_DIR}. + */ + BUILT_PRODUCTS_DIR("BUILT_PRODUCTS_DIR"), + + /** + * Relative to the build setting {@code SDKROOT}. + */ + SDKROOT("SDKROOT"), + + /** + * Relative to the directory containing the project file {@code SOURCE_ROOT}. + */ + SOURCE_ROOT("SOURCE_ROOT"), + + /** + * Relative to the Developer content directory inside the Xcode application + * (e.g. {@code /Applications/Xcode.app/Contents/Developer}). + */ + DEVELOPER_DIR("DEVELOPER_DIR"),; + + private final String rep; + + SourceTree(String str) { + rep = str; + } + + /** + * Return a sourceTree given a build setting that is typically used as a source tree prefix. + * + * The build setting may be optionally prefixed by '$' which will be stripped. + */ + public static Optional fromBuildSetting(String buildSetting) { + String data = CharMatcher.is('$').trimLeadingFrom(buildSetting); + switch (data) { + case "BUILT_PRODUCTS_DIR": + return Optional.of(BUILT_PRODUCTS_DIR); + case "SDKROOT": + return Optional.of(SDKROOT); + case "SOURCE_ROOT": + return Optional.of(SOURCE_ROOT); + case "DEVELOPER_DIR": + return Optional.of(DEVELOPER_DIR); + default: + return Optional.absent(); + } + } + + @Override + public String toString() { + return rep; + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ide/org/gradle/plugins/ide/eclipse/model/internal/DefaultResourceFilter.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ide/org/gradle/plugins/ide/eclipse/model/internal/DefaultResourceFilter.java new file mode 100644 index 0000000..f8cfcb1 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ide/org/gradle/plugins/ide/eclipse/model/internal/DefaultResourceFilter.java @@ -0,0 +1,141 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.plugins.ide.eclipse.model.internal; + +import com.google.common.base.Objects; +import groovy.lang.Closure; +import groovy.lang.DelegatesTo; +import org.gradle.api.Action; +import org.gradle.api.InvalidUserDataException; +import org.gradle.plugins.ide.eclipse.model.ResourceFilter; +import org.gradle.plugins.ide.eclipse.model.ResourceFilterAppliesTo; +import org.gradle.plugins.ide.eclipse.model.ResourceFilterMatcher; +import org.gradle.plugins.ide.eclipse.model.ResourceFilterType; +import org.gradle.util.internal.ClosureBackedAction; + +public final class DefaultResourceFilter implements ResourceFilter { + private ResourceFilterAppliesTo appliesTo = ResourceFilterAppliesTo.FILES_AND_FOLDERS; + private ResourceFilterType type = ResourceFilterType.EXCLUDE_ALL; + private boolean recursive = true; + private ResourceFilterMatcher matcher; + + public DefaultResourceFilter() { + } + + public DefaultResourceFilter(ResourceFilterAppliesTo appliesTo, ResourceFilterType type, boolean recursive, ResourceFilterMatcher matcher) { + this(); + setAppliesTo(appliesTo); + setType(type); + setRecursive(recursive); + setMatcher(matcher); + } + + @Override + public ResourceFilterAppliesTo getAppliesTo() { + return appliesTo; + } + + @Override + public void setAppliesTo(ResourceFilterAppliesTo appliesTo) { + if (appliesTo == null) { + throw new InvalidUserDataException("appliesTo must not be null"); + } + this.appliesTo = appliesTo; + } + + @Override + public ResourceFilterType getType() { + return type; + } + + @Override + public void setType(ResourceFilterType type) { + if (type == null) { + throw new InvalidUserDataException("type must not be null"); + } + this.type = type; + } + + @Override + public boolean isRecursive() { + return recursive; + } + + @Override + public void setRecursive(boolean recursive) { + this.recursive = recursive; + } + + @Override + public ResourceFilterMatcher getMatcher() { + return matcher; + } + + public void setMatcher(ResourceFilterMatcher matcher) { + this.matcher = matcher; + } + + public ResourceFilterMatcher matcher(@DelegatesTo(value = ResourceFilterMatcher.class, strategy = Closure.DELEGATE_FIRST) Closure configureClosure) { + return matcher(new ClosureBackedAction(configureClosure)); + } + + @Override + public ResourceFilterMatcher matcher(Action configureAction) { + if (this.matcher == null) { + this.matcher = new DefaultResourceFilterMatcher(); + } + configureAction.execute(this.matcher); + return this.matcher; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null) { + return false; + } + if (!getClass().equals(o.getClass())) { + return false; + } + DefaultResourceFilter resourceFilter = (DefaultResourceFilter) o; + return Objects.equal(appliesTo, resourceFilter.appliesTo) + && Objects.equal(type, resourceFilter.type) + && Objects.equal(recursive, resourceFilter.recursive) + && Objects.equal(matcher, resourceFilter.matcher); + } + + @Override + public int hashCode() { + int result; + result = appliesTo != null ? appliesTo.hashCode() : 0; + result = 31 * result + (type != null ? type.hashCode() : 0); + result = 31 * result + Boolean.valueOf(recursive).hashCode(); + result = 31 * result + (matcher != null ? matcher.hashCode() : 0); + return result; + } + + @Override + public String toString() { + return "ResourceFilter{" + + "appliesTo='" + appliesTo + '\'' + + ", type='" + type + '\'' + + ", recursive='" + recursive + '\'' + + ", matcher='" + matcher + '\'' + + '}'; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ide/org/gradle/plugins/ide/eclipse/model/internal/EclipseJavaVersionMapper.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ide/org/gradle/plugins/ide/eclipse/model/internal/EclipseJavaVersionMapper.java new file mode 100644 index 0000000..25ca706 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ide/org/gradle/plugins/ide/eclipse/model/internal/EclipseJavaVersionMapper.java @@ -0,0 +1,52 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.plugins.ide.eclipse.model.internal; + +import org.gradle.api.JavaVersion; + +/** + * Utility class for saving Java versions in Eclipse descriptors. + */ +public class EclipseJavaVersionMapper { + + private EclipseJavaVersionMapper() { + } + + /** + * Converts the target Java version to to its Eclipse-specific representation. + * + * @param version the target Java version + * @return the Eclipse-specific representation of the version + */ + public static String toEclipseJavaVersion(JavaVersion version) { + switch (version) { + case VERSION_1_1: + case VERSION_1_2: + case VERSION_1_3: + case VERSION_1_4: + case VERSION_1_5: + case VERSION_1_6: + case VERSION_1_7: + case VERSION_1_8: + return version.toString(); + case VERSION_1_9: + case VERSION_1_10: + default: + return version.getMajorVersion(); + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ide/org/gradle/plugins/ide/idea/model/internal/IdeaDependenciesProvider.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ide/org/gradle/plugins/ide/idea/model/internal/IdeaDependenciesProvider.java new file mode 100644 index 0000000..49c40c7 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ide/org/gradle/plugins/ide/idea/model/internal/IdeaDependenciesProvider.java @@ -0,0 +1,242 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.plugins.ide.idea.model.internal; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import org.gradle.api.Project; +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.artifacts.component.ComponentSelector; +import org.gradle.api.artifacts.component.ModuleComponentIdentifier; +import org.gradle.api.artifacts.component.ProjectComponentIdentifier; +import org.gradle.api.artifacts.dsl.DependencyHandler; +import org.gradle.api.artifacts.result.ResolvedArtifactResult; +import org.gradle.api.artifacts.result.UnresolvedDependencyResult; +import org.gradle.api.internal.artifacts.DefaultModuleVersionIdentifier; +import org.gradle.api.internal.project.ProjectInternal; +import org.gradle.api.internal.project.ProjectStateRegistry; +import org.gradle.internal.jvm.JavaModuleDetector; +import org.gradle.plugins.ide.idea.model.Dependency; +import org.gradle.plugins.ide.idea.model.FilePath; +import org.gradle.plugins.ide.idea.model.IdeaModule; +import org.gradle.plugins.ide.idea.model.Path; +import org.gradle.plugins.ide.idea.model.SingleEntryModuleLibrary; +import org.gradle.plugins.ide.internal.IdeArtifactRegistry; +import org.gradle.plugins.ide.internal.resolver.GradleApiSourcesResolver; +import org.gradle.plugins.ide.internal.resolver.IdeDependencySet; +import org.gradle.plugins.ide.internal.resolver.IdeDependencyVisitor; +import org.gradle.plugins.ide.internal.resolver.UnresolvedIdeDependencyHandler; + +import java.io.File; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Set; + +public class IdeaDependenciesProvider { + + public static final String SCOPE_PLUS = "plus"; + public static final String SCOPE_MINUS = "minus"; + private final ModuleDependencyBuilder moduleDependencyBuilder; + private final IdeaDependenciesOptimizer optimizer; + private final ProjectComponentIdentifier currentProjectId; + private final GradleApiSourcesResolver gradleApiSourcesResolver; + + public IdeaDependenciesProvider(Project project, IdeArtifactRegistry artifactRegistry, ProjectStateRegistry projectRegistry, GradleApiSourcesResolver gradleApiSourcesResolver) { + moduleDependencyBuilder = new ModuleDependencyBuilder(artifactRegistry); + currentProjectId = projectRegistry.stateFor(project).getComponentIdentifier(); + optimizer = new IdeaDependenciesOptimizer(); + this.gradleApiSourcesResolver = gradleApiSourcesResolver; + } + + public Set provide(final IdeaModule ideaModule) { + Set result = Sets.newLinkedHashSet(); + result.addAll(getOutputLocations(ideaModule)); + result.addAll(getDependencies(ideaModule)); + return result; + } + + private Set getOutputLocations(IdeaModule ideaModule) { + if (ideaModule.getSingleEntryLibraries() == null) { + return Collections.emptySet(); + } + Set outputLocations = Sets.newLinkedHashSet(); + for (Map.Entry> outputLocation : ideaModule.getSingleEntryLibraries().entrySet()) { + String scope = outputLocation.getKey(); + for (File file : outputLocation.getValue()) { + if (file != null && file.isDirectory()) { + outputLocations.add(new SingleEntryModuleLibrary(toPath(ideaModule, file), scope)); + } + } + } + return outputLocations; + } + + private Set getDependencies(IdeaModule ideaModule) { + Set dependencies = Sets.newLinkedHashSet(); + Map unresolvedDependencies = Maps.newLinkedHashMap(); + for (GeneratedIdeaScope scope : GeneratedIdeaScope.values()) { + IdeaDependenciesVisitor visitor = visitDependencies(ideaModule, scope); + dependencies.addAll(visitor.getDependencies()); + unresolvedDependencies.putAll(visitor.getUnresolvedDependencies()); + } + optimizer.optimizeDeps(dependencies); + new UnresolvedIdeDependencyHandler().log(unresolvedDependencies.values()); + return dependencies; + } + + private IdeaDependenciesVisitor visitDependencies(IdeaModule ideaModule, GeneratedIdeaScope scope) { + ProjectInternal projectInternal = (ProjectInternal) ideaModule.getProject(); + final DependencyHandler handler = projectInternal.getDependencies(); + final Collection plusConfigurations = getPlusConfigurations(ideaModule, scope); + final Collection minusConfigurations = getMinusConfigurations(ideaModule, scope); + final JavaModuleDetector javaModuleDetector = projectInternal.getServices().get(JavaModuleDetector.class); + + final IdeaDependenciesVisitor visitor = new IdeaDependenciesVisitor(ideaModule, scope.name()); + return projectInternal.getOwner().fromMutableState(p -> { + new IdeDependencySet(handler, javaModuleDetector, plusConfigurations, minusConfigurations, false, gradleApiSourcesResolver).visit(visitor); + return visitor; + }); + } + + private Collection getPlusConfigurations(IdeaModule ideaModule, GeneratedIdeaScope scope) { + return getConfigurations(ideaModule, scope, SCOPE_PLUS); + } + + private Collection getMinusConfigurations(IdeaModule ideaModule, GeneratedIdeaScope scope) { + return getConfigurations(ideaModule, scope, SCOPE_MINUS); + } + + private Collection getConfigurations(IdeaModule ideaModule, GeneratedIdeaScope scope, String plusMinus) { + Map> plusMinusConfigurations = getPlusMinusConfigurations(ideaModule, scope); + return plusMinusConfigurations.containsKey(plusMinus) ? plusMinusConfigurations.get(plusMinus) : Collections.emptyList(); + } + + private Map> getPlusMinusConfigurations(IdeaModule ideaModule, GeneratedIdeaScope scope) { + Map> plusMinusConfigurations = ideaModule.getScopes().get(scope.name()); + return plusMinusConfigurations != null ? plusMinusConfigurations : Collections.>emptyMap(); + } + + private FilePath toPath(IdeaModule ideaModule, File file) { + return file != null ? ideaModule.getPathFactory().path(file) : null; + } + + private class IdeaDependenciesVisitor implements IdeDependencyVisitor { + private final IdeaModule ideaModule; + private final UnresolvedIdeDependencyHandler unresolvedIdeDependencyHandler = new UnresolvedIdeDependencyHandler(); + private final String scope; + + private final List projectDependencies = Lists.newLinkedList(); + private final List moduleDependencies = Lists.newLinkedList(); + private final List fileDependencies = Lists.newLinkedList(); + private final Map unresolvedDependencies = Maps.newLinkedHashMap(); + + private IdeaDependenciesVisitor(IdeaModule ideaModule, String scope) { + this.ideaModule = ideaModule; + this.scope = scope; + } + + @Override + public boolean isOffline() { + return ideaModule.isOffline(); + } + + @Override + public boolean downloadSources() { + return ideaModule.isDownloadSources(); + } + + @Override + public boolean downloadJavaDoc() { + return ideaModule.isDownloadJavadoc(); + } + + @Override + public void visitProjectDependency(ResolvedArtifactResult artifact, boolean asJavaModule) { + ProjectComponentIdentifier projectId = (ProjectComponentIdentifier) artifact.getId().getComponentIdentifier(); + if (!projectId.equals(currentProjectId)) { + projectDependencies.add(moduleDependencyBuilder.create(projectId, scope)); + } + } + + @Override + public void visitModuleDependency(ResolvedArtifactResult artifact, Set sources, Set javaDoc, boolean testDependency, boolean asJavaModule) { + ModuleComponentIdentifier moduleId = (ModuleComponentIdentifier) artifact.getId().getComponentIdentifier(); + SingleEntryModuleLibrary library = new SingleEntryModuleLibrary(toPath(ideaModule, artifact.getFile()), scope); + library.setModuleVersion(DefaultModuleVersionIdentifier.newId(moduleId.getModuleIdentifier(), moduleId.getVersion())); + Set sourcePaths = Sets.newLinkedHashSet(); + for (ResolvedArtifactResult sourceArtifact : sources) { + sourcePaths.add(toPath(ideaModule, sourceArtifact.getFile())); + } + library.setSources(sourcePaths); + Set javaDocPaths = Sets.newLinkedHashSet(); + for (ResolvedArtifactResult javaDocArtifact : javaDoc) { + javaDocPaths.add(toPath(ideaModule, javaDocArtifact.getFile())); + } + library.setJavadoc(javaDocPaths); + moduleDependencies.add(library); + } + + @Override + public void visitFileDependency(ResolvedArtifactResult artifact, boolean testDependency) { + fileDependencies.add(new SingleEntryModuleLibrary(toPath(ideaModule, artifact.getFile()), scope)); + } + + @Override + public void visitGradleApiDependency(ResolvedArtifactResult artifact, File sources, boolean testDependency) { + fileDependencies.add(new SingleEntryModuleLibrary(toPath(ideaModule, artifact.getFile()), null, toPath(ideaModule, sources), scope)); + } + + /* + * Remembers the unresolved dependency for later logging and also adds a fake + * file dependency, with the file path pointing to the attempted component selector. + * This shows up in the IDE as a red flag in the dependencies view. That's not the best + * usability and it also muddies the API contract, because we disguise an unresolved + * dependency as a file dependency, even though that file really doesn't exist. + * + * Instead, when generating files on the command line, the logged warning is enough. + * When using the Tooling API, a dedicated "unresolved dependency" object would be better + * and could be shown in a notification. The command line warning should probably be omitted in that case. + */ + @Override + public void visitUnresolvedDependency(UnresolvedDependencyResult unresolvedDependency) { + File unresolvedFile = unresolvedIdeDependencyHandler.asFile(unresolvedDependency, ideaModule.getContentRoot()); + fileDependencies.add(new SingleEntryModuleLibrary(toPath(ideaModule, unresolvedFile), scope)); + unresolvedDependencies.put(unresolvedDependency.getAttempted(), unresolvedDependency); + } + + /* + * This method returns the dependencies in buckets (projects first, then modules, then files), + * because that's what we used to do since 1.0. It would be better to return the dependencies + * in the same order as they come from the resolver, but we'll need to change all the tests for + * that, so defer that until later. + */ + public Collection getDependencies() { + Collection dependencies = Sets.newLinkedHashSet(); + dependencies.addAll(projectDependencies); + dependencies.addAll(moduleDependencies); + dependencies.addAll(fileDependencies); + return dependencies; + } + + public Map getUnresolvedDependencies() { + return unresolvedDependencies; + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ide/org/gradle/plugins/ide/internal/IdeProjectMetadata.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ide/org/gradle/plugins/ide/internal/IdeProjectMetadata.java new file mode 100644 index 0000000..3acbfd4 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ide/org/gradle/plugins/ide/internal/IdeProjectMetadata.java @@ -0,0 +1,32 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.plugins.ide.internal; + +import org.gradle.api.Task; +import org.gradle.api.internal.artifacts.ivyservice.projectmodule.ProjectPublication; + +import java.io.File; +import java.util.Set; + +/** + * Details of an IDE project shared across Gradle project boundaries. + */ +public interface IdeProjectMetadata extends ProjectPublication { + File getFile(); + + Set getGeneratorTasks(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ide/org/gradle/plugins/ide/internal/configurer/EclipseModelAwareUniqueProjectNameProvider.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ide/org/gradle/plugins/ide/internal/configurer/EclipseModelAwareUniqueProjectNameProvider.java new file mode 100644 index 0000000..7b9665b --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ide/org/gradle/plugins/ide/internal/configurer/EclipseModelAwareUniqueProjectNameProvider.java @@ -0,0 +1,131 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.plugins.ide.internal.configurer; + +import org.gradle.api.Project; +import org.gradle.api.internal.project.ProjectInternal; +import org.gradle.api.internal.project.ProjectState; +import org.gradle.api.internal.project.ProjectStateRegistry; +import org.gradle.plugins.ide.eclipse.model.EclipseModel; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; + +public class EclipseModelAwareUniqueProjectNameProvider implements UniqueProjectNameProvider { + private final ProjectStateRegistry projectRegistry; + private Map deduplicated; + private List reservedNames = Collections.emptyList(); + private Map projectToInformationMap = Collections.emptyMap(); + + public EclipseModelAwareUniqueProjectNameProvider(ProjectStateRegistry projectRegistry) { + this.projectRegistry = projectRegistry; + } + + public synchronized void setReservedProjectNames(List reservedNames) { + this.reservedNames = reservedNames.stream().map(ProjectStateWrapper::new).collect(Collectors.toList()); + deduplicated = null; + } + + @Override + public String getUniqueName(Project project) { + ProjectState state = projectRegistry.stateFor(project); + String uniqueName = getDeduplicatedNames().get(state); + if (uniqueName != null) { + return uniqueName; + } + + // ProjectStateWrapper might contain the configured eclipse project name + ProjectStateWrapper information = projectToInformationMap.get(state); + if (information != null) { + return information.name; + } + return state.getName(); + } + + private synchronized Map getDeduplicatedNames() { + if (deduplicated == null) { + + projectToInformationMap = new HashMap<>(); + for (ProjectState state : projectRegistry.getAllProjects()) { + // try to get the name from EclipseProject.name + ProjectInternal project = state.getOwner().getLoadedSettings().getGradle().getRootProject().findProject( + state.getComponentIdentifier().getProjectPath()); + if (project != null) { + EclipseModel model = project.getExtensions().findByType(EclipseModel.class); + if (model != null && model.getProject().getName() != null) { + projectToInformationMap.put(state, new ProjectStateWrapper(model.getProject().getName(), state, state.getParent())); + continue; + } + } + // fallback: take the name from the ProjectState + projectToInformationMap.put(state, new ProjectStateWrapper(state.getName(), state, state.getParent())); + } + + HierarchicalElementDeduplicator deduplicator = new HierarchicalElementDeduplicator<>(new ProjectPathDeduplicationAdapter(projectToInformationMap)); + List allElements = new ArrayList<>(); + allElements.addAll(reservedNames); + allElements.addAll(projectToInformationMap.values()); + + this.deduplicated = deduplicator.deduplicate(allElements).entrySet().stream() + .collect(Collectors.toMap(e -> e.getKey().project, Map.Entry::getValue)); + } + return deduplicated; + } + + private static class ProjectStateWrapper { + private final String name; + private final ProjectState project; + private final ProjectState parent; + + public ProjectStateWrapper(String name, ProjectState project, ProjectState parent) { + this.name = name; + this.project = project; + this.parent = parent; + } + + public ProjectStateWrapper(String name) { + this(name, null, null); + } + } + + private static class ProjectPathDeduplicationAdapter implements HierarchicalElementAdapter { + private final Map projectToInformationMap; + + public ProjectPathDeduplicationAdapter(Map projectToInformationMap) { + this.projectToInformationMap = projectToInformationMap; + } + + @Override + public String getName(ProjectStateWrapper element) { + return element.name; + } + + @Override + public String getIdentityName(ProjectStateWrapper element) { + return element.name; + } + + @Override + public ProjectStateWrapper getParent(ProjectStateWrapper element) { + return projectToInformationMap.get(element.parent); + } + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ide/org/gradle/plugins/ide/internal/resolver/IdeDependencyVisitor.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ide/org/gradle/plugins/ide/internal/resolver/IdeDependencyVisitor.java new file mode 100644 index 0000000..d9bb588 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ide/org/gradle/plugins/ide/internal/resolver/IdeDependencyVisitor.java @@ -0,0 +1,72 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.plugins.ide.internal.resolver; + +import org.gradle.api.artifacts.result.ResolvedArtifactResult; +import org.gradle.api.artifacts.result.UnresolvedDependencyResult; + +import java.io.File; +import java.util.Set; + +/** + * Used in conjunction with {@link IdeDependencySet} to adapt Gradle's dependency resolution API to the + * specific needs of the IDE plugins. + */ +public interface IdeDependencyVisitor { + /** + * If true, external dependencies will be skipped. + */ + boolean isOffline(); + + /** + * Should sources for external dependencies be downloaded? + */ + boolean downloadSources(); + + /** + * Should javadoc for external dependencies be downloaded? + */ + boolean downloadJavaDoc(); + + /** + * The dependency points to an artifact built by another project. + * The component identifier is guaranteed to be a {@link org.gradle.api.artifacts.component.ProjectComponentIdentifier}. + */ + void visitProjectDependency(ResolvedArtifactResult artifact, boolean asJavaModule); + + /** + * The dependency points to an external module. + * The component identifier is guaranteed to be a {@link org.gradle.api.artifacts.component.ModuleComponentIdentifier}. + * The source and javadoc locations maybe be empty, but never null. + */ + void visitModuleDependency(ResolvedArtifactResult artifact, Set sources, Set javaDoc, boolean testDependency, boolean asJavaModule); + + /** + * The dependency points neither to a project, nor an external module, so this method should treat it as an opaque file. + */ + void visitFileDependency(ResolvedArtifactResult artifact, boolean testDependency); + + /** + * A generated file dependency to which we might be able to attach sources + */ + void visitGradleApiDependency(ResolvedArtifactResult artifact, File sources, boolean testDependency); + + /** + * There was an unresolved dependency in the result. + */ + void visitUnresolvedDependency(UnresolvedDependencyResult unresolvedDependency); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ivy/org/gradle/api/publish/ivy/IvyModuleDescriptorDescription.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ivy/org/gradle/api/publish/ivy/IvyModuleDescriptorDescription.java new file mode 100644 index 0000000..8746b0a --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ivy/org/gradle/api/publish/ivy/IvyModuleDescriptorDescription.java @@ -0,0 +1,39 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.publish.ivy; + +import org.gradle.api.provider.Property; + +/** + * The description of an Ivy publication. + * + * @since 4.8 + * @see IvyModuleDescriptorSpec + */ +public interface IvyModuleDescriptorDescription { + + /** + * The text of this description. + */ + Property getText(); + + /** + * The homepage of the publication of this description. + */ + Property getHomepage(); + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ivy/org/gradle/api/publish/ivy/internal/dependency/DefaultIvyDependency.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ivy/org/gradle/api/publish/ivy/internal/dependency/DefaultIvyDependency.java new file mode 100644 index 0000000..e9c27ff --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/ivy/org/gradle/api/publish/ivy/internal/dependency/DefaultIvyDependency.java @@ -0,0 +1,113 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.publish.ivy.internal.dependency; + +import com.google.common.base.Strings; +import org.gradle.api.artifacts.DependencyArtifact; +import org.gradle.api.artifacts.ExcludeRule; +import org.gradle.api.artifacts.ExternalDependency; +import org.gradle.api.internal.attributes.ImmutableAttributes; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +public class DefaultIvyDependency implements IvyDependencyInternal { + private final String organisation; + private final String module; + private final String revision; + private final String confMapping; + private final boolean transitive; + private final List artifacts = new ArrayList(); + private final List excludeRules = new ArrayList(); + private final ImmutableAttributes attributes; + + public DefaultIvyDependency(String organisation, String module, String revision, String confMapping, boolean transitive) { + this.organisation = organisation; + this.module = module; + this.revision = Strings.nullToEmpty(revision); + this.confMapping = confMapping; + this.transitive = transitive; + this.attributes = ImmutableAttributes.EMPTY; + } + + public DefaultIvyDependency(String organisation, String module, String revision, String confMapping, boolean transitive, Collection artifacts) { + this(organisation, module, revision, confMapping, transitive); + this.artifacts.addAll(artifacts); + } + + public DefaultIvyDependency(String organisation, String module, String revision, String confMapping, boolean transitive, Collection artifacts, Collection excludeRules) { + this(organisation, module, revision, confMapping, transitive, artifacts); + this.excludeRules.addAll(excludeRules); + } + + public DefaultIvyDependency(ExternalDependency dependency, String confMapping, ImmutableAttributes attributes) { + this.organisation = dependency.getGroup(); + this.module = dependency.getName(); + this.revision = Strings.nullToEmpty(dependency.getVersion()); + this.confMapping = confMapping; + this.transitive = dependency.isTransitive(); + this.artifacts.addAll(dependency.getArtifacts()); + this.excludeRules.addAll(dependency.getExcludeRules()); + this.attributes = attributes; + } + + @Override + public String getOrganisation() { + return organisation; + } + + @Override + public String getModule() { + return module; + } + + @Override + public String getRevision() { + return revision; + } + + @Override + public String getConfMapping() { + return confMapping; + } + + @Override + public boolean isTransitive() { + return transitive; + } + + @Override + public Iterable getArtifacts() { + return artifacts; + } + + @Override + public Iterable getExcludeRules() { + return excludeRules; + } + + @Override + public ImmutableAttributes getAttributes() { + return attributes; + } + + @Override + public String getProjectPath() { + return null; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/jacoco/org/gradle/testing/jacoco/plugins/JacocoTaskExtension.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/jacoco/org/gradle/testing/jacoco/plugins/JacocoTaskExtension.java new file mode 100644 index 0000000..0a18822 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/jacoco/org/gradle/testing/jacoco/plugins/JacocoTaskExtension.java @@ -0,0 +1,361 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.testing.jacoco.plugins; + +import com.google.common.base.Joiner; +import org.apache.commons.lang.StringUtils; +import org.gradle.api.file.FileCollection; +import org.gradle.api.model.ObjectFactory; +import org.gradle.api.provider.Property; +import org.gradle.api.provider.Provider; +import org.gradle.api.tasks.Classpath; +import org.gradle.api.tasks.Input; +import org.gradle.api.tasks.Internal; +import org.gradle.api.tasks.LocalState; +import org.gradle.api.tasks.Optional; +import org.gradle.api.tasks.OutputFile; +import org.gradle.internal.jacoco.JacocoAgentJar; +import org.gradle.process.JavaForkOptions; +import org.gradle.util.internal.RelativePathUtil; + +import javax.annotation.Nullable; +import java.io.File; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +/** + * Extension for tasks that should run with a Jacoco agent to generate coverage execution data. + */ +public class JacocoTaskExtension { + + /** + * The types of output that the agent can use for execution data. + */ + public enum Output { + FILE, + TCP_SERVER, + TCP_CLIENT, + NONE; + + /** + * Gets type in format of agent argument. + */ + public String getAsArg() { + return toString().toLowerCase().replaceAll("_", ""); + } + } + + private final JacocoAgentJar agent; + private final JavaForkOptions task; + + private boolean enabled = true; + private final Property destinationFile; + private List includes = new ArrayList<>(); + private List excludes = new ArrayList<>(); + private List excludeClassLoaders = new ArrayList<>(); + private boolean includeNoLocationClasses; + private String sessionId; + private boolean dumpOnExit = true; + private Output output = Output.FILE; + private String address; + private int port; + private File classDumpDir; + private boolean jmx; + + /** + * Creates a Jacoco task extension. + * + * @param objects the object factory + * @param agent the agent JAR to use for analysis + * @param task the task we extend + */ + public JacocoTaskExtension(ObjectFactory objects, JacocoAgentJar agent, JavaForkOptions task) { + this.agent = agent; + this.task = task; + destinationFile = objects.property(File.class); + } + + /** + * Whether or not the task should generate execution data. Defaults to {@code true}. + */ + @Input + public boolean isEnabled() { + return enabled; + } + + public void setEnabled(boolean enabled) { + this.enabled = enabled; + } + + /** + * The path for the execution data to be written to. + */ + @Nullable + @Optional + @OutputFile + public File getDestinationFile() { + return destinationFile.getOrNull(); + } + + /** + * Set the provider for calculating the destination file. + * + * @param destinationFile Destination file provider + * @since 4.0 + */ + public void setDestinationFile(Provider destinationFile) { + this.destinationFile.set(destinationFile); + } + + public void setDestinationFile(File destinationFile) { + this.destinationFile.set(destinationFile); + } + + /** + * List of class names that should be included in analysis. Names can use wildcards (* and ?). If left empty, all classes will be included. Defaults to an empty list. + */ + @Nullable + @Optional + @Input + public List getIncludes() { + return includes; + } + + public void setIncludes(@Nullable List includes) { + this.includes = includes; + } + + /** + * List of class names that should be excluded from analysis. Names can use wildcard (* and ?). Defaults to an empty list. + */ + @Nullable + @Optional + @Input + public List getExcludes() { + return excludes; + } + + public void setExcludes(@Nullable List excludes) { + this.excludes = excludes; + } + + /** + * List of classloader names that should be excluded from analysis. Names can use wildcards (* and ?). Defaults to an empty list. + */ + @Nullable + @Optional + @Input + public List getExcludeClassLoaders() { + return excludeClassLoaders; + } + + public void setExcludeClassLoaders(@Nullable List excludeClassLoaders) { + this.excludeClassLoaders = excludeClassLoaders; + } + + /** + * Whether or not classes without source location should be instrumented. Defaults to {@code false}. + * + * This property is only taken into account if the used JaCoCo version supports this option (JaCoCo version >= 0.7.6) + */ + @Input + public boolean isIncludeNoLocationClasses() { + return includeNoLocationClasses; + } + + public void setIncludeNoLocationClasses(boolean includeNoLocationClasses) { + this.includeNoLocationClasses = includeNoLocationClasses; + } + + /** + * An identifier for the session written to the execution data. Defaults to an auto-generated identifier. + */ + @Nullable + @Optional + @Input + public String getSessionId() { + return sessionId; + } + + public void setSessionId(@Nullable String sessionId) { + this.sessionId = sessionId; + } + + /** + * Whether or not to dump the coverage data at VM shutdown. Defaults to {@code true}. + */ + @Input + public boolean isDumpOnExit() { + return dumpOnExit; + } + + public void setDumpOnExit(boolean dumpOnExit) { + this.dumpOnExit = dumpOnExit; + } + + /** + * The type of output to generate. Defaults to {@link Output#FILE}. + */ + @Input + public Output getOutput() { + return output; + } + + public void setOutput(Output output) { + this.output = output; + } + + /** + * IP address or hostname to use with {@link Output#TCP_SERVER} or {@link Output#TCP_CLIENT}. Defaults to localhost. + */ + @Nullable + @Optional + @Input + public String getAddress() { + return address; + } + + public void setAddress(@Nullable String address) { + this.address = address; + } + + /** + * Port to bind to for {@link Output#TCP_SERVER} or {@link Output#TCP_CLIENT}. Defaults to 6300. + */ + @Input + public int getPort() { + return port; + } + + public void setPort(int port) { + this.port = port; + } + + /** + * Path to dump all class files the agent sees are dumped to. Defaults to no dumps. + * + * @since 3.4 + */ + @Nullable + @Optional + @LocalState + public File getClassDumpDir() { + return classDumpDir; + } + + /** + * Sets path to dump all class files the agent sees are dumped to. Defaults to no dumps. + * + * @since 3.4 + */ + public void setClassDumpDir(@Nullable File classDumpDir) { + this.classDumpDir = classDumpDir; + } + + /** + * Whether or not to expose functionality via JMX under {@code org.jacoco:type=Runtime}. Defaults to {@code false}. + * + * The configuration of the jmx property is only taken into account if the used JaCoCo version supports this option (JaCoCo version >= 0.6.2) + */ + @Input + public boolean isJmx() { + return jmx; + } + + public void setJmx(boolean jmx) { + this.jmx = jmx; + } + + /** + * The Jacoco agent classpath. + * + * This contains only one file - the agent jar. + * + * @since 4.6 + */ + @Classpath + public FileCollection getAgentClasspath() { + return agent.getAgentConf(); + } + + /** + * Gets all properties in the format expected of the agent JVM argument. + * + * @return state of extension in a JVM argument + */ + @Internal + public String getAsJvmArg() { + StringBuilder builder = new StringBuilder(); + ArgumentAppender argument = new ArgumentAppender(builder, task.getWorkingDir()); + builder.append("-javaagent:"); + builder.append(RelativePathUtil.relativePath(task.getWorkingDir(), agent.getJar())); + builder.append('='); + argument.append("destfile", getDestinationFile()); + argument.append("append", true); + argument.append("includes", getIncludes()); + argument.append("excludes", getExcludes()); + argument.append("exclclassloader", getExcludeClassLoaders()); + if (agent.supportsInclNoLocationClasses()) { + argument.append("inclnolocationclasses", isIncludeNoLocationClasses()); + } + argument.append("sessionid", getSessionId()); + argument.append("dumponexit", isDumpOnExit()); + argument.append("output", getOutput().getAsArg()); + argument.append("address", getAddress()); + argument.append("port", getPort()); + argument.append("classdumpdir", getClassDumpDir()); + + if (agent.supportsJmx()) { + argument.append("jmx", isJmx()); + } + + return builder.toString(); + } + + private static class ArgumentAppender { + + private final StringBuilder builder; + private final File workingDirectory; + private boolean anyArgs; + + public ArgumentAppender(StringBuilder builder, File workingDirectory) { + this.builder = builder; + this.workingDirectory = workingDirectory; + } + + public void append(String name, @Nullable Object value) { + if (value != null + && !((value instanceof Collection) && ((Collection) value).isEmpty()) + && !((value instanceof String) && (StringUtils.isEmpty((String) value))) + && !((value instanceof Integer) && ((Integer) value == 0))) { + if (anyArgs) { + builder.append(','); + } + builder.append(name).append('='); + if (value instanceof Collection) { + builder.append(Joiner.on(':').join((Collection) value)); + } else if (value instanceof File) { + builder.append(RelativePathUtil.relativePath(workingDirectory, (File) value)); + } else { + builder.append(value); + } + anyArgs = true; + } + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/kotlin-dsl-tooling-models/org/gradle/kotlin/dsl/tooling/models/EditorReportSeverity.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/kotlin-dsl-tooling-models/org/gradle/kotlin/dsl/tooling/models/EditorReportSeverity.java new file mode 100644 index 0000000..d74023b --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/kotlin-dsl-tooling-models/org/gradle/kotlin/dsl/tooling/models/EditorReportSeverity.java @@ -0,0 +1,23 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.kotlin.dsl.tooling.models; + + +public enum EditorReportSeverity { + WARNING, + ERROR +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/kotlin-dsl/org/gradle/kotlin/dsl/ExtensionAwareExtensions.kt b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/kotlin-dsl/org/gradle/kotlin/dsl/ExtensionAwareExtensions.kt new file mode 100644 index 0000000..40d971a --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/kotlin-dsl/org/gradle/kotlin/dsl/ExtensionAwareExtensions.kt @@ -0,0 +1,49 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.kotlin.dsl + +import org.gradle.api.plugins.ExtensionAware +import kotlin.reflect.KClass + + +/** + * Returns the extension of the specified type. + * + * @param T the extension type. + */ +inline fun ExtensionAware.the(): T = + extensions.getByType(typeOf()) + + +/** + * Returns the extension of the specified [extensionType]. + * + * @param T the extension type. + * @param extensionType the reified extension type. + */ +fun ExtensionAware.the(extensionType: KClass): T = + extensions.getByType(extensionType.java) + + +/** + * Executes the given configuration block against the [extension][ExtensionAware] of the specified type. + * + * @param T the extension type. + * @param configuration the configuration block. + * @see [ExtensionAware] + */ +inline fun ExtensionAware.configure(noinline configuration: T.() -> Unit): Unit = + extensions.configure(typeOf(), configuration) diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/kotlin-dsl/org/gradle/kotlin/dsl/execution/ResidualProgram.kt b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/kotlin-dsl/org/gradle/kotlin/dsl/execution/ResidualProgram.kt new file mode 100644 index 0000000..51962b6 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/kotlin-dsl/org/gradle/kotlin/dsl/execution/ResidualProgram.kt @@ -0,0 +1,88 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.kotlin.dsl.execution + + +/** + * The result of partially evaluating a Kotlin DSL [program][Program] of a certain [kind][ProgramKind] + * against a given [target][ProgramTarget]. + * + * @see PartialEvaluator.reduce + */ +internal +sealed class ResidualProgram { + + /** + * A static residue, can be compiled ahead of time. + */ + data class Static(val instructions: List) : ResidualProgram() { + + constructor(vararg instructions: Instruction) : + this(instructions.toList()) + } + + /** + * A dynamic script [source] residue, can only be compiled after the execution of the static [prelude] at runtime. + */ + data class Dynamic(val prelude: Static, val source: ProgramSource) : ResidualProgram() + + sealed class Instruction { + + /** + * Causes the configuration of the embedded Kotlin libraries + * on the host's ScriptHandler. + */ + object SetupEmbeddedKotlin : Instruction() + + /** + * Causes the target scope to be closed without applying any plugins. + */ + object CloseTargetScope : StageTransition, Instruction() + + /** + * Causes the target scope to be closed by applying a default set of plugin requests that includes + * the set of [auto-applied plugins][org.gradle.plugin.management.internal.autoapply.AutoAppliedPluginHandler]. + */ + object ApplyDefaultPluginRequests : StageTransition, Instruction() + + /** + * Causes the target scope to be closed by applying the plugin requests collected during the execution + * of the given [program] plus the set of [auto-applied plugins][org.gradle.plugin.management.internal.autoapply.AutoAppliedPluginHandler]. + */ + data class ApplyPluginRequestsOf(val program: Program.Stage1) : StageTransition, Instruction() + + /** + * An instruction that marks the transition from stage 1 to stage 2 by causing the + * target scope to be closed thus making the resolved classpath available to stage 2. + * + * A valid [Static] program must contain one and only one [StageTransition] instruction. + */ + interface StageTransition + + /** + * Causes the Kotlin DSL base plugins to be applied. + */ + object ApplyBasePlugins : Instruction() + + /** + * Causes the evaluation of the precompiled [script] against the script host. + */ + data class Eval(val script: ProgramSource) : Instruction() + + override fun toString(): String = javaClass.simpleName + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/kotlin-dsl/org/gradle/kotlin/dsl/execution/TemporaryScriptFiles.kt b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/kotlin-dsl/org/gradle/kotlin/dsl/execution/TemporaryScriptFiles.kt new file mode 100644 index 0000000..a245c3c --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/kotlin-dsl/org/gradle/kotlin/dsl/execution/TemporaryScriptFiles.kt @@ -0,0 +1,51 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.kotlin.dsl.execution + +import org.gradle.api.internal.file.temp.TemporaryFileProvider +import java.io.File + + +internal +inline fun TemporaryFileProvider.withTemporaryScriptFileFor(scriptPath: String, scriptText: String, action: (File) -> T): T = + createTemporaryDirectory("gradle-kotlin-dsl-", null).let { tempDir -> + try { + val tempFile = canonicalScriptFileFor(tempDir, scriptPath, scriptText) + try { + action(tempFile) + } finally { + tempFile.delete() + } + } finally { + tempDir.delete() + } + } + + +private +fun canonicalScriptFileFor(baseDir: File, scriptPath: String, scriptText: String): File = + baseDir.resolve(scriptFileNameFor(scriptPath)).run { + writeText(scriptText) + canonicalFile + } + + +private +fun scriptFileNameFor(scriptPath: String) = scriptPath.run { + val index = lastIndexOf('/') + if (index != -1) substring(index + 1, length) else substringAfterLast('\\') +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/kotlin-dsl/org/gradle/kotlin/dsl/support/GradleUserHomeServices.kt b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/kotlin-dsl/org/gradle/kotlin/dsl/support/GradleUserHomeServices.kt new file mode 100644 index 0000000..a2626e3 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/kotlin-dsl/org/gradle/kotlin/dsl/support/GradleUserHomeServices.kt @@ -0,0 +1,25 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.kotlin.dsl.support + + +internal +object GradleUserHomeServices { + + @Suppress("unused") + fun createEmbeddedKotlinRepositoryProvider() = + EmbeddedKotlinProvider() +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/api/internal/tasks/compile/JdkTools.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/api/internal/tasks/compile/JdkTools.java new file mode 100644 index 0000000..35728c1 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/api/internal/tasks/compile/JdkTools.java @@ -0,0 +1,190 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.compile; + +import org.gradle.api.JavaVersion; +import org.gradle.api.internal.tasks.compile.incremental.compilerapi.constants.ConstantsAnalysisResult; +import org.gradle.internal.Cast; +import org.gradle.internal.UncheckedException; +import org.gradle.internal.classloader.ClassLoaderFactory; +import org.gradle.internal.classloader.DefaultClassLoaderFactory; +import org.gradle.internal.classloader.FilteringClassLoader; +import org.gradle.internal.classloader.VisitableURLClassLoader; +import org.gradle.internal.classpath.ClassPath; +import org.gradle.internal.classpath.DefaultClassPath; +import org.gradle.internal.jvm.Jvm; +import org.gradle.internal.reflect.DirectInstantiator; + +import javax.lang.model.SourceVersion; +import javax.tools.DiagnosticListener; +import javax.tools.JavaCompiler; +import javax.tools.JavaFileManager; +import javax.tools.JavaFileObject; +import javax.tools.StandardJavaFileManager; +import java.io.File; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.Writer; +import java.lang.reflect.InvocationTargetException; +import java.nio.charset.Charset; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.function.BiConsumer; +import java.util.function.Consumer; +import java.util.function.Function; + +import static java.lang.ClassLoader.getSystemClassLoader; + +/** + * Subset replacement for {@link javax.tools.ToolProvider} that avoids the application class loader. + */ +public class JdkTools { + + // Copied from ToolProvider.defaultJavaCompilerName + private static final String DEFAULT_COMPILER_IMPL_NAME = "com.sun.tools.javac.api.JavacTool"; + + private final ClassLoader isolatedToolsLoader; + private final boolean isJava9Compatible; + + private Class incrementalCompileTaskClass; + + JdkTools(Jvm jvm, List compilerPlugins) { + DefaultClassLoaderFactory defaultClassLoaderFactory = new DefaultClassLoaderFactory(); + JavaVersion javaVersion = jvm.getJavaVersion(); + boolean java9Compatible = javaVersion.isJava9Compatible(); + ClassLoader filteringClassLoader = getSystemFilteringClassLoader(defaultClassLoaderFactory); + if (!java9Compatible) { + File toolsJar = jvm.getToolsJar(); + if (toolsJar == null) { + throw new IllegalStateException("Could not find tools.jar. Please check that " + + jvm.getJavaHome().getAbsolutePath() + + " contains a valid JDK installation."); + } + ClassPath defaultClassPath = DefaultClassPath.of(toolsJar).plus(compilerPlugins); + isolatedToolsLoader = new VisitableURLClassLoader("jdk-tools", filteringClassLoader, defaultClassPath.getAsURLs()); + isJava9Compatible = false; + } else { + isolatedToolsLoader = new VisitableURLClassLoader("jdk-tools", filteringClassLoader, DefaultClassPath.of(compilerPlugins)); + isJava9Compatible = true; + } + } + + private ClassLoader getSystemFilteringClassLoader(ClassLoaderFactory classLoaderFactory) { + FilteringClassLoader.Spec filterSpec = new FilteringClassLoader.Spec(); + filterSpec.allowPackage("com.sun.tools"); + filterSpec.allowPackage("com.sun.source"); + return classLoaderFactory.createFilteringClassLoader(getSystemClassLoader(), filterSpec); + } + + public JavaCompiler getSystemJavaCompiler() { + return new DefaultIncrementalAwareCompiler(buildJavaCompiler()); + } + + private JavaCompiler buildJavaCompiler() { + Class clazz; + try { + if (isJava9Compatible) { + clazz = isolatedToolsLoader.loadClass("javax.tools.ToolProvider"); + try { + JavaCompiler compiler = (JavaCompiler) clazz.getDeclaredMethod("getSystemJavaCompiler").invoke(null); + if (compiler == null) { + // We were trying to load a compiler in our process so Jvm.current() is the correct one to blame. + throw new IllegalStateException("Java compiler is not available. Please check that " + + Jvm.current().getJavaHome().getAbsolutePath() + + " contains a valid JDK installation."); + } + return compiler; + } catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { + cannotCreateJavaCompiler(e); + } + } else { + clazz = isolatedToolsLoader.loadClass(DEFAULT_COMPILER_IMPL_NAME); + } + } catch (ClassNotFoundException e) { + throw new IllegalStateException("Could not load class '" + DEFAULT_COMPILER_IMPL_NAME); + } + return DirectInstantiator.instantiate(clazz.asSubclass(JavaCompiler.class)); + } + + private void cannotCreateJavaCompiler(Exception e) { + throw new IllegalStateException("Could not create system Java compiler", e); + } + + private class DefaultIncrementalAwareCompiler implements IncrementalCompilationAwareJavaCompiler { + private final JavaCompiler delegate; + + private DefaultIncrementalAwareCompiler(JavaCompiler delegate) { + this.delegate = delegate; + } + + @Override + public CompilationTask getTask(Writer out, JavaFileManager fileManager, DiagnosticListener diagnosticListener, Iterable options, Iterable classes, Iterable compilationUnits) { + return delegate.getTask(out, fileManager, diagnosticListener, options, classes, compilationUnits); + } + + @Override + public StandardJavaFileManager getStandardFileManager(DiagnosticListener diagnosticListener, Locale locale, Charset charset) { + return delegate.getStandardFileManager(diagnosticListener, locale, charset); + } + + @Override + public String name() { + return delegate.name(); + } + + @Override + public int run(InputStream in, OutputStream out, OutputStream err, String... arguments) { + return delegate.run(in, out, err, arguments); + } + + @Override + public Set getSourceVersions() { + return delegate.getSourceVersions(); + } + + @Override + public int isSupportedOption(String option) { + return delegate.isSupportedOption(option); + } + + @Override + public JavaCompiler.CompilationTask makeIncremental(JavaCompiler.CompilationTask task, Map> sourceToClassMapping, ConstantsAnalysisResult constantsAnalysisResult, CompilationSourceDirs compilationSourceDirs) { + ensureCompilerTask(); + return DirectInstantiator.instantiate(incrementalCompileTaskClass, task, + (Function>) compilationSourceDirs::relativize, + (Consumer>>) sourceToClassMapping::putAll, + (BiConsumer) constantsAnalysisResult::addPublicDependent, + (BiConsumer) constantsAnalysisResult::addPrivateDependent + ); + } + } + + private void ensureCompilerTask() { + if (incrementalCompileTaskClass == null) { + synchronized (this) { + try { + incrementalCompileTaskClass = Cast.uncheckedCast(isolatedToolsLoader.loadClass("org.gradle.internal.compiler.java.IncrementalCompileTask")); + } catch (ClassNotFoundException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/api/internal/tasks/compile/incremental/SelectiveCompiler.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/api/internal/tasks/compile/incremental/SelectiveCompiler.java new file mode 100644 index 0000000..7b091b9 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/api/internal/tasks/compile/incremental/SelectiveCompiler.java @@ -0,0 +1,107 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.compile.incremental; + +import com.google.common.collect.Iterables; +import org.gradle.api.internal.tasks.compile.CleaningJavaCompiler; +import org.gradle.api.internal.tasks.compile.JavaCompileSpec; +import org.gradle.api.internal.tasks.compile.incremental.recomp.CurrentCompilation; +import org.gradle.api.internal.tasks.compile.incremental.recomp.CurrentCompilationAccess; +import org.gradle.api.internal.tasks.compile.incremental.recomp.PreviousCompilation; +import org.gradle.api.internal.tasks.compile.incremental.recomp.PreviousCompilationAccess; +import org.gradle.api.internal.tasks.compile.incremental.recomp.PreviousCompilationData; +import org.gradle.api.internal.tasks.compile.incremental.recomp.RecompilationSpec; +import org.gradle.api.internal.tasks.compile.incremental.recomp.RecompilationSpecProvider; +import org.gradle.api.tasks.WorkResult; +import org.gradle.api.tasks.WorkResults; +import org.gradle.internal.time.Time; +import org.gradle.internal.time.Timer; +import org.gradle.language.base.internal.compile.Compiler; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.Collection; +import java.util.Objects; + +class SelectiveCompiler implements org.gradle.language.base.internal.compile.Compiler { + private static final Logger LOG = LoggerFactory.getLogger(SelectiveCompiler.class); + private final CleaningJavaCompiler cleaningCompiler; + private final Compiler rebuildAllCompiler; + private final RecompilationSpecProvider recompilationSpecProvider; + private final CurrentCompilationAccess classpathSnapshotter; + private final PreviousCompilationAccess previousCompilationAccess; + + public SelectiveCompiler( + CleaningJavaCompiler cleaningJavaCompiler, + Compiler rebuildAllCompiler, + RecompilationSpecProvider recompilationSpecProvider, + CurrentCompilationAccess classpathSnapshotter, + PreviousCompilationAccess previousCompilationAccess + ) { + this.cleaningCompiler = cleaningJavaCompiler; + this.rebuildAllCompiler = rebuildAllCompiler; + this.recompilationSpecProvider = recompilationSpecProvider; + this.classpathSnapshotter = classpathSnapshotter; + this.previousCompilationAccess = previousCompilationAccess; + } + + @Override + public WorkResult execute(T spec) { + if (!recompilationSpecProvider.isIncremental()) { + LOG.info("Full recompilation is required because no incremental change information is available. This is usually caused by clean builds or changing compiler arguments."); + return rebuildAllCompiler.execute(spec); + } + File previousCompilationDataFile = Objects.requireNonNull(spec.getCompileOptions().getPreviousCompilationDataFile()); + if (!previousCompilationDataFile.exists()) { + LOG.info("Full recompilation is required because no previous compilation result is available."); + return rebuildAllCompiler.execute(spec); + } + if (spec.getSourceRoots().isEmpty()) { + LOG.info("Full recompilation is required because the source roots could not be inferred."); + return rebuildAllCompiler.execute(spec); + } + + Timer clock = Time.startTimer(); + CurrentCompilation currentCompilation = new CurrentCompilation(spec, classpathSnapshotter); + + PreviousCompilationData previousCompilationData = previousCompilationAccess.readPreviousCompilationData(previousCompilationDataFile); + PreviousCompilation previousCompilation = new PreviousCompilation(previousCompilationData); + RecompilationSpec recompilationSpec = recompilationSpecProvider.provideRecompilationSpec(currentCompilation, previousCompilation); + + if (recompilationSpec.isFullRebuildNeeded()) { + LOG.info("Full recompilation is required because {}. Analysis took {}.", recompilationSpec.getFullRebuildCause(), clock.getElapsed()); + return rebuildAllCompiler.execute(spec); + } + + boolean cleanedOutput = recompilationSpecProvider.initializeCompilation(spec, recompilationSpec); + + if (Iterables.isEmpty(spec.getSourceFiles()) && spec.getClasses().isEmpty()) { + LOG.info("None of the classes needs to be compiled! Analysis took {}. ", clock.getElapsed()); + return new RecompilationNotNecessary(previousCompilationData, recompilationSpec); + } + + try { + WorkResult result = recompilationSpecProvider.decorateResult(recompilationSpec, previousCompilationData, cleaningCompiler.getCompiler().execute(spec)); + return result.or(WorkResults.didWork(cleanedOutput)); + } finally { + Collection classesToCompile = recompilationSpec.getClassesToCompile(); + LOG.info("Incremental compilation of {} classes completed in {}.", classesToCompile.size(), clock.getElapsed()); + LOG.debug("Recompiled classes {}", classesToCompile); + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/api/internal/tasks/compile/incremental/compilerapi/constants/ConstantToDependentsMappingBuilder.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/api/internal/tasks/compile/incremental/compilerapi/constants/ConstantToDependentsMappingBuilder.java new file mode 100644 index 0000000..15a757c --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/api/internal/tasks/compile/incremental/compilerapi/constants/ConstantToDependentsMappingBuilder.java @@ -0,0 +1,75 @@ +/* + * Copyright 2021 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.compile.incremental.compilerapi.constants; + +import com.google.common.collect.Iterables; +import org.gradle.api.internal.tasks.compile.incremental.compilerapi.deps.DependentsSet; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * A builder helper class to construct the ConstantToDependentsMapping + */ +public class ConstantToDependentsMappingBuilder implements Serializable { + + private final Map> privateDependents = new HashMap<>(); + private final Map> accessibleDependents = new HashMap<>(); + + public ConstantToDependentsMappingBuilder addAccessibleDependents(String constantOrigin, Collection dependents) { + dependents.forEach(dependent -> addAccessibleDependent(constantOrigin, dependent)); + return this; + } + + public ConstantToDependentsMappingBuilder addPrivateDependents(String constantOrigin, Collection dependents) { + dependents.forEach(dependent -> addPrivateDependent(constantOrigin, dependent)); + return this; + } + + public ConstantToDependentsMappingBuilder addPrivateDependent(String constantOrigin, String dependent) { + Set accessibleDependents = this.accessibleDependents.computeIfAbsent(constantOrigin, k -> new HashSet<>()); + Set privateDependents = this.privateDependents.computeIfAbsent(constantOrigin, k -> new HashSet<>()); + if (!accessibleDependents.contains(dependent)) { + privateDependents.add(dependent); + } + return this; + } + + public ConstantToDependentsMappingBuilder addAccessibleDependent(String constantOrigin, String dependent) { + Set accessibleDependents = this.accessibleDependents.computeIfAbsent(constantOrigin, k -> new HashSet<>()); + Set privateDependents = this.privateDependents.computeIfAbsent(constantOrigin, k -> new HashSet<>()); + accessibleDependents.add(dependent); + privateDependents.remove(dependent); + return this; + } + + public ConstantToDependentsMapping build() { + Map constantDependents = new HashMap<>(); + for (String constantOrigin : Iterables.concat(privateDependents.keySet(), accessibleDependents.keySet())) { + Set privateDependents = this.privateDependents.getOrDefault(constantOrigin, Collections.emptySet()); + Set accessibleDependents = this.accessibleDependents.getOrDefault(constantOrigin, Collections.emptySet()); + constantDependents.put(constantOrigin, DependentsSet.dependentClasses(privateDependents, accessibleDependents)); + } + return new ConstantToDependentsMapping(constantDependents); + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/api/internal/tasks/compile/incremental/recomp/WellKnownSourceFileClassNameConverter.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/api/internal/tasks/compile/incremental/recomp/WellKnownSourceFileClassNameConverter.java new file mode 100644 index 0000000..1c75b78 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/api/internal/tasks/compile/incremental/recomp/WellKnownSourceFileClassNameConverter.java @@ -0,0 +1,67 @@ +/* + * Copyright 2021 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.compile.incremental.recomp; + +import org.apache.commons.lang.StringUtils; + +import java.util.Collection; +import java.util.Collections; + +/** + * Handles classes which can affect other classes simply by being newly added to a source set. + */ +public class WellKnownSourceFileClassNameConverter implements SourceFileClassNameConverter { + private static final String MODULE_INFO = "module-info"; + private static final String PACKAGE_INFO = "package-info"; + + private final SourceFileClassNameConverter delegate; + private final String fileExtension; + + public WellKnownSourceFileClassNameConverter(SourceFileClassNameConverter delegate, String fileExtension) { + this.delegate = delegate; + this.fileExtension = fileExtension; + } + + public static boolean isPackageInfo(String className) { + return className.endsWith(PACKAGE_INFO); + } + + public static boolean isModuleInfo(String className) { + return className.equals(MODULE_INFO); + } + + @Override + public Collection getClassNames(String sourceFileRelativePath) { + String withoutExtension = StringUtils.removeEnd(sourceFileRelativePath, fileExtension); + if (isModuleInfo(withoutExtension)) { + return Collections.singleton(MODULE_INFO); + } + if (isPackageInfo(withoutExtension)) { + String packageName = withoutExtension.replace('/', '.'); + return Collections.singleton(packageName); + } + return delegate.getClassNames(sourceFileRelativePath); + } + + @Override + public Collection getRelativeSourcePaths(String className) { + if (isModuleInfo(className) || isPackageInfo(className)) { + return Collections.singleton(className.replace('.', '/') + fileExtension); + } + return delegate.getRelativeSourcePaths(className); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/api/internal/tasks/compile/processing/IsolatingProcessor.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/api/internal/tasks/compile/processing/IsolatingProcessor.java new file mode 100644 index 0000000..aa3edc2 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/api/internal/tasks/compile/processing/IsolatingProcessor.java @@ -0,0 +1,52 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.compile.processing; + +import org.gradle.api.internal.tasks.compile.incremental.processing.AnnotationProcessorResult; + +import javax.annotation.processing.ProcessingEnvironment; +import javax.annotation.processing.Processor; +import javax.annotation.processing.RoundEnvironment; +import javax.lang.model.element.TypeElement; +import java.util.Set; + +/** + * An isolating processor must provide exactly one originating element + * for each file it generates. + */ +public class IsolatingProcessor extends DelegatingProcessor { + + private final IsolatingProcessingStrategy strategy; + + public IsolatingProcessor(Processor delegate, AnnotationProcessorResult result) { + super(delegate); + this.strategy = new IsolatingProcessingStrategy(result); + } + + @Override + public final void init(ProcessingEnvironment processingEnv) { + IncrementalFiler incrementalFiler = new IncrementalFiler(processingEnv.getFiler(), strategy); + IncrementalProcessingEnvironment incrementalProcessingEnvironment = new IncrementalProcessingEnvironment(processingEnv, incrementalFiler); + super.init(incrementalProcessingEnvironment); + } + + @Override + public boolean process(Set annotations, RoundEnvironment roundEnv) { + strategy.recordProcessingInputs(getSupportedAnnotationTypes(), annotations, roundEnv); + return super.process(annotations, roundEnv); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/external/javadoc/JavadocMemberLevel.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/external/javadoc/JavadocMemberLevel.java new file mode 100644 index 0000000..ab06d8d --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/external/javadoc/JavadocMemberLevel.java @@ -0,0 +1,39 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.external.javadoc; + +/** + * This enum maps to the -public, -protected, -package and -private options of the javadoc executable. + */ +public enum JavadocMemberLevel { + /** + * Shows only public classes and members. + */ + PUBLIC, + /** + * Shows only protected and public classes and members. This is the default. + */ + PROTECTED, + /** + * Shows only package, protected, and public classes and members. + */ + PACKAGE, + /** + * Shows all classes and members. + */ + PRIVATE +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/external/javadoc/JavadocOfflineLink.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/external/javadoc/JavadocOfflineLink.java new file mode 100644 index 0000000..48afedb --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/external/javadoc/JavadocOfflineLink.java @@ -0,0 +1,61 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.external.javadoc; + +import com.google.common.base.Objects; + +import java.io.Serializable; + +/** + * This class is used to hold the information that can be provided to the javadoc executable via the -linkoffline + * option. + */ +public class JavadocOfflineLink implements Serializable { + private final String extDocUrl; + private final String packagelistLoc; + + public JavadocOfflineLink(String extDocUrl, String packagelistLoc) { + this.extDocUrl = extDocUrl; + this.packagelistLoc = packagelistLoc; + } + + public String getExtDocUrl() { + return extDocUrl; + } + + public String getPackagelistLoc() { + return packagelistLoc; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + JavadocOfflineLink that = (JavadocOfflineLink) o; + return Objects.equal(extDocUrl, that.extDocUrl) + && Objects.equal(packagelistLoc, that.packagelistLoc); + } + + @Override + public int hashCode() { + return Objects.hashCode(extDocUrl, packagelistLoc); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/external/javadoc/internal/StringJavadocOptionFileOption.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/external/javadoc/internal/StringJavadocOptionFileOption.java new file mode 100644 index 0000000..1cee56b --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/external/javadoc/internal/StringJavadocOptionFileOption.java @@ -0,0 +1,37 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.external.javadoc.internal; + +import java.io.IOException; + +public class StringJavadocOptionFileOption extends AbstractJavadocOptionFileOption { + public StringJavadocOptionFileOption(String option, String value) { + super(option, value); + } + + @Override + public void write(JavadocOptionFileWriterContext writerContext) throws IOException { + if (value != null) { + writerContext.writeValueOption(option, value); + } + } + + @Override + public StringJavadocOptionFileOption duplicate() { + return new StringJavadocOptionFileOption(option, value); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/external/javadoc/internal/StringsJavadocOptionFileOption.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/external/javadoc/internal/StringsJavadocOptionFileOption.java new file mode 100644 index 0000000..2a3296b --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-java/org/gradle/external/javadoc/internal/StringsJavadocOptionFileOption.java @@ -0,0 +1,39 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.external.javadoc.internal; + +import com.google.common.collect.Lists; + +import java.io.IOException; +import java.util.List; + +public class StringsJavadocOptionFileOption extends AbstractListJavadocOptionFileOption> { + public StringsJavadocOptionFileOption(String option, List value, String joinBy) { + super(option, value, joinBy); + } + + @Override + public void writeCollectionValue(JavadocOptionFileWriterContext writerContext) throws IOException { + writerContext.writeValuesOption(option, value, joinBy); + } + + @Override + public StringsJavadocOptionFileOption duplicate() { + List duplicateValue = Lists.newArrayList(value); + return new StringsJavadocOptionFileOption(option, duplicateValue, joinBy); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-native/org/gradle/language/cpp/CppBinary.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-native/org/gradle/language/cpp/CppBinary.java new file mode 100644 index 0000000..13e6b73 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-native/org/gradle/language/cpp/CppBinary.java @@ -0,0 +1,86 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.cpp; + +import org.gradle.api.attributes.Attribute; +import org.gradle.api.component.BuildableComponent; +import org.gradle.api.file.FileCollection; +import org.gradle.api.provider.Provider; +import org.gradle.language.ComponentWithDependencies; +import org.gradle.language.cpp.tasks.CppCompile; +import org.gradle.language.nativeplatform.ComponentWithObjectFiles; +import org.gradle.nativeplatform.Linkage; + +/** + * A binary built from C++ source and linked from the resulting object files. + * + * @since 4.2 + */ +public interface CppBinary extends ComponentWithObjectFiles, ComponentWithDependencies, BuildableComponent { + /** + * The dependency resolution attribute use to indicate whether a binary is debuggable or not. + */ + Attribute DEBUGGABLE_ATTRIBUTE = Attribute.of("org.gradle.native.debuggable", Boolean.class); + + /** + * The dependency resolution attribute use to indicate whether a binary is optimized or not. + * + * @since 4.5 + */ + Attribute OPTIMIZED_ATTRIBUTE = Attribute.of("org.gradle.native.optimized", Boolean.class); + + /** + * The dependency resolution attribute use to indicate which linkage a binary uses. + * + * @since 4.5 + */ + Attribute LINKAGE_ATTRIBUTE = Attribute.of("org.gradle.native.linkage", Linkage.class); + + /** + * Returns the C++ source files of this binary. + */ + FileCollection getCppSource(); + + /** + * Returns the header directories to use to compile this binary. Includes the header directories of this binary plus those of its dependencies. + */ + FileCollection getCompileIncludePath(); + + /** + * Returns the link libraries to use to link this binary. Includes the link libraries of the component's dependencies. + */ + FileCollection getLinkLibraries(); + + /** + * Returns the runtime libraries required by this binary. Includes the runtime libraries of the component's dependencies. + */ + FileCollection getRuntimeLibraries(); + + /** + * Returns the target platform for this component. + * + * @since 4.5 + */ + CppPlatform getTargetPlatform(); + + /** + * Returns the compile task for this binary. + * + * @since 4.5 + */ + Provider getCompileTask(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-native/org/gradle/language/nativeplatform/ComponentWithStaticLibrary.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-native/org/gradle/language/nativeplatform/ComponentWithStaticLibrary.java new file mode 100644 index 0000000..f24e5c3 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-native/org/gradle/language/nativeplatform/ComponentWithStaticLibrary.java @@ -0,0 +1,32 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.nativeplatform; + +import org.gradle.api.provider.Provider; +import org.gradle.nativeplatform.tasks.CreateStaticLibrary; + +/** + * Represents a component that produces a static library. + * + * @since 4.5 + */ +public interface ComponentWithStaticLibrary extends ComponentWithLinkFile { + /** + * Returns the task to create the static library. + */ + Provider getCreateTask(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-native/org/gradle/language/nativeplatform/internal/incremental/DefaultHeaderDependenciesCollector.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-native/org/gradle/language/nativeplatform/internal/incremental/DefaultHeaderDependenciesCollector.java new file mode 100644 index 0000000..a39582c --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-native/org/gradle/language/nativeplatform/internal/incremental/DefaultHeaderDependenciesCollector.java @@ -0,0 +1,65 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.nativeplatform.internal.incremental; + +import com.google.common.collect.ImmutableSortedSet; +import org.gradle.api.NonNullApi; +import org.gradle.api.file.EmptyFileVisitor; +import org.gradle.api.file.FileVisitDetails; +import org.gradle.api.internal.file.collections.DirectoryFileTreeFactory; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.io.File; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +@NonNullApi +public class DefaultHeaderDependenciesCollector implements HeaderDependenciesCollector { + private final Logger logger = LoggerFactory.getLogger(DefaultHeaderDependenciesCollector.class); + private final DirectoryFileTreeFactory directoryFileTreeFactory; + + public DefaultHeaderDependenciesCollector(DirectoryFileTreeFactory directoryFileTreeFactory) { + this.directoryFileTreeFactory = directoryFileTreeFactory; + } + + @Override + public ImmutableSortedSet collectExistingHeaderDependencies(String taskPath, List includeRoots, IncrementalCompilation incrementalCompilation) { + final Set headerDependencies = new HashSet(); + if (incrementalCompilation.isUnresolvedHeaders()) { + logger.info("After parsing the source files, Gradle cannot calculate the exact set of include files for '{}'. Every file in the include search path will be considered a header dependency.", taskPath); + addIncludeRoots(taskPath, includeRoots, headerDependencies); + } else { + logger.info("Found all include files for '{}'", taskPath); + headerDependencies.addAll(incrementalCompilation.getExistingHeaders()); + } + return ImmutableSortedSet.copyOf(headerDependencies); + } + + private void addIncludeRoots(String taskPath, List includeRoots, final Set headerDependencies) { + for (final File includeRoot : includeRoots) { + logger.info("adding files in {} to header dependencies for {}", includeRoot, taskPath); + directoryFileTreeFactory.create(includeRoot).visit(new EmptyFileVisitor() { + @Override + public void visitFile(FileVisitDetails fileDetails) { + headerDependencies.add(fileDetails.getFile()); + } + }); + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-native/org/gradle/language/nativeplatform/internal/incremental/sourceparser/SimpleExpression.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-native/org/gradle/language/nativeplatform/internal/incremental/sourceparser/SimpleExpression.java new file mode 100644 index 0000000..12e3bc2 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-native/org/gradle/language/nativeplatform/internal/incremental/sourceparser/SimpleExpression.java @@ -0,0 +1,69 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.nativeplatform.internal.incremental.sourceparser; + +import com.google.common.base.Objects; +import org.gradle.language.nativeplatform.internal.Expression; +import org.gradle.language.nativeplatform.internal.IncludeType; + +import javax.annotation.Nullable; + +/** + * An expression that has a type and value and no arguments. + */ +public class SimpleExpression extends AbstractExpression { + public static final Expression EMPTY_EXPRESSIONS = new SimpleExpression(null, IncludeType.EXPRESSIONS); + static final Expression EMPTY_ARGS = new SimpleExpression(null, IncludeType.ARGS_LIST); + static final Expression LEFT_PAREN = new SimpleExpression("(", IncludeType.TOKEN); + static final Expression COMMA = new SimpleExpression(",", IncludeType.TOKEN); + static final Expression RIGHT_PAREN = new SimpleExpression(")", IncludeType.TOKEN); + + private final String value; + private final IncludeType type; + + public SimpleExpression(@Nullable String value, IncludeType type) { + this.value = value; + this.type = type; + } + + @Override + public String getValue() { + return value; + } + + @Override + public IncludeType getType() { + return type; + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj == null || getClass() != obj.getClass()) { + return false; + } + SimpleExpression other = (SimpleExpression) obj; + return Objects.equal(value, other.value) && type.equals(other.type); + } + + @Override + public int hashCode() { + return (value == null ? 0 : value.hashCode()) ^ type.hashCode(); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-native/org/gradle/swiftpm/internal/DefaultPackage.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-native/org/gradle/swiftpm/internal/DefaultPackage.java new file mode 100644 index 0000000..bbfa9ac --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/language-native/org/gradle/swiftpm/internal/DefaultPackage.java @@ -0,0 +1,57 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.swiftpm.internal; + +import org.gradle.language.swift.SwiftVersion; +import org.gradle.swiftpm.Package; + +import javax.annotation.Nullable; +import java.io.Serializable; +import java.util.List; +import java.util.Set; + +public class DefaultPackage implements Package, Serializable { + private final Set products; + private final List dependencies; + private final List targets; + private final SwiftVersion swiftLanguageVersion; + + public DefaultPackage(Set products, List targets, List dependencies, @Nullable SwiftVersion swiftLanguageVersion) { + this.products = products; + this.targets = targets; + this.dependencies = dependencies; + this.swiftLanguageVersion = swiftLanguageVersion; + } + + public List getDependencies() { + return dependencies; + } + + @Nullable + public SwiftVersion getSwiftLanguageVersion() { + return swiftLanguageVersion; + } + + @Override + public Set getProducts() { + return products; + } + + public List getTargets() { + return targets; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/launcher/cli/RunBuildAction.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/launcher/cli/RunBuildAction.java new file mode 100644 index 0000000..f2615d6 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/launcher/cli/RunBuildAction.java @@ -0,0 +1,72 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.launcher.cli; + +import org.gradle.api.internal.StartParameterInternal; +import org.gradle.initialization.BuildClientMetaData; +import org.gradle.initialization.BuildRequestContext; +import org.gradle.initialization.DefaultBuildCancellationToken; +import org.gradle.initialization.DefaultBuildRequestContext; +import org.gradle.initialization.DefaultBuildRequestMetaData; +import org.gradle.initialization.NoOpBuildEventConsumer; +import org.gradle.initialization.ReportedException; +import org.gradle.internal.concurrent.Stoppable; +import org.gradle.internal.nativeintegration.console.ConsoleDetector; +import org.gradle.internal.service.ServiceRegistry; +import org.gradle.launcher.exec.BuildActionExecuter; +import org.gradle.launcher.exec.BuildActionParameters; +import org.gradle.launcher.exec.BuildActionResult; +import org.gradle.tooling.internal.provider.action.ExecuteBuildAction; + +public class RunBuildAction implements Runnable { + private final BuildActionExecuter executer; + private final StartParameterInternal startParameter; + private final BuildClientMetaData clientMetaData; + private final long startTime; + private final BuildActionParameters buildActionParameters; + private final ServiceRegistry sharedServices; + private final Stoppable stoppable; + + public RunBuildAction(BuildActionExecuter executer, StartParameterInternal startParameter, BuildClientMetaData clientMetaData, long startTime, + BuildActionParameters buildActionParameters, ServiceRegistry sharedServices, Stoppable stoppable) { + this.executer = executer; + this.startParameter = startParameter; + this.clientMetaData = clientMetaData; + this.startTime = startTime; + this.buildActionParameters = buildActionParameters; + this.sharedServices = sharedServices; + this.stoppable = stoppable; + } + + @Override + public void run() { + try { + BuildActionResult result = executer.execute( + new ExecuteBuildAction(startParameter), + buildActionParameters, + new DefaultBuildRequestContext(new DefaultBuildRequestMetaData(clientMetaData, startTime, sharedServices.get(ConsoleDetector.class).isConsoleInput()), new DefaultBuildCancellationToken(), new NoOpBuildEventConsumer()) + ); + if (result.hasFailure()) { + // Don't need to unpack the serialized failure. It will already have been reported and is not used by anything downstream of this action. + throw new ReportedException(); + } + } finally { + if (stoppable != null) { + stoppable.stop(); + } + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/launcher/daemon/client/DaemonClientGlobalServices.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/launcher/daemon/client/DaemonClientGlobalServices.java new file mode 100644 index 0000000..8e2f513 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/launcher/daemon/client/DaemonClientGlobalServices.java @@ -0,0 +1,45 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.launcher.daemon.client; + +import org.gradle.api.internal.DocumentationRegistry; +import org.gradle.internal.invocation.BuildAction; +import org.gradle.internal.jvm.inspection.JvmVersionDetector; +import org.gradle.internal.serialize.Serializer; +import org.gradle.internal.service.ServiceRegistry; +import org.gradle.tooling.internal.provider.action.BuildActionSerializer; + +/** + * Global services shared by all Gradle daemon clients in a given process. + */ +public class DaemonClientGlobalServices { + Serializer createBuildActionSerializer() { + return BuildActionSerializer.create(); + } + + JvmVersionValidator createJvmVersionValidator(JvmVersionDetector jvmVersionDetector) { + return new JvmVersionValidator(jvmVersionDetector); + } + + DaemonGreeter createDaemonGreeter(DocumentationRegistry documentationRegistry) { + return new DaemonGreeter(documentationRegistry); + } + + DaemonClientFactory createClientFactory(ServiceRegistry sharedServices) { + return new DaemonClientFactory(sharedServices); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/launcher/daemon/client/DefaultDaemonConnector.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/launcher/daemon/client/DefaultDaemonConnector.java new file mode 100644 index 0000000..7c1b5c3 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/launcher/daemon/client/DefaultDaemonConnector.java @@ -0,0 +1,307 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.launcher.daemon.client; + +import com.google.common.base.Preconditions; +import org.gradle.api.internal.specs.ExplainingSpec; +import org.gradle.api.internal.specs.ExplainingSpecs; +import org.gradle.api.logging.Logger; +import org.gradle.api.logging.Logging; +import org.gradle.api.specs.Spec; +import org.gradle.internal.Pair; +import org.gradle.internal.UncheckedException; +import org.gradle.internal.logging.progress.ProgressLogger; +import org.gradle.internal.logging.progress.ProgressLoggerFactory; +import org.gradle.internal.remote.internal.ConnectException; +import org.gradle.internal.remote.internal.OutgoingConnector; +import org.gradle.internal.remote.internal.RemoteConnection; +import org.gradle.internal.serialize.Serializer; +import org.gradle.internal.serialize.Serializers; +import org.gradle.internal.time.CountdownTimer; +import org.gradle.internal.time.Time; +import org.gradle.launcher.daemon.context.DaemonConnectDetails; +import org.gradle.launcher.daemon.context.DaemonContext; +import org.gradle.launcher.daemon.diagnostics.DaemonStartupInfo; +import org.gradle.launcher.daemon.logging.DaemonMessages; +import org.gradle.launcher.daemon.protocol.Message; +import org.gradle.launcher.daemon.registry.DaemonInfo; +import org.gradle.launcher.daemon.registry.DaemonRegistry; +import org.gradle.launcher.daemon.registry.DaemonStopEvent; +import org.gradle.launcher.daemon.registry.DaemonStopEvents; +import org.gradle.launcher.daemon.server.api.DaemonStateControl; +import org.gradle.util.internal.CollectionUtils; + +import java.util.Collection; +import java.util.Date; +import java.util.LinkedList; +import java.util.List; + +import static java.lang.Thread.sleep; +import static org.gradle.launcher.daemon.server.api.DaemonStateControl.State.Canceled; +import static org.gradle.launcher.daemon.server.api.DaemonStateControl.State.Idle; + +/** + * Provides the mechanics of connecting to a daemon, starting one via a given runnable if no suitable daemons are already available. + */ +public class DefaultDaemonConnector implements DaemonConnector { + private static final Logger LOGGER = Logging.getLogger(DefaultDaemonConnector.class); + public static final int DEFAULT_CONNECT_TIMEOUT = 30000; + public static final int CANCELED_WAIT_TIMEOUT = 3000; + private final DaemonRegistry daemonRegistry; + protected final OutgoingConnector connector; + private final DaemonStarter daemonStarter; + private final DaemonStartListener startListener; + private final ProgressLoggerFactory progressLoggerFactory; + private final Serializer serializer; + private long connectTimeout = DefaultDaemonConnector.DEFAULT_CONNECT_TIMEOUT; + + public DefaultDaemonConnector(DaemonRegistry daemonRegistry, OutgoingConnector connector, DaemonStarter daemonStarter, DaemonStartListener startListener, ProgressLoggerFactory progressLoggerFactory, Serializer serializer) { + this.serializer = serializer; + Preconditions.checkNotNull(daemonRegistry); + Preconditions.checkNotNull(connector); + Preconditions.checkNotNull(daemonStarter); + Preconditions.checkNotNull(startListener); + Preconditions.checkNotNull(progressLoggerFactory); + + this.daemonRegistry = daemonRegistry; + this.connector = connector; + this.daemonStarter = daemonStarter; + this.startListener = startListener; + this.progressLoggerFactory = progressLoggerFactory; + } + + public void setConnectTimeout(long connectTimeout) { + this.connectTimeout = connectTimeout; + } + + public long getConnectTimeout() { + return connectTimeout; + } + + public DaemonRegistry getDaemonRegistry() { + return daemonRegistry; + } + + @Override + public DaemonClientConnection maybeConnect(ExplainingSpec constraint) { + return findConnection(getCompatibleDaemons(daemonRegistry.getAll(), constraint)); + } + + @Override + public DaemonClientConnection maybeConnect(DaemonConnectDetails daemon) { + try { + return connectToDaemon(daemon, new CleanupOnStaleAddress(daemon, true)); + } catch (ConnectException e) { + LOGGER.debug("Cannot connect to daemon {} due to {}. Ignoring.", daemon, e); + } + return null; + } + + @Override + public void markDaemonAsUnavailable(DaemonConnectDetails daemon) { + removeDaemonFromRegistry(daemon, "unable to communicate with daemon"); + } + + @Override + public DaemonClientConnection connect(ExplainingSpec constraint) { + final Pair, Collection> idleBusy = partitionByState(daemonRegistry.getAll(), Idle); + final Collection idleDaemons = idleBusy.getLeft(); + final Collection busyDaemons = idleBusy.getRight(); + + // Check to see if there are any compatible idle daemons + DaemonClientConnection connection = connectToIdleDaemon(idleDaemons, constraint); + if (connection != null) { + return connection; + } + + // Check to see if there are any compatible canceled daemons and wait to see if one becomes idle + connection = connectToCanceledDaemon(busyDaemons, constraint); + if (connection != null) { + return connection; + } + + // No compatible daemons available - start a new daemon + handleStopEvents(idleDaemons, busyDaemons); + return startDaemon(constraint); + } + + private void handleStopEvents(Collection idleDaemons, Collection busyDaemons) { + final List stopEvents = daemonRegistry.getStopEvents(); + + // Clean up old stop events + daemonRegistry.removeStopEvents(DaemonStopEvents.oldStopEvents(stopEvents)); + + final List recentStopEvents = DaemonStopEvents.uniqueRecentDaemonStopEvents(stopEvents); + for (DaemonStopEvent stopEvent : recentStopEvents) { + Long pid = stopEvent.getPid(); + LOGGER.info("Previous Daemon (" + (pid == null ? "PID unknown" : pid) + ") stopped at " + stopEvent.getTimestamp() + " " + stopEvent.getReason()); + } + + LOGGER.lifecycle(DaemonStartupMessage.generate(busyDaemons.size(), idleDaemons.size(), recentStopEvents.size())); + } + + private DaemonClientConnection connectToIdleDaemon(Collection idleDaemons, ExplainingSpec constraint) { + final List compatibleIdleDaemons = getCompatibleDaemons(idleDaemons, constraint); + return findConnection(compatibleIdleDaemons); + } + + private DaemonClientConnection connectToCanceledDaemon(Collection busyDaemons, ExplainingSpec constraint) { + DaemonClientConnection connection = null; + final Pair, Collection> canceledBusy = partitionByState(busyDaemons, Canceled); + final Collection compatibleCanceledDaemons = getCompatibleDaemons(canceledBusy.getLeft(), constraint); + if (!compatibleCanceledDaemons.isEmpty()) { + LOGGER.info(DaemonMessages.WAITING_ON_CANCELED); + CountdownTimer timer = Time.startCountdownTimer(CANCELED_WAIT_TIMEOUT); + while (connection == null && !timer.hasExpired()) { + try { + sleep(200); + connection = connectToIdleDaemon(daemonRegistry.getIdle(), constraint); + } catch (InterruptedException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + } + return connection; + } + + private Pair, Collection> partitionByState(final Collection daemons, final DaemonStateControl.State state) { + return CollectionUtils.partition(daemons, new Spec() { + @Override + public boolean isSatisfiedBy(DaemonInfo daemonInfo) { + return daemonInfo.getState() == state; + } + }); + } + + private List getCompatibleDaemons(Iterable daemons, ExplainingSpec constraint) { + List compatibleDaemons = new LinkedList(); + for (DaemonInfo daemon : daemons) { + if (constraint.isSatisfiedBy(daemon.getContext())) { + compatibleDaemons.add(daemon); + } else { + LOGGER.info("Found daemon {} however its context does not match the desired criteria.\n" + + constraint.whyUnsatisfied(daemon.getContext()) + "\n" + + " Looking for a different daemon...", daemon); + } + } + return compatibleDaemons; + } + + private DaemonClientConnection findConnection(List compatibleDaemons) { + for (DaemonInfo daemon : compatibleDaemons) { + try { + return connectToDaemon(daemon, new CleanupOnStaleAddress(daemon, true)); + } catch (ConnectException e) { + LOGGER.debug("Cannot connect to daemon {} due to {}. Trying a different daemon...", daemon, e); + } + } + return null; + } + + @Override + public DaemonClientConnection startDaemon(ExplainingSpec constraint) { + return doStartDaemon(constraint, false); + } + + private DaemonClientConnection doStartDaemon(ExplainingSpec constraint, boolean singleRun) { + ProgressLogger progressLogger = progressLoggerFactory.newOperation(DefaultDaemonConnector.class) + .start("Starting Gradle Daemon", "Starting Daemon"); + final DaemonStartupInfo startupInfo = daemonStarter.startDaemon(singleRun); + LOGGER.debug("Started Gradle daemon {}", startupInfo); + CountdownTimer timer = Time.startCountdownTimer(connectTimeout); + try { + do { + DaemonClientConnection daemonConnection = connectToDaemonWithId(startupInfo, constraint); + if (daemonConnection != null) { + startListener.daemonStarted(daemonConnection.getDaemon()); + return daemonConnection; + } + try { + sleep(200L); + } catch (InterruptedException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } while (!timer.hasExpired()); + } finally { + progressLogger.completed(); + } + + throw new DaemonConnectionException("Timeout waiting to connect to the Gradle daemon.\n" + startupInfo.describe()); + } + + @Override + public DaemonClientConnection startSingleUseDaemon() { + return doStartDaemon(ExplainingSpecs.satisfyAll(), true); + } + + private DaemonClientConnection connectToDaemonWithId(DaemonStartupInfo daemon, ExplainingSpec constraint) throws ConnectException { + // Look for 'our' daemon among the busy daemons - a daemon will start in busy state so that nobody else will grab it. + for (DaemonInfo daemonInfo : daemonRegistry.getNotIdle()) { + if (daemonInfo.getUid().equals(daemon.getUid())) { + try { + if (!constraint.isSatisfiedBy(daemonInfo.getContext())) { + throw new DaemonConnectionException("The newly created daemon process has a different context than expected." + + "\nIt won't be possible to reconnect to this daemon. Context mismatch: " + + "\n" + constraint.whyUnsatisfied(daemonInfo.getContext())); + } + return connectToDaemon(daemonInfo, new CleanupOnStaleAddress(daemonInfo, false)); + } catch (ConnectException e) { + throw new DaemonConnectionException("Could not connect to the Gradle daemon.\n" + daemon.describe(), e); + } + } + } + return null; + } + + private DaemonClientConnection connectToDaemon(DaemonConnectDetails daemon, DaemonClientConnection.StaleAddressDetector staleAddressDetector) throws ConnectException { + ProgressLogger progressLogger = progressLoggerFactory.newOperation(DefaultDaemonConnector.class) + .start("Connecting to Gradle Daemon", "Connecting to Daemon"); + RemoteConnection connection; + try { + connection = connector.connect(daemon.getAddress()).create(Serializers.stateful(serializer)); + } catch (ConnectException e) { + staleAddressDetector.maybeStaleAddress(e); + throw e; + } finally { + progressLogger.completed(); + } + return new DaemonClientConnection(connection, daemon, staleAddressDetector); + } + + private void removeDaemonFromRegistry(DaemonConnectDetails daemon, String reason) { + LOGGER.info("{}{}", DaemonMessages.REMOVING_DAEMON_ADDRESS_ON_FAILURE, daemon); + final Date timestamp = new Date(System.currentTimeMillis()); + final DaemonStopEvent stopEvent = new DaemonStopEvent(timestamp, daemon.getPid(), null, reason); + daemonRegistry.storeStopEvent(stopEvent); + daemonRegistry.remove(daemon.getAddress()); + } + + private class CleanupOnStaleAddress implements DaemonClientConnection.StaleAddressDetector { + private final DaemonConnectDetails daemon; + private final boolean exposeAsStale; + + public CleanupOnStaleAddress(DaemonConnectDetails daemon, boolean exposeAsStale) { + this.daemon = daemon; + this.exposeAsStale = exposeAsStale; + } + + @Override + public boolean maybeStaleAddress(Exception failure) { + removeDaemonFromRegistry(daemon, "by user or operating system"); + return exposeAsStale; + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/launcher/daemon/client/NoUsableDaemonFoundException.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/launcher/daemon/client/NoUsableDaemonFoundException.java new file mode 100644 index 0000000..c1e712f --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/launcher/daemon/client/NoUsableDaemonFoundException.java @@ -0,0 +1,25 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.launcher.daemon.client; + +import org.gradle.internal.exceptions.DefaultMultiCauseException; + +public class NoUsableDaemonFoundException extends DefaultMultiCauseException { + public NoUsableDaemonFoundException(String message, Iterable causes) { + super(message, causes); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/launcher/daemon/client/SingleUseDaemonClient.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/launcher/daemon/client/SingleUseDaemonClient.java new file mode 100644 index 0000000..00e2ea7 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/launcher/daemon/client/SingleUseDaemonClient.java @@ -0,0 +1,56 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.launcher.daemon.client; + +import org.gradle.api.internal.DocumentationRegistry; +import org.gradle.api.internal.specs.ExplainingSpec; +import org.gradle.api.logging.Logger; +import org.gradle.api.logging.Logging; +import org.gradle.initialization.BuildRequestContext; +import org.gradle.internal.concurrent.ExecutorFactory; +import org.gradle.internal.id.IdGenerator; +import org.gradle.internal.invocation.BuildAction; +import org.gradle.internal.logging.events.OutputEventListener; +import org.gradle.internal.nativeintegration.ProcessEnvironment; +import org.gradle.launcher.daemon.context.DaemonContext; +import org.gradle.launcher.daemon.protocol.Build; +import org.gradle.launcher.exec.BuildActionParameters; +import org.gradle.launcher.exec.BuildActionResult; + +import java.io.InputStream; +import java.util.UUID; + +public class SingleUseDaemonClient extends DaemonClient { + public static final String MESSAGE = "To honour the JVM settings for this build a single-use Daemon process will be forked."; + private static final Logger LOGGER = Logging.getLogger(SingleUseDaemonClient.class); + private final DocumentationRegistry documentationRegistry; + + public SingleUseDaemonClient(DaemonConnector connector, OutputEventListener outputEventListener, ExplainingSpec compatibilitySpec, InputStream buildStandardInput, ExecutorFactory executorFactory, IdGenerator idGenerator, DocumentationRegistry documentationRegistry, ProcessEnvironment processEnvironment) { + super(connector, outputEventListener, compatibilitySpec, buildStandardInput, executorFactory, idGenerator, processEnvironment); + this.documentationRegistry = documentationRegistry; + } + + @Override + public BuildActionResult execute(BuildAction action, BuildActionParameters parameters, BuildRequestContext buildRequestContext) { + LOGGER.lifecycle(MESSAGE + " See {}.", documentationRegistry.getDocumentationFor("gradle_daemon", "sec:disabling_the_daemon")); + + DaemonClientConnection daemonConnection = getConnector().startSingleUseDaemon(); + Build build = new Build(getIdGenerator().generateId(), daemonConnection.getDaemon().getToken(), action, buildRequestContext.getClient(), buildRequestContext.getStartTime(), buildRequestContext.isInteractive(), parameters); + + return executeBuild(build, daemonConnection, buildRequestContext.getCancellationToken(), buildRequestContext.getEventConsumer()); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/launcher/daemon/protocol/Build.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/launcher/daemon/protocol/Build.java new file mode 100644 index 0000000..a5701d1 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/launcher/daemon/protocol/Build.java @@ -0,0 +1,73 @@ +/* + * Copyright 2010 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.launcher.daemon.protocol; + +import org.gradle.initialization.BuildClientMetaData; +import org.gradle.initialization.BuildRequestMetaData; +import org.gradle.initialization.DefaultBuildRequestMetaData; +import org.gradle.internal.invocation.BuildAction; +import org.gradle.launcher.exec.BuildActionParameters; + +import java.util.UUID; + +public class Build extends Command { + private final BuildAction action; + private final BuildClientMetaData buildClientMetaData; + private final long startTime; + private final boolean interactive; + private final BuildActionParameters parameters; + + public Build(UUID identifier, byte[] token, BuildAction action, BuildClientMetaData buildClientMetaData, long startTime, boolean interactive, BuildActionParameters parameters) { + super(identifier, token); + this.action = action; + this.buildClientMetaData = buildClientMetaData; + this.startTime = startTime; + this.interactive = interactive; + this.parameters = parameters; + } + + public long getStartTime() { + return startTime; + } + + public boolean isInteractive() { + return interactive; + } + + public BuildClientMetaData getBuildClientMetaData() { + return buildClientMetaData; + } + + public BuildRequestMetaData getBuildRequestMetaData() { + return new DefaultBuildRequestMetaData(buildClientMetaData, startTime, interactive); + } + + public BuildAction getAction() { + return action; + } + + public BuildActionParameters getParameters() { + return parameters; + } + + @Override + public String toString() { + return getClass().getSimpleName() + "{" + + "id=" + getIdentifier() + + ", currentDir=" + parameters.getCurrentDir() + + '}'; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/launcher/daemon/server/exec/ReturnResult.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/launcher/daemon/server/exec/ReturnResult.java new file mode 100644 index 0000000..e52b88f --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/launcher/daemon/server/exec/ReturnResult.java @@ -0,0 +1,44 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.launcher.daemon.server.exec; + +import org.gradle.api.logging.Logger; +import org.gradle.api.logging.Logging; +import org.gradle.launcher.daemon.protocol.Result; +import org.gradle.launcher.daemon.protocol.Success; +import org.gradle.launcher.daemon.server.api.DaemonCommandAction; +import org.gradle.launcher.daemon.server.api.DaemonCommandExecution; + +/** + * Handles sending the result of the execution back to the client. + * + * Likely to be the first thing in the pipeline. + */ +public class ReturnResult implements DaemonCommandAction { + + private static final Logger LOGGER = Logging.getLogger(ReturnResult.class); + + @Override + public void execute(DaemonCommandExecution execution) { + execution.proceed(); + + Result result = new Success(execution.getResult()); + + LOGGER.debug("Daemon is dispatching the build result: {}", result); + execution.getConnection().completed(result); + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/tooling/internal/provider/FailsafePhasedActionResultListener.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/tooling/internal/provider/FailsafePhasedActionResultListener.java new file mode 100644 index 0000000..8ed09f4 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/tooling/internal/provider/FailsafePhasedActionResultListener.java @@ -0,0 +1,51 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.provider; + +import org.gradle.internal.event.ListenerNotificationException; +import org.gradle.tooling.internal.protocol.PhasedActionResult; +import org.gradle.tooling.internal.protocol.PhasedActionResultListener; + +import java.util.ArrayList; +import java.util.List; + +/** + * Listener that will collect failures from the delegate listener and rethrow them in the right moment of the build. + */ +public class FailsafePhasedActionResultListener implements PhasedActionResultListener { + private final PhasedActionResultListener delegate; + private List listenerFailures = new ArrayList(); + + public FailsafePhasedActionResultListener(PhasedActionResultListener delegate) { + this.delegate = delegate; + } + + @Override + public void onResult(PhasedActionResult event) { + try { + delegate.onResult(event); + } catch (Throwable t) { + listenerFailures.add(t); + } + } + + public void rethrowErrors() { + if (!listenerFailures.isEmpty()) { + throw new ListenerNotificationException(null, "One or more build phasedAction listeners failed with an exception.", listenerFailures); + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/tooling/internal/provider/connection/ProviderConnectionParameters.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/tooling/internal/provider/connection/ProviderConnectionParameters.java new file mode 100644 index 0000000..4a3bf7b --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/tooling/internal/provider/connection/ProviderConnectionParameters.java @@ -0,0 +1,29 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.provider.connection; + +import javax.annotation.Nullable; +import java.io.File; + +public interface ProviderConnectionParameters { + boolean getVerboseLogging(); + + String getConsumerVersion(); + + @Nullable + File getGradleUserHomeDir(File defaultValue); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/tooling/internal/provider/serialization/PayloadClassLoaderFactory.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/tooling/internal/provider/serialization/PayloadClassLoaderFactory.java new file mode 100644 index 0000000..34d4e9a --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/launcher/org/gradle/tooling/internal/provider/serialization/PayloadClassLoaderFactory.java @@ -0,0 +1,30 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.provider.serialization; + +import org.gradle.internal.classloader.ClassLoaderSpec; + +import java.util.List; + +/** + * Used to create ClassLoaders used to serialize objects between the tooling api provider and daemon. + * + *

Implementations are not required to be thread-safe.

+ */ +public interface PayloadClassLoaderFactory { + ClassLoader getClassLoaderFor(ClassLoaderSpec spec, List parents); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/logging/org/gradle/internal/logging/LoggingManagerInternal.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/logging/org/gradle/internal/logging/LoggingManagerInternal.java new file mode 100644 index 0000000..e256767 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/logging/org/gradle/internal/logging/LoggingManagerInternal.java @@ -0,0 +1,65 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.internal.logging; + +import org.gradle.api.logging.LogLevel; +import org.gradle.api.logging.LoggingManager; +import org.gradle.api.logging.StandardOutputListener; + +/** + * Provides access to and control over the logging system. Log manager represents some 'scope', and log managers can be nested in a stack. + */ +public interface LoggingManagerInternal extends LoggingManager, StandardOutputCapture, LoggingOutputInternal { + /** + * Makes this log manager active, replacing the currently active log manager, if any. Applies any settings defined by this log manager. Initialises the logging system when there is no log manager currently active. + * + *

While a log manager is active, any changes made to the settings will take effect immediately. When a log manager is not active, changes to its settings will apply only once it is made active by calling {@link #start()}.

+ */ + @Override + LoggingManagerInternal start(); + + /** + * Stops logging, restoring the log manger that was active when {@link #start()} was called on this manager. Shuts down the logging system when there was no log manager active prior to starting this one. + */ + @Override + LoggingManagerInternal stop(); + + /** + * Consumes logging from System.out and System.err and Java util logging. + */ + LoggingManagerInternal captureSystemSources(); + + /** + * Sets the log level to capture stdout at. Does not enable capture. + */ + @Override + LoggingManagerInternal captureStandardOutput(LogLevel level); + + /** + * Sets the log level to capture stderr at. Does not enable capture. + */ + @Override + LoggingManagerInternal captureStandardError(LogLevel level); + + LoggingManagerInternal setLevelInternal(LogLevel logLevel); + + /** + * Allows {@link org.gradle.api.logging.LoggingOutput#addStandardOutputListener(StandardOutputListener)} and {@link org.gradle.api.logging.LoggingOutput#addStandardErrorListener(StandardOutputListener)} to be used. + * + *

This should be used only when custom user listeners are required, i.e. only in the build JVM around the build execution. + */ + LoggingManagerInternal enableUserStandardOutputListeners(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/logging/org/gradle/internal/logging/console/AnsiContext.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/logging/org/gradle/internal/logging/console/AnsiContext.java new file mode 100644 index 0000000..bb5e754 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/logging/org/gradle/internal/logging/console/AnsiContext.java @@ -0,0 +1,85 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.logging.console; + +import org.gradle.api.Action; +import org.gradle.internal.logging.text.Style; +import org.gradle.internal.logging.text.StyledTextOutput; + +public interface AnsiContext { + /** + * Change the ANSI color before executing the specified action. The color is reverted back after the action is executed. + * + * @param color the color to use + * @param action the action to execute on ANSI with the specified color + * @return the current context + */ + AnsiContext withColor(ColorMap.Color color, Action action); + + /** + * Change the ANSI style before executing the specified action. The style is reverted back after the action is executed. + * + * @param style the style to use + * @param action the action to execute on ANSI with the specified style + * @return the current context + */ + AnsiContext withStyle(Style style, Action action); + + /** + * Change the ANSI style before executing the specified action. The style is reverted back after the action is executed. + * + * @param style the style to use + * @param action the action to execute on ANSI with the specified style + * @return the current context + */ + AnsiContext withStyle(StyledTextOutput.Style style, Action action); + + /** + * @return the current context with the specified text written. + */ + AnsiContext a(CharSequence value); + + /** + * @return the current context with a new line written. + */ + AnsiContext newLine(); + + /** + * @return the current context with the specified new line written. + */ + AnsiContext newLines(int numberOfNewLines); + + /** + * @return the current context with the characters moving forward from the write position erased. + */ + AnsiContext eraseForward(); + + /** + * @return the current context with the entire line erased. + */ + AnsiContext eraseAll(); + + /** + * @return the current context moved to the specified position. + */ + AnsiContext cursorAt(Cursor cursor); + + /** + * @return a new context at the specified write position. + */ + AnsiContext writeAt(Cursor writePos); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/logging/org/gradle/internal/logging/console/DefaultWorkInProgressFormatter.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/logging/org/gradle/internal/logging/console/DefaultWorkInProgressFormatter.java new file mode 100644 index 0000000..3210dd8 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/logging/org/gradle/internal/logging/console/DefaultWorkInProgressFormatter.java @@ -0,0 +1,76 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.logging.console; + +import org.gradle.internal.logging.events.StyledTextOutputEvent; +import org.gradle.internal.logging.text.StyledTextOutput; +import org.gradle.internal.nativeintegration.console.ConsoleMetaData; + +import java.util.Collections; +import java.util.List; + +public class DefaultWorkInProgressFormatter { + private final static List IDLE_SPANS = Collections.singletonList(new StyledTextOutputEvent.Span("> IDLE")); + private final ConsoleMetaData consoleMetaData; + + public DefaultWorkInProgressFormatter(ConsoleMetaData consoleMetaData) { + this.consoleMetaData = consoleMetaData; + } + + public List format(ProgressOperation op) { + StringBuilder builder = new StringBuilder(); + ProgressOperation current = op; + while (current != null && !"org.gradle.internal.progress.BuildProgressLogger".equals(current.getCategory())) { + String message = current.getMessage(); + current = current.getParent(); + + if (message == null) { + continue; + } + + builder.insert(0, " > ").insert(3, message); + } + if (builder.length() > 0) { + builder.delete(0, 1); + } else { + return IDLE_SPANS; + } + + return Collections.singletonList(new StyledTextOutputEvent.Span(StyledTextOutput.Style.Header, trim(builder))); + } + + public List format() { + return IDLE_SPANS; + } + + private String trim(StringBuilder formattedString) { + // Don't write to the right-most column, as on some consoles the cursor will wrap to the next line and currently wrapping causes + // layout weirdness + int maxWidth; + if (consoleMetaData.getCols() > 0) { + maxWidth = consoleMetaData.getCols() - 1; + } else { + // Assume 80 wide. This is to minimize wrapping on console where we don't know the width (eg mintty) + // It's not intended to be a correct solution, simply a work around + maxWidth = 79; + } + if (maxWidth < formattedString.length()) { + return formattedString.substring(0, maxWidth); + } + return formattedString.toString(); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/logging/org/gradle/internal/logging/console/UserInputStandardOutputRenderer.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/logging/org/gradle/internal/logging/console/UserInputStandardOutputRenderer.java new file mode 100644 index 0000000..1ac6b09 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/logging/org/gradle/internal/logging/console/UserInputStandardOutputRenderer.java @@ -0,0 +1,39 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.logging.console; + +import org.gradle.internal.logging.events.OutputEventListener; +import org.gradle.internal.logging.events.PromptOutputEvent; + +public class UserInputStandardOutputRenderer extends AbstractUserInputRenderer { + public UserInputStandardOutputRenderer(OutputEventListener delegate) { + super(delegate); + } + + @Override + void startInput() { + } + + @Override + void handlePrompt(PromptOutputEvent event) { + delegate.onOutput(event); + } + + @Override + void finishInput() { + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/logging/org/gradle/internal/logging/events/LogEvent.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/logging/org/gradle/internal/logging/events/LogEvent.java new file mode 100644 index 0000000..f22ec2c --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/logging/org/gradle/internal/logging/events/LogEvent.java @@ -0,0 +1,71 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.logging.events; + +import org.gradle.api.logging.LogLevel; +import org.gradle.internal.logging.events.operations.LogEventBuildOperationProgressDetails; +import org.gradle.internal.logging.text.StyledTextOutput; +import org.gradle.internal.operations.OperationIdentifier; +import org.gradle.internal.scan.UsedByScanPlugin; + +import javax.annotation.Nullable; + +@UsedByScanPlugin +public class LogEvent extends RenderableOutputEvent implements LogEventBuildOperationProgressDetails { + private final String message; + private final Throwable throwable; + + public LogEvent(long timestamp, String category, LogLevel logLevel, String message, @Nullable Throwable throwable) { + this(timestamp, category, logLevel, message, throwable, null); + } + + public LogEvent(long timestamp, String category, LogLevel logLevel, String message, @Nullable Throwable throwable, @Nullable OperationIdentifier buildOperationIdentifier) { + super(timestamp, category, logLevel, buildOperationIdentifier); + this.message = message; + this.throwable = throwable; + } + + @Override + public String getMessage() { + return message; + } + + @Override + @Nullable + public Throwable getThrowable() { + return throwable; + } + + @Override + public void render(StyledTextOutput output) { + output.text(message); + output.println(); + if (throwable != null) { + output.exception(throwable); + } + } + + @Override + public String toString() { + return "[" + getLogLevel() + "] [" + getCategory() + "] " + message; + } + + @Override + public RenderableOutputEvent withBuildOperationId(OperationIdentifier buildOperationId) { + return new LogEvent(getTimestamp(), getCategory(), getLogLevel(), message, throwable, buildOperationId); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/logging/org/gradle/internal/logging/services/LoggingServiceRegistry.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/logging/org/gradle/internal/logging/services/LoggingServiceRegistry.java new file mode 100644 index 0000000..9e0ebd6 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/logging/org/gradle/internal/logging/services/LoggingServiceRegistry.java @@ -0,0 +1,174 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.logging.services; + +import org.gradle.api.logging.LogLevel; +import org.gradle.internal.logging.LoggingManagerInternal; +import org.gradle.internal.logging.config.LoggingSourceSystem; +import org.gradle.internal.logging.config.LoggingSystemAdapter; +import org.gradle.internal.logging.events.OutputEventListener; +import org.gradle.internal.logging.sink.OutputEventListenerManager; +import org.gradle.internal.logging.sink.OutputEventRenderer; +import org.gradle.internal.logging.slf4j.Slf4jLoggingConfigurer; +import org.gradle.internal.logging.source.DefaultStdErrLoggingSystem; +import org.gradle.internal.logging.source.DefaultStdOutLoggingSystem; +import org.gradle.internal.logging.source.JavaUtilLoggingSystem; +import org.gradle.internal.logging.source.NoOpLoggingSystem; +import org.gradle.internal.logging.text.StyledTextOutputFactory; +import org.gradle.internal.service.DefaultServiceRegistry; +import org.gradle.internal.time.Clock; +import org.gradle.internal.time.Time; + +/** + * A {@link org.gradle.internal.service.ServiceRegistry} implementation that provides the logging services. To use this: + * + *

    + *
  1. Create an instance using one of the static factory methods below.
  2. + *
  3. Create an instance of {@link LoggingManagerInternal}.
  4. + *
  5. Configure the logging manager as appropriate.
  6. + *
  7. Start the logging manager using {@link LoggingManagerInternal#start()}.
  8. + *
  9. When finished, stop the logging manager using {@link LoggingManagerInternal#stop()}.
  10. + *
+ */ +public abstract class LoggingServiceRegistry extends DefaultServiceRegistry { + + public static final Object NO_OP = new Object() { + OutputEventListener createOutputEventListener() { + return OutputEventListener.NO_OP; + } + }; + + private TextStreamOutputEventListener stdoutListener; + + protected final OutputEventRenderer renderer = makeOutputEventRenderer(); + protected final OutputEventListenerManager outputEventListenerManager = new OutputEventListenerManager(renderer); + + /** + * Creates a set of logging services which are suitable to use globally in a process. In particular: + * + *
    + *
  • Replaces System.out and System.err with implementations that route output through the logging system as per {@link LoggingManagerInternal#captureSystemSources()}.
  • + *
  • Configures slf4j, log4j and java util logging to route log messages through the logging system.
  • + *
  • Routes logging output to the original System.out and System.err as per {@link LoggingManagerInternal#attachSystemOutAndErr()}.
  • + *
  • Sets log level to {@link org.gradle.api.logging.LogLevel#LIFECYCLE}.
  • + *
+ * + *

Does nothing until started.

+ * + *

Allows dynamic and colored output to be written to the console. Use {@link LoggingManagerInternal#attachProcessConsole(org.gradle.api.logging.configuration.ConsoleOutput)} to enable this.

+ */ + public static LoggingServiceRegistry newCommandLineProcessLogging() { + CommandLineLogging loggingServices = new CommandLineLogging(); + LoggingManagerInternal rootLoggingManager = loggingServices.get(DefaultLoggingManagerFactory.class).getRoot(); + rootLoggingManager.captureSystemSources(); + rootLoggingManager.attachSystemOutAndErr(); + return loggingServices; + } + + /** + * Creates a set of logging services which are suitable to use embedded in another application. In particular: + * + *
    + *
  • Configures slf4j and log4j to route log messages through the logging system.
  • + *
  • Sets log level to {@link org.gradle.api.logging.LogLevel#LIFECYCLE}.
  • + *
+ * + *

Does not:

+ * + *
    + *
  • Replace System.out and System.err to capture output written to these destinations. Use {@link LoggingManagerInternal#captureSystemSources()} to enable this.
  • + *
  • Configure java util logging. Use {@link LoggingManagerInternal#captureSystemSources()} to enable this.
  • + *
  • Route logging output to the original System.out and System.err. Use {@link LoggingManagerInternal#attachSystemOutAndErr()} to enable this.
  • + *
+ * + *

Does nothing until started.

+ */ + public static LoggingServiceRegistry newEmbeddableLogging() { + return new CommandLineLogging(); + } + + /** + * Creates a set of logging services to set up a new logging scope that does nothing by default. The methods on {@link LoggingManagerInternal} can be used to configure the + * logging services do useful things. + * + *

Sets log level to {@link org.gradle.api.logging.LogLevel#LIFECYCLE}.

+ */ + public static LoggingServiceRegistry newNestedLogging() { + return new NestedLogging(); + } + + protected Clock createTimeProvider() { + return Time.clock(); + } + + protected StyledTextOutputFactory createStyledTextOutputFactory() { + return new DefaultStyledTextOutputFactory(getStdoutListener(), get(Clock.class)); + } + + protected TextStreamOutputEventListener getStdoutListener() { + if (stdoutListener == null) { + stdoutListener = new TextStreamOutputEventListener(get(OutputEventListenerManager.class).getBroadcaster()); + } + return stdoutListener; + } + + protected DefaultLoggingManagerFactory createLoggingManagerFactory() { + OutputEventListener outputEventBroadcaster = outputEventListenerManager.getBroadcaster(); + + LoggingSourceSystem stdout = new DefaultStdOutLoggingSystem(getStdoutListener(), get(Clock.class)); + stdout.setLevel(LogLevel.QUIET); + LoggingSourceSystem stderr = new DefaultStdErrLoggingSystem(new TextStreamOutputEventListener(outputEventBroadcaster), get(Clock.class)); + stderr.setLevel(LogLevel.ERROR); + return new DefaultLoggingManagerFactory( + renderer, + new LoggingSystemAdapter(new Slf4jLoggingConfigurer(outputEventBroadcaster)), + new JavaUtilLoggingSystem(), + stdout, + stderr); + } + + protected OutputEventListener createOutputEventListener(OutputEventListenerManager manager) { + return manager.getBroadcaster(); + } + + protected OutputEventListenerManager createOutputEventListenerManager() { + return outputEventListenerManager; + } + + // Intentionally not a “create” method as this should not be exposed as a service + protected OutputEventRenderer makeOutputEventRenderer() { + return new OutputEventRenderer(Time.clock()); + } + + private static class CommandLineLogging extends LoggingServiceRegistry { + } + + private static class NestedLogging extends LoggingServiceRegistry { + + @Override + protected DefaultLoggingManagerFactory createLoggingManagerFactory() { + // Don't configure anything + return new DefaultLoggingManagerFactory( + renderer, + new NoOpLoggingSystem(), + new NoOpLoggingSystem(), + new NoOpLoggingSystem(), + new NoOpLoggingSystem() + ); + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/logging/org/gradle/internal/logging/text/LinePrefixingStyledTextOutput.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/logging/org/gradle/internal/logging/text/LinePrefixingStyledTextOutput.java new file mode 100644 index 0000000..f689e4f --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/logging/org/gradle/internal/logging/text/LinePrefixingStyledTextOutput.java @@ -0,0 +1,61 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.logging.text; + +/** + * A {@link StyledTextOutput} which prefixes each line of text with some fixed prefix. Does not prefix the first line. + */ +public class LinePrefixingStyledTextOutput extends AbstractLineChoppingStyledTextOutput { + private final StyledTextOutput output; + private final CharSequence prefix; + private boolean prefixFirstLine; + private boolean prefixed; + + public LinePrefixingStyledTextOutput(StyledTextOutput output, CharSequence prefix) { + this(output, prefix, true); + } + + public LinePrefixingStyledTextOutput(StyledTextOutput output, CharSequence prefix, boolean prefixFirstLine) { + this.output = output; + this.prefix = prefix; + this.prefixFirstLine = prefixFirstLine; + } + + @Override + protected void doLineText(CharSequence text) { + if (!prefixed && prefixFirstLine) { + output.text(prefix); + prefixed = true; + } + output.text(text); + } + + @Override + protected void doEndLine(CharSequence endOfLine) { + output.text(endOfLine); + } + + @Override + protected void doStartLine() { + output.text(prefix); + } + + @Override + protected void doStyleChange(Style style) { + output.style(style); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/maven/org/gradle/api/publish/maven/MavenPomIssueManagement.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/maven/org/gradle/api/publish/maven/MavenPomIssueManagement.java new file mode 100644 index 0000000..4c9ca70 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/maven/org/gradle/api/publish/maven/MavenPomIssueManagement.java @@ -0,0 +1,39 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.publish.maven; + +import org.gradle.api.provider.Property; + +/** + * The issue management system of a Maven publication. + * + * @since 4.8 + * @see MavenPom + */ +public interface MavenPomIssueManagement { + + /** + * The name of this issue management system. + */ + Property getSystem(); + + /** + * The URL of this issue management system. + */ + Property getUrl(); + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/maven/org/gradle/api/publish/maven/MavenPomLicenseSpec.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/maven/org/gradle/api/publish/maven/MavenPomLicenseSpec.java new file mode 100644 index 0000000..a3c4cdf --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/maven/org/gradle/api/publish/maven/MavenPomLicenseSpec.java @@ -0,0 +1,35 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.publish.maven; + +import org.gradle.api.Action; + +/** + * Allows to add licenses to a Maven publication. + * + * @since 4.8 + * @see MavenPom + * @see MavenPomLicense + */ +public interface MavenPomLicenseSpec { + + /** + * Creates, configures and adds a license to the publication. + */ + void license(Action action); + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/maven/org/gradle/api/publish/maven/internal/artifact/SingleOutputTaskMavenArtifact.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/maven/org/gradle/api/publish/maven/internal/artifact/SingleOutputTaskMavenArtifact.java new file mode 100644 index 0000000..09028ea --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/maven/org/gradle/api/publish/maven/internal/artifact/SingleOutputTaskMavenArtifact.java @@ -0,0 +1,79 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.publish.maven.internal.artifact; + +import org.gradle.api.Task; +import org.gradle.api.internal.tasks.AbstractTaskDependency; +import org.gradle.api.internal.tasks.TaskDependencyInternal; +import org.gradle.api.internal.tasks.TaskDependencyResolveContext; +import org.gradle.api.tasks.TaskProvider; + +import java.io.File; + +public class SingleOutputTaskMavenArtifact extends AbstractMavenArtifact { + private final TaskProvider generator; + private final String extension; + private final String classifier; + private final TaskDependencyInternal buildDependencies; + + public SingleOutputTaskMavenArtifact(TaskProvider generator, String extension, String classifier) { + this.generator = generator; + this.extension = extension; + this.classifier = classifier; + this.buildDependencies = new GeneratorTaskDependency(); + } + + @Override + public File getFile() { + return getGenerator().getOutputs().getFiles().getSingleFile(); + } + + private Task getGenerator() { + return generator.get(); + } + + @Override + protected String getDefaultExtension() { + return extension; + } + + @Override + protected String getDefaultClassifier() { + return classifier; + } + + @Override + protected TaskDependencyInternal getDefaultBuildDependencies() { + return buildDependencies; + } + + public boolean isEnabled() { + return getGenerator().getEnabled(); + } + + private class GeneratorTaskDependency extends AbstractTaskDependency { + @Override + public void visitDependencies(TaskDependencyResolveContext context) { + context.add(getGenerator()); + } + } + + @Override + public boolean shouldBePublished() { + return isEnabled(); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/maven/org/gradle/api/publish/maven/internal/publication/MavenPublicationInternal.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/maven/org/gradle/api/publish/maven/internal/publication/MavenPublicationInternal.java new file mode 100644 index 0000000..729dc5d --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/maven/org/gradle/api/publish/maven/internal/publication/MavenPublicationInternal.java @@ -0,0 +1,72 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.publish.maven.internal.publication; + +import org.gradle.api.Task; +import org.gradle.api.publish.internal.PublicationInternal; +import org.gradle.api.publish.internal.versionmapping.VersionMappingStrategyInternal; +import org.gradle.api.publish.maven.MavenArtifact; +import org.gradle.api.publish.maven.MavenDependency; +import org.gradle.api.publish.maven.MavenPublication; +import org.gradle.api.publish.maven.internal.dependencies.MavenDependencyInternal; +import org.gradle.api.publish.maven.internal.publisher.MavenNormalizedPublication; +import org.gradle.api.publish.maven.internal.publisher.MutableMavenProjectIdentity; +import org.gradle.api.tasks.TaskProvider; + +import java.util.Set; + +public interface MavenPublicationInternal extends MavenPublication, PublicationInternal { + + @Override + MavenPomInternal getPom(); + + void setPomGenerator(TaskProvider pomGenerator); + + void setModuleDescriptorGenerator(TaskProvider moduleMetadataGenerator); + + MutableMavenProjectIdentity getMavenProjectIdentity(); + + Set getApiDependencyConstraints(); + + Set getRuntimeDependencyConstraints(); + + Set getImportDependencyConstraints(); + + Set getApiDependencies(); + + Set getRuntimeDependencies(); + + Set getOptionalDependencies(); + + MavenNormalizedPublication asNormalisedPublication(); + + // TODO Remove this attempt to guess packaging from artifacts. Packaging should come from component, or be explicitly set. + String determinePackagingFromArtifacts(); + + /** + * Some components (e.g. Native) are published such that the module metadata references the original file name, + * rather than the Maven-standard {artifactId}-{version}-{classifier}.{extension}. + * This method enables this behaviour for the current publication. + */ + void publishWithOriginalFileName(); + + @Override + VersionMappingStrategyInternal getVersionMappingStrategy(); + + boolean writeGradleMetadataMarker(); +} + diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/maven/org/gradle/maven/package-info.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/maven/org/gradle/maven/package-info.java new file mode 100644 index 0000000..cc8046a --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/maven/org/gradle/maven/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Component types for Maven modules. + */ +package org.gradle.maven; diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/messaging/org/gradle/internal/serialize/PlaceholderAssertionError.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/messaging/org/gradle/internal/serialize/PlaceholderAssertionError.java new file mode 100644 index 0000000..b11b587 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/messaging/org/gradle/internal/serialize/PlaceholderAssertionError.java @@ -0,0 +1,65 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.serialize; + +import org.gradle.internal.UncheckedException; + +import javax.annotation.Nullable; + +/** + * A {@code PlaceholderException} is used when an assertion error cannot be serialized or deserialized. + */ +public class PlaceholderAssertionError extends AssertionError implements PlaceholderExceptionSupport { + private final String exceptionClassName; + private final Throwable getMessageException; + private final String toString; + private final Throwable toStringRuntimeEx; + + public PlaceholderAssertionError(String exceptionClassName, + @Nullable String message, + @Nullable Throwable getMessageException, + @Nullable String toString, + @Nullable Throwable toStringException, + @Nullable Throwable cause) { + super(message); + this.exceptionClassName = exceptionClassName; + this.getMessageException = getMessageException; + this.toString = toString; + this.toStringRuntimeEx = toStringException; + initCause(cause); + } + + @Override + public String getExceptionClassName() { + return exceptionClassName; + } + + @Override + public String getMessage() { + if (getMessageException != null) { + throw UncheckedException.throwAsUncheckedException(getMessageException); + } + return super.getMessage(); + } + + public String toString() { + if (toStringRuntimeEx != null) { + throw UncheckedException.throwAsUncheckedException(toStringRuntimeEx); + } + return toString; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/api/internal/provider/ConfigurationTimeBarrier.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/api/internal/provider/ConfigurationTimeBarrier.java new file mode 100644 index 0000000..f224f9f --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/api/internal/provider/ConfigurationTimeBarrier.java @@ -0,0 +1,25 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.provider; + +import org.gradle.internal.service.scopes.Scopes; +import org.gradle.internal.service.scopes.ServiceScope; + +@ServiceScope(Scopes.BuildTree.class) +public interface ConfigurationTimeBarrier { + boolean isAtConfigurationTime(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/api/internal/provider/DefaultListProperty.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/api/internal/provider/DefaultListProperty.java new file mode 100644 index 0000000..cb099f9 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/api/internal/provider/DefaultListProperty.java @@ -0,0 +1,84 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.provider; + +import com.google.common.collect.ImmutableCollection; +import com.google.common.collect.ImmutableList; +import org.gradle.api.provider.ListProperty; +import org.gradle.api.provider.Provider; +import org.gradle.internal.Cast; + +import javax.annotation.Nullable; +import java.util.List; +import java.util.function.Supplier; + +public class DefaultListProperty extends AbstractCollectionProperty> implements ListProperty { + private static final Supplier> FACTORY = new Supplier>() { + @Override + public ImmutableCollection.Builder get() { + return ImmutableList.builder(); + } + }; + public DefaultListProperty(PropertyHost host, Class elementType) { + super(host, List.class, elementType, Cast.uncheckedNonnullCast(FACTORY)); + } + + @Override + public Class publicType() { + return ListProperty.class; + } + + @Override + public int getFactoryId() { + return ManagedFactories.ListPropertyManagedFactory.FACTORY_ID; + } + + @Override + protected ImmutableList emptyCollection() { + return ImmutableList.of(); + } + + @Override + public ListProperty empty() { + super.empty(); + return this; + } + + @Override + public ListProperty value(@Nullable Iterable elements) { + super.value(elements); + return this; + } + + @Override + public ListProperty value(Provider> provider) { + super.value(provider); + return this; + } + + @Override + public ListProperty convention(Iterable elements) { + super.convention(elements); + return this; + } + + @Override + public ListProperty convention(Provider> provider) { + super.convention(provider); + return this; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/internal/snapshot/impl/AbstractListSnapshot.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/internal/snapshot/impl/AbstractListSnapshot.java new file mode 100644 index 0000000..bdffd90 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/internal/snapshot/impl/AbstractListSnapshot.java @@ -0,0 +1,61 @@ +/* + * Copyright 2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.snapshot.impl; + +import com.google.common.collect.ImmutableList; +import org.gradle.internal.hash.Hashable; +import org.gradle.internal.hash.Hasher; + +import java.util.List; + +class AbstractListSnapshot implements Hashable { + protected final ImmutableList elements; + + public AbstractListSnapshot(ImmutableList elements) { + this.elements = elements; + } + + public List getElements() { + return elements; + } + + @Override + public void appendToHasher(Hasher hasher) { + hasher.putString("List"); + hasher.putInt(elements.size()); + for (T element : elements) { + element.appendToHasher(hasher); + } + } + + @Override + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (obj == null || obj.getClass() != getClass()) { + return false; + } + AbstractListSnapshot other = (AbstractListSnapshot) obj; + return elements.equals(other.elements); + } + + @Override + public int hashCode() { + return elements.hashCode(); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/core/ModelNodes.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/core/ModelNodes.java new file mode 100644 index 0000000..f47a919 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/core/ModelNodes.java @@ -0,0 +1,49 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.model.internal.core; + +import com.google.common.base.Predicate; +import com.google.common.base.Predicates; +import org.gradle.model.internal.type.ModelType; + +public class ModelNodes { + public static Predicate all() { + return Predicates.alwaysTrue(); + } + + public static Predicate withType(Class type) { + return withType(ModelType.of(type)); + } + + public static Predicate withType(final ModelType type) { + return withType(type, Predicates.alwaysTrue()); + } + + public static Predicate withType(Class type, Predicate predicate) { + return withType(ModelType.of(type), predicate); + } + + public static Predicate withType(final ModelType type, final Predicate predicate) { + return new Predicate() { + @Override + public boolean apply(MutableModelNode node) { + node.ensureAtLeast(ModelNode.State.Discovered); + return node.canBeViewedAs(type) && predicate.apply(node); + } + }; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/core/ModelPredicate.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/core/ModelPredicate.java new file mode 100644 index 0000000..417ca2a --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/core/ModelPredicate.java @@ -0,0 +1,56 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.model.internal.core; + +import javax.annotation.Nullable; + +/** + * A predicate that selects model nodes. + * + *

Defines a fixed set of criteria that a model node must match. A node is only selected when it matches all non-null criteria.

+ */ +public abstract class ModelPredicate { + /** + * Returns the path of the node to select, or null if path is not relevant. + * + *

A node will be selected if its path equals the specified path. + */ + @Nullable + public ModelPath getPath() { + return null; + } + + /** + * Returns the parent path of the nodes to select, or null if parent is not relevant. + * + *

A node will be selected if its parent's path equals the specified path. + */ + @Nullable + public ModelPath getParent() { + return null; + } + + /** + * Return the path of the scope of the nodes to select, or null if ancestor is not relevant. + * + *

A node will be selected if its path or one of its ancestor's path equals the specified path.

+ */ + @Nullable + public ModelPath getAncestor() { + return null; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/inspect/ManagedModelCreationRuleExtractor.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/inspect/ManagedModelCreationRuleExtractor.java new file mode 100644 index 0000000..78bd7dc --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/inspect/ManagedModelCreationRuleExtractor.java @@ -0,0 +1,122 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.model.internal.inspect; + +import org.gradle.internal.BiAction; +import org.gradle.model.InvalidModelRuleDeclarationException; +import org.gradle.model.internal.core.*; +import org.gradle.model.internal.core.rule.describe.ModelRuleDescriptor; +import org.gradle.model.internal.manage.schema.ModelSchema; +import org.gradle.model.internal.manage.schema.ModelSchemaStore; +import org.gradle.model.internal.manage.schema.SpecializedMapSchema; +import org.gradle.model.internal.manage.schema.extract.InvalidManagedModelElementTypeException; +import org.gradle.model.internal.manage.schema.extract.SpecializedMapNodeInitializer; +import org.gradle.model.internal.type.ModelType; + +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import static org.gradle.model.internal.core.NodeInitializerContext.forType; + +public class ManagedModelCreationRuleExtractor extends AbstractModelCreationRuleExtractor { + private static final ModelType NODE_INITIALIZER_REGISTRY = ModelType.of(NodeInitializerRegistry.class); + + private final ModelSchemaStore schemaStore; + + public ManagedModelCreationRuleExtractor(ModelSchemaStore schemaStore) { + this.schemaStore = schemaStore; + } + + @Override + public String getDescription() { + return String.format("%s and taking a managed model element", super.getDescription()); + } + + @Override + public boolean isSatisfiedBy(MethodRuleDefinition element) { + return super.isSatisfiedBy(element) && isVoidMethod(element); + } + + @Override + protected void validateMethod(MethodRuleDefinition ruleDefinition, MethodModelRuleExtractionContext context) { + if (ruleDefinition.getReferences().isEmpty()) { + context.add(ruleDefinition, "A method annotated with @Model must either take at least one parameter or have a non-void return type"); + } + } + + @Override + protected ExtractedModelRule buildRule(ModelPath modelPath, MethodRuleDefinition ruleDefinition) { + ModelType modelType = ruleDefinition.getSubjectReference().getType(); + final ModelSchema modelSchema = getModelSchema(modelType, ruleDefinition); + return new ExtractedManagedCreationRule(modelPath, ruleDefinition, modelSchema); + } + + private static NodeInitializer getNodeInitializer(ModelRuleDescriptor descriptor, ModelSchema modelSchema, NodeInitializerRegistry nodeInitializerRegistry) { + try { + return nodeInitializerRegistry.getNodeInitializer(forType(modelSchema.getType())); + } catch (ModelTypeInitializationException e) { + throw new InvalidModelRuleDeclarationException(descriptor, e); + } + } + + private ModelSchema getModelSchema(ModelType managedType, MethodRuleDefinition ruleDefinition) { + try { + return schemaStore.getSchema(managedType); + } catch (InvalidManagedModelElementTypeException e) { + throw new InvalidModelRuleDeclarationException(ruleDefinition.getDescriptor(), e); + } + } + + private static class ExtractedManagedCreationRule extends ExtractedCreationRule { + private final ModelSchema modelSchema; + + public ExtractedManagedCreationRule(ModelPath modelPath, MethodRuleDefinition ruleDefinition, ModelSchema modelSchema) { + super(modelPath, ruleDefinition); + this.modelSchema = modelSchema; + } + + @Override + protected void buildRegistration(MethodModelRuleApplicationContext context, ModelRegistrations.Builder registration) { + MethodRuleDefinition ruleDefinition = getRuleDefinition(); + List> bindings = ruleDefinition.getReferences(); + List> inputs = bindings.subList(1, bindings.size()); + final ModelRuleDescriptor descriptor = ruleDefinition.getDescriptor(); + + if (modelSchema instanceof SpecializedMapSchema) { + registration.actions(SpecializedMapNodeInitializer.getActions(ModelReference.of(modelPath), descriptor, (SpecializedMapSchema) modelSchema)); + } else { + registration.action(ModelActionRole.Discover, Collections.singletonList(ModelReference.of(NODE_INITIALIZER_REGISTRY)), new BiAction>>() { + @Override + public void execute(MutableModelNode node, List> modelViews) { + NodeInitializerRegistry nodeInitializerRegistry = (NodeInitializerRegistry) modelViews.get(0).getInstance(); + NodeInitializer initializer = getNodeInitializer(descriptor, modelSchema, nodeInitializerRegistry); + for (Map.Entry actionInRole : initializer.getActions(ModelReference.of(modelPath), descriptor).entries()) { + ModelActionRole role = actionInRole.getKey(); + ModelAction action = actionInRole.getValue(); + node.applyToSelf(role, action); + } + } + }); + } + + registration.action(ModelActionRole.Initialize, + context.contextualize(new MethodBackedModelAction(descriptor, ModelReference.of(modelPath, modelSchema.getType()), inputs))); + } + + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/inspect/ModelRuleExtractor.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/inspect/ModelRuleExtractor.java new file mode 100644 index 0000000..0e3dabf --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/inspect/ModelRuleExtractor.java @@ -0,0 +1,613 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.model.internal.inspect; + +import com.google.common.base.Joiner; +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Ordering; +import com.google.common.util.concurrent.UncheckedExecutionException; +import javax.annotation.concurrent.ThreadSafe; +import org.gradle.api.Transformer; +import org.gradle.internal.Cast; +import org.gradle.internal.Factory; +import org.gradle.internal.UncheckedException; +import org.gradle.internal.reflect.GroovyMethods; +import org.gradle.model.InvalidModelRuleDeclarationException; +import org.gradle.model.RuleInput; +import org.gradle.model.RuleSource; +import org.gradle.model.RuleTarget; +import org.gradle.model.internal.core.ModelAction; +import org.gradle.model.internal.core.ModelPath; +import org.gradle.model.internal.core.ModelReference; +import org.gradle.model.internal.core.ModelView; +import org.gradle.model.internal.core.MutableModelNode; +import org.gradle.model.internal.core.rule.describe.ModelRuleDescriptor; +import org.gradle.model.internal.manage.binding.StructBindings; +import org.gradle.model.internal.manage.binding.StructBindingsStore; +import org.gradle.model.internal.manage.instance.GeneratedViewState; +import org.gradle.model.internal.manage.instance.ManagedInstance; +import org.gradle.model.internal.manage.instance.ManagedProxyFactory; +import org.gradle.model.internal.manage.schema.ModelProperty; +import org.gradle.model.internal.manage.schema.ModelSchema; +import org.gradle.model.internal.manage.schema.ModelSchemaStore; +import org.gradle.model.internal.manage.schema.ScalarValueSchema; +import org.gradle.model.internal.manage.schema.StructSchema; +import org.gradle.model.internal.method.WeaklyTypeReferencingMethod; +import org.gradle.model.internal.registry.ModelRegistry; +import org.gradle.model.internal.registry.RuleContext; +import org.gradle.model.internal.type.ModelType; +import org.gradle.util.internal.CollectionUtils; + +import javax.annotation.Nullable; +import java.lang.reflect.Constructor; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeSet; +import java.util.concurrent.ExecutionException; + +@ThreadSafe +public class ModelRuleExtractor { + private final LoadingCache, CachedRuleSource> cache = CacheBuilder.newBuilder() + .weakKeys() + .build(new CacheLoader, CachedRuleSource>() { + @Override + public CachedRuleSource load(Class source) { + return doExtract(source); + } + }); + + private final Iterable handlers; + private final ManagedProxyFactory proxyFactory; + private final ModelSchemaStore schemaStore; + private final StructBindingsStore structBindingsStore; + + public ModelRuleExtractor(Iterable handlers, ManagedProxyFactory proxyFactory, ModelSchemaStore schemaStore, StructBindingsStore structBindingsStore) { + this.handlers = handlers; + this.proxyFactory = proxyFactory; + this.schemaStore = schemaStore; + this.structBindingsStore = structBindingsStore; + } + + private String describeHandlers() { + String desc = Joiner.on(", ").join(CollectionUtils.collect(handlers, new Transformer() { + @Override + public String transform(MethodModelRuleExtractor original) { + return original.getDescription(); + } + })); + return "[" + desc + "]"; + } + + /** + * Creates a new rule source instance to be applied to a model element. + * + * @throws InvalidModelRuleDeclarationException On badly formed rule source class. + */ + public ExtractedRuleSource extract(Class source) throws InvalidModelRuleDeclarationException { + try { + return cache.get(source).newInstance(source); + } catch (ExecutionException e) { + throw UncheckedException.throwAsUncheckedException(e); + } catch (UncheckedExecutionException e) { + throw UncheckedException.throwAsUncheckedException(e.getCause()); + } + } + + private CachedRuleSource doExtract(final Class source) { + final ModelType type = ModelType.of(source); + FormattingValidationProblemCollector problems = new FormattingValidationProblemCollector("rule source", type); + DefaultMethodModelRuleExtractionContext context = new DefaultMethodModelRuleExtractionContext(this, problems); + + // TODO - exceptions thrown here should point to some extensive documentation on the concept of class rule sources + + StructSchema schema = getSchema(source, context); + if (schema == null) { + throw new InvalidModelRuleDeclarationException(problems.format()); + } + + // sort for determinism + Set methods = new TreeSet(Ordering.usingToString()); + methods.addAll(Arrays.asList(source.getDeclaredMethods())); + + ImmutableList.Builder> implicitInputs = ImmutableList.builder(); + ModelProperty target = null; + for (ModelProperty property : schema.getProperties()) { + if (property.isAnnotationPresent(RuleTarget.class)) { + target = property; + } else if (property.isAnnotationPresent(RuleInput.class) && !(property.getSchema() instanceof ScalarValueSchema)) { + implicitInputs.add(property); + } + for (WeaklyTypeReferencingMethod method : property.getAccessors()) { + methods.remove(method.getMethod()); + } + } + + ImmutableList.Builder rules = ImmutableList.builder(); + for (Method method : methods) { + MethodRuleDefinition ruleDefinition = DefaultMethodRuleDefinition.create(source, method); + ExtractedModelRule rule = getMethodHandler(ruleDefinition, method, context); + if (rule != null) { + rules.add(new ExtractedRuleDetails(ruleDefinition, rule)); + } + } + + if (context.hasProblems()) { + throw new InvalidModelRuleDeclarationException(problems.format()); + } + + StructBindings bindings = structBindingsStore.getBindings(schema.getType()); + + if (schema.getProperties().isEmpty()) { + return new StatelessRuleSource(rules.build(), Modifier.isAbstract(source.getModifiers()) ? new AbstractRuleSourceFactory(schema, bindings, proxyFactory) : new ConcreteRuleSourceFactory(type)); + } else { + return new ParameterizedRuleSource(rules.build(), target, implicitInputs.build(), schema, bindings, proxyFactory); + } + } + + private StructSchema getSchema(Class source, RuleSourceValidationProblemCollector problems) { + if (!RuleSource.class.isAssignableFrom(source) || !source.getSuperclass().equals(RuleSource.class)) { + problems.add("Rule source classes must directly extend " + RuleSource.class.getName()); + } + + ModelSchema schema = schemaStore.getSchema(source); + if (!(schema instanceof StructSchema)) { + return null; + } + + validateClass(source, problems); + return (StructSchema) schema; + } + + @Nullable + private ExtractedModelRule getMethodHandler(MethodRuleDefinition ruleDefinition, Method method, MethodModelRuleExtractionContext context) { + MethodModelRuleExtractor handler = null; + for (MethodModelRuleExtractor candidateHandler : handlers) { + if (candidateHandler.isSatisfiedBy(ruleDefinition)) { + if (handler == null) { + handler = candidateHandler; + } else { + context.add(method, "Can only be one of " + describeHandlers()); + validateRuleMethod(ruleDefinition, method, context); + return null; + } + } + } + if (handler != null) { + validateRuleMethod(ruleDefinition, method, context); + return handler.registration(ruleDefinition, context); + } else { + validateNonRuleMethod(method, context); + return null; + } + } + + private void validateClass(Class source, RuleSourceValidationProblemCollector problems) { + int modifiers = source.getModifiers(); + + if (Modifier.isInterface(modifiers)) { + problems.add("Must be a class, not an interface"); + } + + if (source.getEnclosingClass() != null) { + if (Modifier.isStatic(modifiers)) { + if (Modifier.isPrivate(modifiers)) { + problems.add("Class cannot be private"); + } + } else { + problems.add("Enclosed classes must be static and non private"); + } + } + + Constructor[] constructors = source.getDeclaredConstructors(); + for (Constructor constructor : constructors) { + if (constructor.getParameterTypes().length > 0) { + problems.add("Cannot declare a constructor that takes arguments"); + break; + } + } + + Field[] fields = source.getDeclaredFields(); + for (Field field : fields) { + int fieldModifiers = field.getModifiers(); + if (!field.isSynthetic() && !(Modifier.isStatic(fieldModifiers) && Modifier.isFinal(fieldModifiers))) { + problems.add(field, "Fields must be static final."); + } + } + } + + private void validateRuleMethod(MethodRuleDefinition ruleDefinition, Method ruleMethod, RuleSourceValidationProblemCollector problems) { + if (Modifier.isPrivate(ruleMethod.getModifiers())) { + problems.add(ruleMethod, "A rule method cannot be private"); + } + if (Modifier.isAbstract(ruleMethod.getModifiers())) { + problems.add(ruleMethod, "A rule method cannot be abstract"); + } + + if (ruleMethod.getTypeParameters().length > 0) { + problems.add(ruleMethod, "Cannot have type variables (i.e. cannot be a generic method)"); + } + + // TODO validations on method: synthetic, bridge methods, varargs, abstract, native + ModelType returnType = ModelType.returnType(ruleMethod); + if (returnType.isRawClassOfParameterizedType()) { + problems.add(ruleMethod, "Raw type " + returnType + " used for return type (all type parameters must be specified of parameterized type)"); + } + + for (int i = 0; i < ruleDefinition.getReferences().size(); i++) { + ModelReference reference = ruleDefinition.getReferences().get(i); + if (reference.getType().isRawClassOfParameterizedType()) { + problems.add(ruleMethod, "Raw type " + reference.getType() + " used for parameter " + (i + 1) + " (all type parameters must be specified of parameterized type)"); + } + if (reference.getPath() != null) { + try { + ModelPath.validatePath(reference.getPath().getPath()); + } catch (Exception e) { + problems.add(ruleDefinition, "The declared model element path '" + reference.getPath().getPath() + "' used for parameter " + (i + 1) + " is not a valid path", e); + } + } + } + } + + private void validateNonRuleMethod(Method method, RuleSourceValidationProblemCollector problems) { + if (!Modifier.isPrivate(method.getModifiers()) && !Modifier.isStatic(method.getModifiers()) && !method.isSynthetic() && !GroovyMethods.isObjectMethod(method)) { + problems.add(method, "A method that is not annotated as a rule must be private"); + } + } + + private static class ConcreteRuleSourceFactory implements Factory { + // Reference class via `ModelType` to avoid strong reference + private final ModelType type; + + public ConcreteRuleSourceFactory(ModelType type) { + this.type = type; + } + + @Override + public T create() { + Class concreteClass = type.getConcreteClass(); + try { + Constructor declaredConstructor = concreteClass.getDeclaredConstructor(); + declaredConstructor.setAccessible(true); + return declaredConstructor.newInstance(); + } catch (InvocationTargetException e) { + throw UncheckedException.throwAsUncheckedException(e.getTargetException()); + } catch (Exception e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + } + + private static class AbstractRuleSourceFactory implements Factory, GeneratedViewState { + private final StructSchema schema; + private final StructBindings bindings; + private final ManagedProxyFactory proxyFactory; + + public AbstractRuleSourceFactory(StructSchema schema, StructBindings bindings, ManagedProxyFactory proxyFactory) { + this.schema = schema; + this.bindings = bindings; + this.proxyFactory = proxyFactory; + } + + @Override + public String getDisplayName() { + return "rule source " + schema.getType().getDisplayName(); + } + + @Override + public Object get(String name) { + throw new UnsupportedOperationException(); + } + + @Override + public void set(String name, Object value) { + throw new UnsupportedOperationException(); + } + + @Override + public T create() { + return proxyFactory.createProxy(this, schema, bindings); + } + } + + interface CachedRuleSource { + ExtractedRuleSource newInstance(Class source); + } + + private static class StatelessRuleSource implements CachedRuleSource { + private final DefaultExtractedRuleSource ruleSource; + + public StatelessRuleSource(List rules, Factory factory) { + this.ruleSource = new StatelessExtractedRuleSource(rules, factory); + } + + @Override + public ExtractedRuleSource newInstance(Class source) { + return Cast.uncheckedCast(ruleSource); + } + } + + private static class ParameterizedRuleSource implements CachedRuleSource { + private final List rules; + @Nullable + private final ModelProperty target; + private final List> implicitInputs; + private final StructSchema schema; + private final StructBindings bindings; + private final ManagedProxyFactory proxyFactory; + + public ParameterizedRuleSource(List rules, @Nullable ModelProperty target, List> implicitInputs, StructSchema schema, StructBindings bindings, ManagedProxyFactory proxyFactory) { + this.rules = rules; + this.target = target; + this.implicitInputs = implicitInputs; + this.schema = schema; + this.bindings = bindings; + this.proxyFactory = proxyFactory; + } + + @Override + public ExtractedRuleSource newInstance(Class source) { + StructSchema schema = Cast.uncheckedCast(this.schema); + return new ParameterizedExtractedRuleSource(rules, target, implicitInputs, schema, bindings, proxyFactory); + } + } + + private static class ExtractedRuleDetails { + final MethodRuleDefinition method; + final ExtractedModelRule rule; + + public ExtractedRuleDetails(MethodRuleDefinition method, ExtractedModelRule rule) { + this.method = method; + this.rule = rule; + } + } + + private static abstract class DefaultExtractedRuleSource implements ExtractedRuleSource { + private final List rules; + + public DefaultExtractedRuleSource(List rules) { + this.rules = rules; + } + + public List getRules() { + return CollectionUtils.collect(rules, new Transformer() { + @Override + public ExtractedModelRule transform(ExtractedRuleDetails extractedRuleDetails) { + return extractedRuleDetails.rule; + } + }); + } + + @Override + public void apply(final ModelRegistry modelRegistry, MutableModelNode target) { + final ModelPath targetPath = calculateTarget(target); + for (final ExtractedRuleDetails details : rules) { + details.rule.apply(new MethodModelRuleApplicationContext() { + @Override + public ModelRegistry getRegistry() { + return modelRegistry; + } + + @Override + public ModelPath getScope() { + return targetPath; + } + + @Override + public ModelAction contextualize(final MethodRuleAction action) { + final List> inputs = withImplicitInputs(action.getInputs()); + final ModelReference mappedSubject = mapSubject(action.getSubject(), targetPath); + mapInputs(inputs.subList(0, action.getInputs().size()), targetPath); + final MethodRuleDefinition methodRuleDefinition = details.method; + final Factory factory = getFactory(); + return new ContextualizedModelAction(methodRuleDefinition, mappedSubject, inputs, action, factory); + } + }, target); + } + } + + protected ModelPath calculateTarget(MutableModelNode target) { + return target.getPath(); + } + + private void mapInputs(List> inputs, ModelPath targetPath) { + for (int i = 0; i < inputs.size(); i++) { + ModelReference input = inputs.get(i); + if (input.getPath() != null) { + inputs.set(i, input.withPath(targetPath.descendant(input.getPath()))); + } else { + inputs.set(i, input.inScope(ModelPath.ROOT)); + } + } + } + + private ModelReference mapSubject(ModelReference subject, ModelPath targetPath) { + if (subject.getPath() == null) { + return subject.inScope(targetPath); + } else { + return subject.withPath(targetPath.descendant(subject.getPath())); + } + } + + protected List> withImplicitInputs(List> inputs) { + return new ArrayList>(inputs); + } + + @Override + public List> getRequiredPlugins() { + List> plugins = new ArrayList>(); + for (ExtractedRuleDetails details : rules) { + plugins.addAll(details.rule.getRuleDependencies()); + } + return plugins; + } + + @Override + public void assertNoPlugins() { + for (ExtractedRuleDetails details : rules) { + if (!details.rule.getRuleDependencies().isEmpty()) { + StringBuilder message = new StringBuilder(); + details.method.getDescriptor().describeTo(message); + message.append(" has dependencies on plugins: "); + message.append(details.rule.getRuleDependencies()); + message.append(". Plugin dependencies are not supported in this context."); + throw new UnsupportedOperationException(message.toString()); + } + } + } + + private static class ContextualizedModelAction implements ModelAction { + private final MethodRuleDefinition methodRuleDefinition; + private final ModelReference mappedSubject; + private final List> inputs; + private final MethodRuleAction action; + private final Factory factory; + + public ContextualizedModelAction(MethodRuleDefinition methodRuleDefinition, ModelReference mappedSubject, List> inputs, MethodRuleAction action, Factory factory) { + this.methodRuleDefinition = methodRuleDefinition; + this.mappedSubject = mappedSubject; + this.inputs = inputs; + this.action = action; + this.factory = factory; + } + + @Override + public ModelRuleDescriptor getDescriptor() { + return methodRuleDefinition.getDescriptor(); + } + + @Override + public ModelReference getSubject() { + return mappedSubject; + } + + @Override + public List> getInputs() { + return inputs; + } + + @Override + public void execute(MutableModelNode modelNode, List> inputs) { + WeaklyTypeReferencingMethod method = Cast.uncheckedCast(methodRuleDefinition.getMethod()); + ModelRuleInvoker invoker = new DefaultModelRuleInvoker(method, factory); + action.execute(invoker, modelNode, inputs.subList(0, action.getInputs().size())); + } + } + } + + private static class StatelessExtractedRuleSource extends DefaultExtractedRuleSource { + private final Factory factory; + + public StatelessExtractedRuleSource(List rules, Factory factory) { + super(rules); + this.factory = factory; + } + + @Override + public Factory getFactory() { + return factory; + } + } + + private static class ParameterizedExtractedRuleSource extends DefaultExtractedRuleSource implements GeneratedViewState, Factory { + @Nullable + private final ModelProperty targetProperty; + private final List> implicitInputs; + private final StructSchema schema; + private final StructBindings bindings; + private final ManagedProxyFactory proxyFactory; + private final Map values = new HashMap(); + + public ParameterizedExtractedRuleSource(List rules, @Nullable ModelProperty targetProperty, List> implicitInputs, StructSchema schema, StructBindings bindings, ManagedProxyFactory proxyFactory) { + super(rules); + this.targetProperty = targetProperty; + this.implicitInputs = implicitInputs; + this.schema = schema; + this.bindings = bindings; + this.proxyFactory = proxyFactory; + } + + @Override + public Factory getFactory() { + return this; + } + + @Override + public T create() { + return proxyFactory.createProxy(this, schema, bindings); + } + + @Override + public String getDisplayName() { + return "rule source " + schema.getType().getDisplayName(); + } + + @Override + public Object get(String name) { + ModelProperty property = schema.getProperty(name); + if (property.getSchema() instanceof ScalarValueSchema) { + return values.get(name); + } + + MutableModelNode node = (MutableModelNode) values.get(name); + if (node == null) { + return null; + } + return node.asImmutable(property.getType(), RuleContext.get()).getInstance(); + } + + @Override + public void set(String name, Object value) { + ModelProperty property = schema.getProperty(name); + if (property.getSchema() instanceof ScalarValueSchema) { + values.put(name, value); + } else { + MutableModelNode backingNode = ((ManagedInstance) value).getBackingNode(); + values.put(name, backingNode); + } + } + + @Override + protected ModelPath calculateTarget(MutableModelNode target) { + if (targetProperty != null) { + return ((MutableModelNode)values.get(targetProperty.getName())).getPath(); + } + return target.getPath(); + } + + @Override + protected List> withImplicitInputs(List> inputs) { + List> allInputs = new ArrayList>(inputs.size() + implicitInputs.size()); + allInputs.addAll(inputs); + for (ModelProperty property : implicitInputs) { + MutableModelNode backingNode = (MutableModelNode) values.get(property.getName()); + allInputs.add(ModelReference.of(backingNode.getPath())); + } + return allInputs; + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/inspect/RuleApplicationScope.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/inspect/RuleApplicationScope.java new file mode 100644 index 0000000..b672c3f --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/inspect/RuleApplicationScope.java @@ -0,0 +1,71 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.model.internal.inspect; + +import org.gradle.model.Each; +import org.gradle.model.Path; + +import java.lang.annotation.Annotation; +import java.util.List; + +public enum RuleApplicationScope { + /** + * Rule should be applied to the scope element only. + */ + SELF, + + /** + * Rule should be applied to the all matching descendant elements of the scope. + */ + DESCENDANTS; + + /** + * Detects if the subject of the rule has been annotated with {@literal @}{@link Each}. + * + * @throws IndexOutOfBoundsException If the rule definition has too few parameters. + */ + public static RuleApplicationScope fromRuleDefinition(RuleSourceValidationProblemCollector problems, MethodRuleDefinition ruleDefinition, int subjectParamIndex) { + List> parameterAnnotations = ruleDefinition.getParameterAnnotations(); + if (subjectParamIndex >= parameterAnnotations.size()) { + throw new IndexOutOfBoundsException("Rule definition should have at least " + (subjectParamIndex + 1) + " parameters"); + } + RuleApplicationScope result = null; + for (int paramIndex = 0; paramIndex < parameterAnnotations.size(); paramIndex++) { + List annotations = parameterAnnotations.get(paramIndex); + boolean annotatedWithEach = hasAnnotation(annotations, Each.class); + if (paramIndex == subjectParamIndex) { + if (annotatedWithEach && hasAnnotation(annotations, Path.class)) { + problems.add(ruleDefinition, "Rule subject must not be annotated with both @Path and @Each."); + } + result = annotatedWithEach ? DESCENDANTS : SELF; + } else if (annotatedWithEach) { + problems.add(ruleDefinition, String.format("Rule parameter #%d should not be annotated with @Each.", paramIndex + 1)); + } + } + assert result != null; + return result; + } + + private static boolean hasAnnotation(Iterable annotations, Class annotationType) { + for (Annotation annotation : annotations) { + if (annotationType.isInstance(annotation)) { + return true; + } + } + return false; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/manage/binding/ManagedProperty.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/manage/binding/ManagedProperty.java new file mode 100644 index 0000000..5b50447 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/manage/binding/ManagedProperty.java @@ -0,0 +1,76 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.model.internal.manage.binding; + +import org.gradle.model.internal.type.ModelType; + +/** + * A managed property of a struct type. + * + *

Managed properties are properties whose values need to be stored in child-nodes. A + * managed property is detected when the view schemas declaring the struct declare a property with only abstract accessor + * methods. This means that accessors declaring the property in the views should all be abstract, and the delegate type (if any) + * should not provide an implementation for any of the property's accessor methods either.

+ * + *

The managed property represents a property that is able to serve all its declaring view methods. For example, if the view + * types declaring the struct only specify the property via a getter, then the managed property will be read-only. However, if + * even one of the view types declare a setter for the property, it will be a read-write property.

+ * + *

Different views can declare the same getter with different return types. In such a case the type of the managed property + * will be the most specific of those return types (provided there is a single type that is assignable to any of the other + * return types).

+ */ +public class ManagedProperty { + private final String name; + private final ModelType type; + private final boolean writable; + private final boolean declaredAsHavingUnmanagedType; + private final boolean internal; + + public ManagedProperty(String name, ModelType type, boolean writable, boolean declaredAsHavingUnmanagedType, boolean internal) { + this.name = name; + this.type = type; + this.writable = writable; + this.declaredAsHavingUnmanagedType = declaredAsHavingUnmanagedType; + this.internal = internal; + } + + public String getName() { + return name; + } + + public ModelType getType() { + return type; + } + + public boolean isInternal() { + return internal; + } + + public boolean isWritable() { + return writable; + } + + public boolean isDeclaredAsHavingUnmanagedType() { + return declaredAsHavingUnmanagedType; + } + + @Override + public String toString() { + return name; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/manage/schema/RuleSourceSchema.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/manage/schema/RuleSourceSchema.java new file mode 100644 index 0000000..70c1915 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/manage/schema/RuleSourceSchema.java @@ -0,0 +1,35 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.model.internal.manage.schema; + +import org.gradle.model.internal.manage.schema.extract.ModelSchemaAspect; +import org.gradle.model.internal.method.WeaklyTypeReferencingMethod; +import org.gradle.model.internal.type.ModelType; + +/** + * The schema for a {@link org.gradle.model.RuleSource}. + */ +public class RuleSourceSchema extends AbstractStructSchema { + public RuleSourceSchema( + ModelType type, + Iterable> properties, + Iterable> nonPropertyMethods, + Iterable aspects + ) { + super(type, properties, nonPropertyMethods, aspects); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/registry/ModelElementNode.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/registry/ModelElementNode.java new file mode 100644 index 0000000..be93ed6 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/model/internal/registry/ModelElementNode.java @@ -0,0 +1,291 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.model.internal.registry; + +import com.google.common.base.Predicate; +import com.google.common.collect.Iterables; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import org.gradle.internal.Cast; +import org.gradle.model.RuleSource; +import org.gradle.model.internal.core.DuplicateModelException; +import org.gradle.model.internal.core.EmptyReferenceProjection; +import org.gradle.model.internal.core.ModelAction; +import org.gradle.model.internal.core.ModelActionRole; +import org.gradle.model.internal.core.ModelNode; +import org.gradle.model.internal.core.ModelPath; +import org.gradle.model.internal.core.ModelProjection; +import org.gradle.model.internal.core.ModelRegistration; +import org.gradle.model.internal.core.ModelRegistrations; +import org.gradle.model.internal.core.ModelView; +import org.gradle.model.internal.core.MutableModelNode; +import org.gradle.model.internal.core.NodePredicate; +import org.gradle.model.internal.core.rule.describe.ModelRuleDescriptor; +import org.gradle.model.internal.type.ModelType; + +import javax.annotation.Nullable; +import java.util.Collections; +import java.util.Map; +import java.util.Set; + +import static org.gradle.model.internal.core.ModelNode.State.Created; +import static org.gradle.model.internal.core.ModelNode.State.Initialized; + +class ModelElementNode extends ModelNodeInternal { + private Map links; + private final MutableModelNode parent; + private Object privateData; + private ModelType privateDataType; + + public ModelElementNode(ModelRegistryInternal modelRegistry, ModelRegistration registration, MutableModelNode parent) { + super(modelRegistry, registration); + this.parent = parent; + } + + @Override + public MutableModelNode getParent() { + return parent; + } + + @Override + public ModelView asImmutable(ModelType type, @Nullable ModelRuleDescriptor ruleDescriptor) { + ModelView modelView = getAdapter().asImmutable(type, this, ruleDescriptor); + if (modelView == null) { + throw new IllegalStateException("Model element " + getPath() + " cannot be expressed as a read-only view of type " + type); + } + return modelView; + } + + @Override + public ModelView asMutable(ModelType type, ModelRuleDescriptor ruleDescriptor) { + ModelView modelView; + if (isMutable()) { + modelView = getAdapter().asMutable(type, this, ruleDescriptor); + } else { + modelView = getAdapter().asImmutable(type, this, ruleDescriptor); + } + if (modelView == null) { + throw new IllegalStateException("Model element " + getPath() + " cannot be expressed as a mutable view of type " + type); + } + return modelView; + } + + @Override + public T getPrivateData(Class type) { + return getPrivateData(ModelType.of(type)); + } + + @Override + public T getPrivateData(ModelType type) { + if (privateData == null) { + return null; + } + + if (!type.isAssignableFrom(privateDataType)) { + throw new ClassCastException("Cannot get private data '" + privateData + "' of type '" + privateDataType + "' as type '" + type); + } + return Cast.uncheckedCast(privateData); + } + + @Override + public Object getPrivateData() { + return privateData; + } + + @Override + public void setPrivateData(Class type, T object) { + setPrivateData(ModelType.of(type), object); + } + + @Override + public void setPrivateData(ModelType type, T object) { + if (!isMutable()) { + throw new IllegalStateException(String.format("Cannot set value for model element '%s' as this element is not mutable.", getPath())); + } + this.privateDataType = type; + this.privateData = object; + } + + @Override + public boolean hasLink(String name) { + return links != null && links.containsKey(name); + } + + @Override + @Nullable + public ModelNodeInternal getLink(String name) { + return links == null ? null : links.get(name); + } + + @Override + public Iterable getLinks() { + return links == null ? Collections.emptyList() : links.values(); + } + + @Override + public int getLinkCount(Predicate predicate) { + return links == null ? 0 : Iterables.size(Iterables.filter(links.values(), predicate)); + } + + @Override + public Set getLinkNames(Predicate predicate) { + if (links == null) { + return Collections.emptySet(); + } + Set names = Sets.newLinkedHashSet(); + for (Map.Entry entry : links.entrySet()) { + ModelNodeInternal link = entry.getValue(); + if (predicate.apply(link)) { + names.add(entry.getKey()); + } + } + return names; + } + + @Override + public Set getLinkNames() { + return links == null ? Collections.emptySet() : links.keySet(); + } + + @Override + public Iterable getLinks(Predicate predicate) { + return links == null ? Collections.emptyList() : Iterables.filter(links.values(), predicate); + } + + @Override + public int getLinkCount() { + return links == null ? 0 : links.size(); + } + + @Override + public boolean hasLink(String name, Predicate predicate) { + ModelNodeInternal linked = getLink(name); + return linked != null && predicate.apply(linked); + } + + @Override + public void applyToLink(ModelActionRole type, ModelAction action) { + if (!getPath().isDirectChild(action.getSubject().getPath())) { + throw new IllegalArgumentException(String.format("Linked element action reference has a path (%s) which is not a child of this node (%s).", action.getSubject().getPath(), getPath())); + } + modelRegistry.bind(action.getSubject(), type, action); + } + + @Override + public void applyTo(NodePredicate predicate, ModelActionRole role, ModelAction action) { + modelRegistry.configureMatching(predicate.scope(getPath()), role, action); + } + + @Override + public void applyTo(NodePredicate predicate, Class rules) { + modelRegistry.configureMatching(predicate.scope(getPath()), rules); + } + + @Override + public void addReference(String name, ModelType type, ModelNode target, ModelRuleDescriptor descriptor) { + // TODO:LPTR Remove projection for reference node + // This shouldn't be needed, but if there's no actual value referenced, model report can only + // show the type of the node if we do this for now. It should use the schema instead to find + // the type of the property node instead. + ModelProjection projection = new EmptyReferenceProjection(type); + ModelRegistration registration = ModelRegistrations.of(getPath().child(name)) + .withProjection(projection) + .descriptor(descriptor).build(); + ModelReferenceNode referenceNode = new ModelReferenceNode(modelRegistry, registration, this); + if (target != null) { + referenceNode.setTarget(target); + } + addNode(referenceNode, registration); + } + + @Override + public void addLink(ModelRegistration registration) { + addNode(new ModelElementNode(modelRegistry, registration, this), registration); + } + + private void addNode(ModelNodeInternal child, ModelRegistration registration) { + ModelPath childPath = child.getPath(); + if (!getPath().isDirectChild(childPath)) { + throw new IllegalArgumentException(String.format("Element registration has a path (%s) which is not a child of this node (%s).", childPath, getPath())); + } + + ModelNodeInternal currentChild = links == null ? null : links.get(childPath.getName()); + if (currentChild != null) { + if (!currentChild.isAtLeast(Created)) { + throw new DuplicateModelException( + String.format( + "Cannot create '%s' using creation rule '%s' as the rule '%s' is already registered to create this model element.", + childPath, + describe(registration.getDescriptor()), + describe(currentChild.getDescriptor()) + ) + ); + } + throw new DuplicateModelException( + String.format( + "Cannot create '%s' using creation rule '%s' as the rule '%s' has already been used to create this model element.", + childPath, + describe(registration.getDescriptor()), + describe(currentChild.getDescriptor()) + ) + ); + } + if (!isMutable()) { + throw new IllegalStateException( + String.format( + "Cannot create '%s' using creation rule '%s' as model element '%s' is no longer mutable.", + childPath, + describe(registration.getDescriptor()), + getPath() + ) + ); + } + if (links == null) { + links = Maps.newTreeMap(); + } + links.put(child.getPath().getName(), child); + modelRegistry.registerNode(child, registration.getActions()); + } + + @Override + public void removeLink(String name) { + if (links!=null && links.remove(name) != null) { + modelRegistry.remove(getPath().child(name)); + } + } + + @Override + public void setTarget(ModelNode target) { + throw new UnsupportedOperationException(String.format("This node (%s) is not a reference to another node.", getPath())); + } + + @Override + public void ensureUsable() { + ensureAtLeast(Initialized); + } + + @Override + public void ensureAtLeast(State state) { + modelRegistry.transition(this, state, true); + } + + private static String describe(ModelRuleDescriptor descriptor) { + StringBuilder stringBuilder = new StringBuilder(); + descriptor.describeTo(stringBuilder); + return stringBuilder.toString(); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/util/internal/ClosureBackedAction.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/util/internal/ClosureBackedAction.java new file mode 100644 index 0000000..1ceaebe --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/model-core/org/gradle/util/internal/ClosureBackedAction.java @@ -0,0 +1,109 @@ +/* + * Copyright 2021 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.util.internal; + +import com.google.common.base.Objects; +import groovy.lang.Closure; +import org.gradle.api.Action; +import org.gradle.api.InvalidActionClosureException; +import org.gradle.util.Configurable; + +/** + * NOTE: You should use {@link ConfigureUtil} instead of this class when adding a closure backed method to the DSL, whether statically or dynamically added. {@link ConfigureUtil} is much more efficient and takes care of applying consistent DSL behaviour when closures are nested. + */ +public class ClosureBackedAction implements Action { + + private final Closure closure; + private final int resolveStrategy; + private final boolean configurableAware; + + public static ClosureBackedAction of(Closure closure) { + return new ClosureBackedAction(closure); + } + + public ClosureBackedAction(Closure closure) { + this(closure, Closure.DELEGATE_FIRST, true); + } + + public ClosureBackedAction(Closure closure, int resolveStrategy) { + this(closure, resolveStrategy, false); + } + + public ClosureBackedAction(Closure closure, int resolveStrategy, boolean configurableAware) { + this.closure = closure; + this.resolveStrategy = resolveStrategy; + this.configurableAware = configurableAware; + } + + public static void execute(T delegate, Closure closure) { + new ClosureBackedAction(closure).execute(delegate); + } + + @Override + public void execute(T delegate) { + if (closure == null) { + return; + } + + try { + if (configurableAware && delegate instanceof Configurable) { + ((Configurable) delegate).configure(closure); + } else { + Closure copy = (Closure) closure.clone(); + copy.setResolveStrategy(resolveStrategy); + copy.setDelegate(delegate); + if (copy.getMaximumNumberOfParameters() == 0) { + copy.call(); + } else { + copy.call(delegate); + } + } + } catch (groovy.lang.MissingMethodException e) { + if (Objects.equal(e.getType(), closure.getClass()) && Objects.equal(e.getMethod(), "doCall")) { + throw new InvalidActionClosureException(closure, delegate); + } + throw e; + } + } + + public Closure getClosure() { + return closure; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + ClosureBackedAction that = (ClosureBackedAction) o; + return configurableAware == that.configurableAware + && resolveStrategy == that.resolveStrategy + && closure.equals(that.closure); + } + + @Override + public int hashCode() { + int result = closure.hashCode(); + result = 31 * result + (configurableAware ? 1 : 0); + result = 31 * result + resolveStrategy; + return result; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/native/org/gradle/internal/nativeintegration/jansi/JansiRuntimeResolver.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/native/org/gradle/internal/nativeintegration/jansi/JansiRuntimeResolver.java new file mode 100644 index 0000000..2c7fe2e --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/native/org/gradle/internal/nativeintegration/jansi/JansiRuntimeResolver.java @@ -0,0 +1,23 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.nativeintegration.jansi; + +public interface JansiRuntimeResolver { + + String getOperatingSystem(); + String getPlatform(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/normalization-java/org/gradle/internal/normalization/java/impl/EnumAnnotationValue.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/normalization-java/org/gradle/internal/normalization/java/impl/EnumAnnotationValue.java new file mode 100644 index 0000000..a68ed14 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/normalization-java/org/gradle/internal/normalization/java/impl/EnumAnnotationValue.java @@ -0,0 +1,31 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.normalization.java.impl; + +public class EnumAnnotationValue extends SimpleAnnotationValue { + + private final String typeDesc; + + public EnumAnnotationValue(String name, String value, String typeDesc) { + super(name, value); + this.typeDesc = typeDesc; + } + + public String getTypeDesc() { + return typeDesc; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/persistent-cache/org/gradle/cache/internal/CacheAccessWorker.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/persistent-cache/org/gradle/cache/internal/CacheAccessWorker.java new file mode 100644 index 0000000..fa303b8 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/persistent-cache/org/gradle/cache/internal/CacheAccessWorker.java @@ -0,0 +1,235 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.cache.internal; + +import org.gradle.cache.AsyncCacheAccess; +import org.gradle.cache.CacheAccess; +import org.gradle.internal.Factory; +import org.gradle.internal.UncheckedException; +import org.gradle.internal.concurrent.ExecutorPolicy; +import org.gradle.internal.concurrent.Stoppable; +import org.gradle.internal.time.CountdownTimer; +import org.gradle.internal.time.Time; + +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ArrayBlockingQueue; +import java.util.concurrent.BlockingQueue; +import java.util.concurrent.Callable; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.FutureTask; +import java.util.concurrent.TimeUnit; + +class CacheAccessWorker implements Runnable, Stoppable, AsyncCacheAccess { + private final BlockingQueue workQueue; + private final String displayName; + private final CacheAccess cacheAccess; + private final long batchWindowMillis; + private final long maximumLockingTimeMillis; + private boolean closed; + private boolean workerCompleted; + private boolean stopSeen; + private final CountDownLatch doneSignal = new CountDownLatch(1); + private final ExecutorPolicy.CatchAndRecordFailures failureHandler = new ExecutorPolicy.CatchAndRecordFailures(); + + CacheAccessWorker(String displayName, CacheAccess cacheAccess) { + this.displayName = displayName; + this.cacheAccess = cacheAccess; + this.batchWindowMillis = 200; + this.maximumLockingTimeMillis = 5000; + HeapProportionalCacheSizer heapProportionalCacheSizer = new HeapProportionalCacheSizer(); + int queueCapacity = Math.min(4000, heapProportionalCacheSizer.scaleCacheSize(40000)); + workQueue = new ArrayBlockingQueue(queueCapacity, true); + } + + @Override + public void enqueue(Runnable task) { + addToQueue(task); + } + + private void addToQueue(Runnable task) { + if (closed) { + throw new IllegalStateException("The worker has already been closed. Cannot add more work to queue."); + } + try { + workQueue.put(task); + } catch (InterruptedException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + + @Override + public T read(final Factory task) { + FutureTask futureTask = new FutureTask(new Callable() { + @Override + public T call() throws Exception { + return task.create(); + } + }); + addToQueue(futureTask); + try { + return futureTask.get(); + } catch (ExecutionException e) { + throw UncheckedException.throwAsUncheckedException(e.getCause()); + } catch (InterruptedException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + + @Override + public synchronized void flush() { + if (!workerCompleted && !closed) { + FlushOperationsCommand flushOperationsCommand = new FlushOperationsCommand(); + addToQueue(flushOperationsCommand); + flushOperationsCommand.await(); + } + rethrowFailure(); + } + + private void rethrowFailure() { + failureHandler.onStop(); + } + + private static class FlushOperationsCommand implements Runnable { + private CountDownLatch latch = new CountDownLatch(1); + + @Override + public void run() { + } + + public void await() { + try { + latch.await(); + } catch (InterruptedException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + + public void completed() { + latch.countDown(); + } + } + + @Override + public void run() { + try { + while (!Thread.currentThread().isInterrupted() && !stopSeen) { + try { + Runnable runnable = takeFromQueue(); + Class runnableClass = runnable.getClass(); + if (runnableClass == ShutdownOperationsCommand.class) { + // not holding the cache lock, can stop now + stopSeen = true; + break; + } else if (runnableClass == FlushOperationsCommand.class) { + // not holding the cache lock, flush is done so notify flush thread and continue + FlushOperationsCommand flushOperationsCommand = (FlushOperationsCommand) runnable; + flushOperationsCommand.completed(); + } else { + // need to run operation under cache lock + flushOperations(runnable); + } + } catch (InterruptedException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + } catch (Throwable t) { + failureHandler.onFailure("Failed to execute cache operations on " + displayName, t); + } finally { + // Notify any waiting flush threads that the worker is done, possibly with a failure + List runnables = new ArrayList(); + workQueue.drainTo(runnables); + for (Runnable runnable : runnables) { + if (runnable instanceof FlushOperationsCommand) { + FlushOperationsCommand flushOperationsCommand = (FlushOperationsCommand) runnable; + flushOperationsCommand.completed(); + } + } + workerCompleted = true; + doneSignal.countDown(); + } + } + + private Runnable takeFromQueue() throws InterruptedException { + return workQueue.take(); + } + + private void flushOperations(final Runnable updateOperation) { + final List flushOperations = new ArrayList(); + try { + cacheAccess.useCache(new Runnable() { + @Override + public void run() { + CountdownTimer timer = Time.startCountdownTimer(maximumLockingTimeMillis, TimeUnit.MILLISECONDS); + if (updateOperation != null) { + failureHandler.onExecute(updateOperation); + } + Runnable otherOperation; + try { + while ((otherOperation = workQueue.poll(batchWindowMillis, TimeUnit.MILLISECONDS)) != null) { + failureHandler.onExecute(otherOperation); + final Class runnableClass = otherOperation.getClass(); + if (runnableClass == FlushOperationsCommand.class) { + flushOperations.add((FlushOperationsCommand) otherOperation); + } + if (runnableClass == ShutdownOperationsCommand.class) { + stopSeen = true; + } + if (runnableClass == ShutdownOperationsCommand.class + || runnableClass == FlushOperationsCommand.class + || timer.hasExpired()) { + break; + } + } + } catch (InterruptedException e) { + throw UncheckedException.throwAsUncheckedException(e); + } + } + }); + } finally { + for (FlushOperationsCommand flushOperation : flushOperations) { + flushOperation.completed(); + } + } + } + + @Override + public synchronized void stop() { + if (!closed && !workerCompleted) { + closed = true; + try { + workQueue.put(new ShutdownOperationsCommand()); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + try { + doneSignal.await(); + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + } + } + rethrowFailure(); + } + + private static class ShutdownOperationsCommand implements Runnable { + @Override + public void run() { + // do nothing + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/persistent-cache/org/gradle/cache/internal/btree/Block.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/persistent-cache/org/gradle/cache/internal/btree/Block.java new file mode 100644 index 0000000..ee8fb0e --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/persistent-cache/org/gradle/cache/internal/btree/Block.java @@ -0,0 +1,59 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.cache.internal.btree; + +public abstract class Block { + static final int LONG_SIZE = 8; + static final int INT_SIZE = 4; + static final int SHORT_SIZE = 2; + + private BlockPayload payload; + + protected Block(BlockPayload payload) { + this.payload = payload; + payload.setBlock(this); + } + + public BlockPayload getPayload() { + return payload; + } + + protected void detach() { + payload.setBlock(null); + payload = null; + } + + public abstract BlockPointer getPos(); + + public abstract int getSize(); + + public abstract RuntimeException blockCorruptedException(); + + @Override + public String toString() { + return payload.getClass().getSimpleName() + " " + getPos(); + } + + public BlockPointer getNextPos() { + return BlockPointer.pos(getPos().getPos() + getSize()); + } + + public abstract boolean hasPos(); + + public abstract void setPos(BlockPointer pos); + + public abstract void setSize(int size); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/persistent-cache/org/gradle/cache/internal/filelock/LockInfoAccess.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/persistent-cache/org/gradle/cache/internal/filelock/LockInfoAccess.java new file mode 100644 index 0000000..158e276 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/persistent-cache/org/gradle/cache/internal/filelock/LockInfoAccess.java @@ -0,0 +1,85 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.cache.internal.filelock; + +import org.gradle.internal.io.RandomAccessFileInputStream; +import org.gradle.internal.io.RandomAccessFileOutputStream; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.nio.channels.FileLock; +import java.nio.channels.OverlappingFileLockException; + +public class LockInfoAccess { + public static final int INFORMATION_REGION_SIZE = 2052; + private final LockInfoSerializer lockInfoSerializer = new LockInfoSerializer(); + private final long infoRegionPos; + + public LockInfoAccess(long infoRegionPos) { + this.infoRegionPos = infoRegionPos; + } + + public LockInfo readLockInfo(RandomAccessFile lockFileAccess) throws IOException { + if (lockFileAccess.length() <= infoRegionPos) { + return new LockInfo(); + } else { + lockFileAccess.seek(infoRegionPos); + + DataInputStream inputStream = new DataInputStream(new BufferedInputStream(new RandomAccessFileInputStream(lockFileAccess))); + byte protocolVersion = inputStream.readByte(); + if (protocolVersion != lockInfoSerializer.getVersion()) { + throw new IllegalStateException(String.format("Unexpected lock protocol found in lock file. Expected %s, found %s.", lockInfoSerializer.getVersion(), protocolVersion)); + } + + return lockInfoSerializer.read(inputStream); + } + } + + public void writeLockInfo(RandomAccessFile lockFileAccess, LockInfo lockInfo) throws IOException { + lockFileAccess.seek(infoRegionPos); + + DataOutputStream outstr = new DataOutputStream(new BufferedOutputStream(new RandomAccessFileOutputStream(lockFileAccess))); + outstr.writeByte(lockInfoSerializer.getVersion()); + lockInfoSerializer.write(outstr, lockInfo); + outstr.flush(); + + lockFileAccess.setLength(lockFileAccess.getFilePointer()); + } + + public void clearLockInfo(RandomAccessFile lockFileAccess) throws IOException { + lockFileAccess.setLength(Math.min(lockFileAccess.length(), infoRegionPos)); + } + + public FileLockOutcome tryLock(RandomAccessFile lockFileAccess, boolean shared) throws IOException { + try { + FileLock fileLock = lockFileAccess.getChannel().tryLock(infoRegionPos, INFORMATION_REGION_SIZE - infoRegionPos, shared); + if (fileLock == null) { + return FileLockOutcome.LOCKED_BY_ANOTHER_PROCESS; + } else { + return FileLockOutcome.acquired(fileLock); + } + } catch (OverlappingFileLockException e) { + // Locked by this process, treat as not acquired + return FileLockOutcome.LOCKED_BY_THIS_PROCESS; + } + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-base/org/gradle/api/internal/resolve/ProjectModelResolver.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-base/org/gradle/api/internal/resolve/ProjectModelResolver.java new file mode 100644 index 0000000..7c1ad8f --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-base/org/gradle/api/internal/resolve/ProjectModelResolver.java @@ -0,0 +1,26 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.resolve; + +import org.gradle.api.UnknownProjectException; +import org.gradle.model.internal.registry.ModelRegistry; + +/** + * Locates another project within the multi-project build, and provides access to its model registry in a usable state. + */ +public interface ProjectModelResolver { + ModelRegistry resolveProjectModel(String path) throws UnknownProjectException; +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-base/org/gradle/platform/base/ApplicationBinarySpec.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-base/org/gradle/platform/base/ApplicationBinarySpec.java new file mode 100644 index 0000000..5a64ccf --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-base/org/gradle/platform/base/ApplicationBinarySpec.java @@ -0,0 +1,30 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.platform.base; + +import org.gradle.api.Incubating; + +/** + * A binary produced from a `{@link org.gradle.platform.base.ApplicationSpec}`. + * */ +@Incubating +public interface ApplicationBinarySpec extends BinarySpec { + /** + * The application that this binary belongs to. + */ + ApplicationSpec getApplication(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-base/org/gradle/platform/base/component/package-info.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-base/org/gradle/platform/base/component/package-info.java new file mode 100644 index 0000000..55dd016 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-base/org/gradle/platform/base/component/package-info.java @@ -0,0 +1,21 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * General purpose types for library support. + */ +@org.gradle.api.Incubating +package org.gradle.platform.base.component; diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-base/org/gradle/platform/base/internal/dependents/DependentBinariesResolver.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-base/org/gradle/platform/base/internal/dependents/DependentBinariesResolver.java new file mode 100644 index 0000000..654fe07 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-base/org/gradle/platform/base/internal/dependents/DependentBinariesResolver.java @@ -0,0 +1,35 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.platform.base.internal.dependents; + +import org.gradle.platform.base.internal.BinarySpecInternal; + +import javax.annotation.Nullable; + +/** + * Resolve dependent binaries. + */ +public interface DependentBinariesResolver { + + DependentBinariesResolutionResult resolve(BinarySpecInternal target); + + void register(DependentBinariesResolutionStrategy strategy); + + @Nullable + T getStrategy(String name, Class type); + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-base/org/gradle/platform/base/plugins/package-info.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-base/org/gradle/platform/base/plugins/package-info.java new file mode 100644 index 0000000..b98da3f --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-base/org/gradle/platform/base/plugins/package-info.java @@ -0,0 +1,21 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Base plugins for software model support. + */ +@org.gradle.api.Incubating +package org.gradle.platform.base.plugins; diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-jvm/org/gradle/jvm/toolchain/JavadocTool.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-jvm/org/gradle/jvm/toolchain/JavadocTool.java new file mode 100644 index 0000000..9440d79 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-jvm/org/gradle/jvm/toolchain/JavadocTool.java @@ -0,0 +1,46 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.jvm.toolchain; + +import org.gradle.api.file.RegularFile; +import org.gradle.api.tasks.Internal; +import org.gradle.api.tasks.Nested; + +/** + * Generates HTML API documentation for Java classes. + * + * @since 6.7 + */ +public interface JavadocTool { + + + /** + * Returns metadata information about this tool + * + * @return the tool metadata + */ + @Nested + JavaInstallationMetadata getMetadata(); + + /** + * Returns the path to the executable for this tool + * + * @return the path to the executable + */ + @Internal + RegularFile getExecutablePath(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-jvm/org/gradle/jvm/toolchain/internal/JavaCompilerFactory.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-jvm/org/gradle/jvm/toolchain/internal/JavaCompilerFactory.java new file mode 100644 index 0000000..c8237ad --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-jvm/org/gradle/jvm/toolchain/internal/JavaCompilerFactory.java @@ -0,0 +1,29 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.jvm.toolchain.internal; + +import org.gradle.internal.service.scopes.Scopes; +import org.gradle.internal.service.scopes.ServiceScope; +import org.gradle.language.base.internal.compile.CompileSpec; +import org.gradle.language.base.internal.compile.Compiler; + +/** + * Creates Java compilers based on the provided compile options. + */ +@ServiceScope(Scopes.Project.class) +public interface JavaCompilerFactory { + Compiler create(Class type); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-jvm/org/gradle/jvm/toolchain/internal/JavaToolchain.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-jvm/org/gradle/jvm/toolchain/internal/JavaToolchain.java new file mode 100644 index 0000000..2ddea96 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-jvm/org/gradle/jvm/toolchain/internal/JavaToolchain.java @@ -0,0 +1,139 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.jvm.toolchain.internal; + +import org.gradle.api.Describable; +import org.gradle.api.file.Directory; +import org.gradle.api.file.RegularFile; +import org.gradle.api.internal.file.FileFactory; +import org.gradle.api.tasks.Internal; +import org.gradle.api.tasks.Nested; +import org.gradle.internal.jvm.inspection.JvmInstallationMetadata; +import org.gradle.internal.os.OperatingSystem; +import org.gradle.jvm.toolchain.JavaCompiler; +import org.gradle.jvm.toolchain.JavaInstallationMetadata; +import org.gradle.jvm.toolchain.JavaLanguageVersion; +import org.gradle.jvm.toolchain.JavaLauncher; +import org.gradle.jvm.toolchain.JavadocTool; +import org.gradle.util.internal.VersionNumber; + +import java.nio.file.Path; + +public class JavaToolchain implements Describable, JavaInstallationMetadata { + + private final JavaCompilerFactory compilerFactory; + private final ToolchainToolFactory toolFactory; + private final Directory javaHome; + private final VersionNumber implementationVersion; + private final JavaLanguageVersion javaVersion; + private final JvmInstallationMetadata metadata; + private final JavaToolchainInput input; + + public JavaToolchain(JvmInstallationMetadata metadata, JavaCompilerFactory compilerFactory, ToolchainToolFactory toolFactory, FileFactory fileFactory, JavaToolchainInput input) { + this.javaHome = fileFactory.dir(computeEnclosingJavaHome(metadata.getJavaHome()).toFile()); + this.javaVersion = JavaLanguageVersion.of(metadata.getLanguageVersion().getMajorVersion()); + this.compilerFactory = compilerFactory; + this.toolFactory = toolFactory; + this.implementationVersion = VersionNumber.withPatchNumber().parse(metadata.getImplementationVersion()); + this.metadata = metadata; + this.input = input; + } + + @Nested + protected JavaToolchainInput getTaskInputs() { + return input; + } + + @Internal + public JavaCompiler getJavaCompiler() { + return new DefaultToolchainJavaCompiler(this, compilerFactory); + } + + @Internal + public JavaLauncher getJavaLauncher() { + return new DefaultToolchainJavaLauncher(this); + } + + @Internal + public JavadocTool getJavadocTool() { + return toolFactory.create(JavadocTool.class, this); + } + + @Internal + public JavaLanguageVersion getLanguageVersion() { + return javaVersion; + } + + @Internal + @Override + public String getJavaRuntimeVersion() { + return metadata.getRuntimeVersion(); + } + + @Override + public String getJvmVersion() { + return metadata.getJvmVersion(); + } + + @Internal + public VersionNumber getToolVersion() { + return implementationVersion; + } + + @Internal + public Directory getInstallationPath() { + return javaHome; + } + + @Internal + public boolean isJdk() { + return metadata.hasCapability(JvmInstallationMetadata.JavaInstallationCapability.JAVA_COMPILER); + } + + @Internal + public JvmInstallationMetadata getMetadata() { + return metadata; + } + + @Override + public String getVendor() { + return metadata.getVendor().getDisplayName(); + } + + @Internal + @Override + public String getDisplayName() { + return javaHome.toString(); + } + + public RegularFile findExecutable(String toolname) { + return getInstallationPath().file(getBinaryPath(toolname)); + } + + private Path computeEnclosingJavaHome(Path home) { + final Path parentPath = home.getParent(); + final boolean isEmbeddedJre = home.getFileName().toString().equalsIgnoreCase("jre"); + if (isEmbeddedJre && parentPath.resolve(getBinaryPath("java")).toFile().exists()) { + return parentPath; + } + return home; + } + + private String getBinaryPath(String java) { + return "bin/" + OperatingSystem.current().getExecutableName(java); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-jvm/org/gradle/jvm/toolchain/internal/JavaToolchainInput.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-jvm/org/gradle/jvm/toolchain/internal/JavaToolchainInput.java new file mode 100644 index 0000000..49333bd --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-jvm/org/gradle/jvm/toolchain/internal/JavaToolchainInput.java @@ -0,0 +1,50 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.jvm.toolchain.internal; + +import org.gradle.api.tasks.Input; +import org.gradle.jvm.toolchain.JavaLanguageVersion; +import org.gradle.jvm.toolchain.JavaToolchainSpec; + +public class JavaToolchainInput { + + private final JavaLanguageVersion javaLanguageVersion; + private final String vendor; + private final String implementation; + + public JavaToolchainInput(JavaToolchainSpec spec) { + this.javaLanguageVersion = spec.getLanguageVersion().getOrNull(); + this.vendor = spec.getVendor().get().toString(); + this.implementation = spec.getImplementation().get().toString(); + } + + @Input + JavaLanguageVersion getLanguageVersion() { + return javaLanguageVersion; + } + + @Input + String getVendor() { + return vendor; + } + + @Input + String getImplementation() { + return implementation; + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/BuildTypeContainer.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/BuildTypeContainer.java new file mode 100644 index 0000000..9d1336e --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/BuildTypeContainer.java @@ -0,0 +1,27 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.nativeplatform; + +import org.gradle.api.Incubating; +import org.gradle.api.NamedDomainObjectContainer; + +/** + * A container of {@link BuildType}s. + */ +@Incubating +public interface BuildTypeContainer extends NamedDomainObjectContainer { +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/Linkage.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/Linkage.java new file mode 100644 index 0000000..3a28ed5 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/Linkage.java @@ -0,0 +1,41 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.nativeplatform; + +import org.gradle.api.Named; + +/** + * Specify how a native library should be linked into another binary. + * + * @since 4.5 + */ +public enum Linkage implements Named { + /** + * Statically link binaries together. + */ + STATIC, + + /** + * Dynamically link binaries together. + */ + SHARED; + + @Override + public String getName() { + return name(); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/NativeExecutableBinary.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/NativeExecutableBinary.java new file mode 100644 index 0000000..7597070 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/NativeExecutableBinary.java @@ -0,0 +1,31 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.nativeplatform; + +import org.gradle.api.Incubating; + +import java.io.File; + +/** + * A binary artifact for a {@link NativeExecutable}, targeted at a particular platform with specific configuration. + */ +@Incubating +public interface NativeExecutableBinary extends NativeBinary { + /** + * The executable file. + */ + File getExecutableFile(); +} \ No newline at end of file diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/NativeLibrarySpec.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/NativeLibrarySpec.java new file mode 100644 index 0000000..de0c034 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/NativeLibrarySpec.java @@ -0,0 +1,40 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.nativeplatform; + +import org.gradle.api.Incubating; +import org.gradle.platform.base.LibrarySpec; + +/** + * Definition of a native library component that is to be built by Gradle. + */ +@Incubating +public interface NativeLibrarySpec extends LibrarySpec, NativeComponentSpec, TargetedNativeComponent { + /** + * Converts this library to a native library requirement that uses the shared library variant. This is the default. + */ + NativeLibraryRequirement getShared(); + + /** + * Converts this library to a native library requirement that uses the static library variant. + */ + NativeLibraryRequirement getStatic(); + + /** + * Converts this library to a native library requirement that uses the api library linkage. + */ + NativeLibraryRequirement getApi(); +} \ No newline at end of file diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/internal/NativeExecutableBinarySpecInternal.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/internal/NativeExecutableBinarySpecInternal.java new file mode 100644 index 0000000..148f529 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/internal/NativeExecutableBinarySpecInternal.java @@ -0,0 +1,22 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.nativeplatform.internal; + +import org.gradle.nativeplatform.NativeExecutableBinarySpec; + +public interface NativeExecutableBinarySpecInternal extends NativeExecutableBinarySpec, NativeBinarySpecInternal { +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/tasks/ExtractSymbols.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/tasks/ExtractSymbols.java new file mode 100644 index 0000000..d160de1 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/tasks/ExtractSymbols.java @@ -0,0 +1,126 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.nativeplatform.tasks; + +import org.gradle.api.DefaultTask; +import org.gradle.api.file.RegularFileProperty; +import org.gradle.api.model.ObjectFactory; +import org.gradle.api.provider.Property; +import org.gradle.api.tasks.InputFile; +import org.gradle.api.tasks.Internal; +import org.gradle.api.tasks.Nested; +import org.gradle.api.tasks.OutputFile; +import org.gradle.api.tasks.PathSensitive; +import org.gradle.api.tasks.PathSensitivity; +import org.gradle.api.tasks.TaskAction; +import org.gradle.api.tasks.WorkResult; +import org.gradle.internal.Cast; +import org.gradle.internal.operations.logging.BuildOperationLogger; +import org.gradle.internal.operations.logging.BuildOperationLoggerFactory; +import org.gradle.language.base.internal.compile.Compiler; +import org.gradle.nativeplatform.internal.BuildOperationLoggingCompilerDecorator; +import org.gradle.nativeplatform.internal.DefaultSymbolExtractorSpec; +import org.gradle.nativeplatform.internal.SymbolExtractorSpec; +import org.gradle.nativeplatform.platform.NativePlatform; +import org.gradle.nativeplatform.platform.internal.NativePlatformInternal; +import org.gradle.nativeplatform.toolchain.NativeToolChain; +import org.gradle.nativeplatform.toolchain.internal.NativeToolChainInternal; +import org.gradle.nativeplatform.toolchain.internal.PlatformToolProvider; +import org.gradle.work.DisableCachingByDefault; + +/** + * Extracts the debug symbols from a binary and stores them in a separate file. + * + * @since 4.5 + */ +@DisableCachingByDefault(because = "Not made cacheable, yet") +public class ExtractSymbols extends DefaultTask { + private final RegularFileProperty binaryFile; + private final RegularFileProperty symbolFile; + private final Property targetPlatform; + private final Property toolChain; + + public ExtractSymbols() { + ObjectFactory objectFactory = getProject().getObjects(); + + this.binaryFile = objectFactory.fileProperty(); + this.symbolFile = objectFactory.fileProperty(); + this.targetPlatform = objectFactory.property(NativePlatform.class); + this.toolChain = objectFactory.property(NativeToolChain.class); + } + + /** + * The file to extract debug symbols from. + */ + @InputFile + @PathSensitive(PathSensitivity.NONE) + public RegularFileProperty getBinaryFile() { + return binaryFile; + } + + /** + * The destination file to extract debug symbols into. + */ + @OutputFile + public RegularFileProperty getSymbolFile() { + return symbolFile; + } + + /** + * The tool chain used for extracting symbols. + * + * @since 4.7 + */ + @Internal + public Property getToolChain() { + return toolChain; + } + + /** + * The platform for the binary. + * + * @since 4.7 + */ + @Nested + public Property getTargetPlatform() { + return targetPlatform; + } + + // TODO: Need to track version/implementation of symbol extraction tool. + + @TaskAction + protected void extractSymbols() { + BuildOperationLogger operationLogger = getServices().get(BuildOperationLoggerFactory.class).newOperationLogger(getName(), getTemporaryDir()); + + SymbolExtractorSpec spec = new DefaultSymbolExtractorSpec(); + spec.setBinaryFile(binaryFile.get().getAsFile()); + spec.setSymbolFile(symbolFile.get().getAsFile()); + spec.setOperationLogger(operationLogger); + + Compiler symbolExtractor = createCompiler(); + symbolExtractor = BuildOperationLoggingCompilerDecorator.wrap(symbolExtractor); + WorkResult result = symbolExtractor.execute(spec); + setDidWork(result.getDidWork()); + } + + private Compiler createCompiler() { + NativePlatformInternal targetPlatform = Cast.cast(NativePlatformInternal.class, this.targetPlatform.get()); + NativeToolChainInternal toolChain = Cast.cast(NativeToolChainInternal.class, getToolChain().get()); + PlatformToolProvider toolProvider = toolChain.select(targetPlatform); + return toolProvider.newCompiler(SymbolExtractorSpec.class); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/toolchain/internal/ExecutableTools.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/toolchain/internal/ExecutableTools.java new file mode 100644 index 0000000..e0360fa --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/toolchain/internal/ExecutableTools.java @@ -0,0 +1,37 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.nativeplatform.toolchain.internal; + +import org.gradle.util.internal.VersionNumber; + +import java.io.File; +import java.util.List; + +/** + * A collection of tools. + */ +public interface ExecutableTools { + /** + * Returns the implementation version of these tools. + */ + VersionNumber getImplementationVersion(); + + /** + * Returns the path entries that must be present in order to use these tools, possibly none. + */ + List getPath(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/toolchain/internal/OutputCleaningCompiler.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/toolchain/internal/OutputCleaningCompiler.java new file mode 100644 index 0000000..e44b9b2 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/toolchain/internal/OutputCleaningCompiler.java @@ -0,0 +1,74 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.nativeplatform.toolchain.internal; + +import org.gradle.api.tasks.WorkResult; +import org.gradle.api.tasks.WorkResults; +import org.gradle.language.base.internal.compile.Compiler; +import org.gradle.nativeplatform.internal.CompilerOutputFileNamingSchemeFactory; + +import java.io.File; + +public class OutputCleaningCompiler implements Compiler { + + private final Compiler compiler; + private final String outputFileSuffix; + private final CompilerOutputFileNamingSchemeFactory compilerOutputFileNamingSchemeFactory; + + public OutputCleaningCompiler(Compiler compiler, CompilerOutputFileNamingSchemeFactory compilerOutputFileNamingSchemeFactory, String outputFileSuffix) { + this.compiler = compiler; + this.compilerOutputFileNamingSchemeFactory = compilerOutputFileNamingSchemeFactory; + this.outputFileSuffix = outputFileSuffix; + } + + @Override + public WorkResult execute(T spec) { + boolean didRemove = deleteOutputsForRemovedSources(spec); + boolean didCompile = compileSources(spec); + return WorkResults.didWork(didRemove || didCompile); + } + + private boolean compileSources(T spec) { + if (spec.getSourceFiles().isEmpty()) { + return false; + } + return compiler.execute(spec).getDidWork(); + } + + private boolean deleteOutputsForRemovedSources(NativeCompileSpec spec) { + boolean didRemove = false; + for (File removedSource : spec.getRemovedSourceFiles()) { + File objectFile = getObjectFile(spec.getObjectFileDir(), removedSource); + + // Remove .pdb file if present + new File(objectFile.getParentFile(), objectFile.getName() + ".pdb").delete(); + + if (objectFile.delete()) { + didRemove = true; + objectFile.getParentFile().delete(); + } + } + return didRemove; + } + + private File getObjectFile(File objectFileRoot, File sourceFile) { + return compilerOutputFileNamingSchemeFactory.create() + .withObjectFileNameSuffix(outputFileSuffix) + .withOutputBaseFolder(objectFileRoot) + .map(sourceFile); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/toolchain/internal/msvcpp/LibExeStaticLibraryArchiver.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/toolchain/internal/msvcpp/LibExeStaticLibraryArchiver.java new file mode 100644 index 0000000..2e1cc89 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/platform-native/org/gradle/nativeplatform/toolchain/internal/msvcpp/LibExeStaticLibraryArchiver.java @@ -0,0 +1,85 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.nativeplatform.toolchain.internal.msvcpp; + +import org.gradle.api.Action; +import org.gradle.api.Transformer; +import org.gradle.api.tasks.WorkResult; +import org.gradle.internal.operations.BuildOperationExecutor; +import org.gradle.internal.operations.BuildOperationQueue; +import org.gradle.internal.work.WorkerLeaseService; +import org.gradle.nativeplatform.internal.StaticLibraryArchiverSpec; +import org.gradle.nativeplatform.toolchain.internal.AbstractCompiler; +import org.gradle.nativeplatform.toolchain.internal.ArgsTransformer; +import org.gradle.nativeplatform.toolchain.internal.CommandLineToolContext; +import org.gradle.nativeplatform.toolchain.internal.CommandLineToolInvocation; +import org.gradle.nativeplatform.toolchain.internal.CommandLineToolInvocationWorker; + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import static org.gradle.nativeplatform.toolchain.internal.msvcpp.EscapeUserArgs.escapeUserArgs; + +class LibExeStaticLibraryArchiver extends AbstractCompiler { + private final Transformer specTransformer; + + LibExeStaticLibraryArchiver(BuildOperationExecutor buildOperationExecutor, CommandLineToolInvocationWorker commandLineToolInvocationWorker, CommandLineToolContext invocationContext, Transformer specTransformer, WorkerLeaseService workerLeaseService) { + super(buildOperationExecutor, commandLineToolInvocationWorker, invocationContext, new LibExeSpecToArguments(), true, workerLeaseService); + this.specTransformer = specTransformer; + } + + @Override + public WorkResult execute(final StaticLibraryArchiverSpec spec) { + final StaticLibraryArchiverSpec transformedSpec = specTransformer.transform(spec); + + return super.execute(transformedSpec); + } + + @Override + protected Action> newInvocationAction(final StaticLibraryArchiverSpec spec, List args) { + final CommandLineToolInvocation invocation = newInvocation( + "archiving " + spec.getOutputFile().getName(), spec.getOutputFile().getParentFile(), args, spec.getOperationLogger()); + + return new Action>() { + @Override + public void execute(BuildOperationQueue buildQueue) { + buildQueue.setLogLocation(spec.getOperationLogger().getLogLocation()); + buildQueue.add(invocation); + } + }; + } + + @Override + protected void addOptionsFileArgs(List args, File tempDir) { + new VisualCppOptionsFileArgsWriter(tempDir).execute(args); + } + + private static class LibExeSpecToArguments implements ArgsTransformer { + @Override + public List transform(StaticLibraryArchiverSpec spec) { + List args = new ArrayList(); + args.add("/OUT:" + spec.getOutputFile().getAbsolutePath()); + args.add("/NOLOGO"); + args.addAll(escapeUserArgs(spec.getAllArgs())); + for (File file : spec.getObjectFiles()) { + args.add(file.getAbsolutePath()); + } + return args; + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/plugin-use/org/gradle/plugin/management/internal/DefaultPluginResolutionStrategy.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/plugin-use/org/gradle/plugin/management/internal/DefaultPluginResolutionStrategy.java new file mode 100644 index 0000000..94bea77 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/plugin-use/org/gradle/plugin/management/internal/DefaultPluginResolutionStrategy.java @@ -0,0 +1,74 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.plugin.management.internal; + +import com.google.common.collect.Maps; +import org.gradle.api.Action; +import org.gradle.api.invocation.Gradle; +import org.gradle.internal.InternalBuildAdapter; +import org.gradle.internal.MutableActionSet; +import org.gradle.internal.event.ListenerManager; +import org.gradle.plugin.management.PluginResolveDetails; +import org.gradle.plugin.use.PluginId; + +import java.util.Map; + +public class DefaultPluginResolutionStrategy implements PluginResolutionStrategyInternal { + + private final MutableActionSet resolutionRules = new MutableActionSet(); + private final Map pluginVersions = Maps.newHashMap(); + private boolean locked; + + public DefaultPluginResolutionStrategy(ListenerManager listenerManager) { + listenerManager.addListener(new InternalBuildAdapter(){ + @Override + public void projectsLoaded(Gradle gradle) { + locked = true; + } + }); + } + + @Override + public void eachPlugin(Action rule) { + if (locked) { + throw new IllegalStateException("Cannot change the plugin resolution strategy after projects have been loaded."); + } + resolutionRules.add(rule); + } + + @Override + public PluginRequestInternal applyTo(PluginRequestInternal pluginRequest) { + DefaultPluginResolveDetails details = new DefaultPluginResolveDetails(pluginRequest); + if (details.getRequested().getVersion() == null) { + String version = pluginVersions.get(details.getRequested().getId()); + if (version != null) { + details.useVersion(version); + } + } + resolutionRules.execute(details); + return details.getTarget(); + } + + @Override + public void setDefaultPluginVersion(PluginId id, String version) { + String existing = pluginVersions.get(id); + if (existing != null && !existing.equals(version)) { + throw new IllegalArgumentException("Cannot provide multiple default versions for the same plugin."); + } + pluginVersions.put(id, version); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/plugins/org/gradle/api/internal/tasks/DefaultGroovySourceSet.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/plugins/org/gradle/api/internal/tasks/DefaultGroovySourceSet.java new file mode 100644 index 0000000..2be700f --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/plugins/org/gradle/api/internal/tasks/DefaultGroovySourceSet.java @@ -0,0 +1,76 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.tasks; + +import groovy.lang.Closure; +import org.gradle.api.Action; +import org.gradle.api.file.SourceDirectorySet; +import org.gradle.api.model.ObjectFactory; +import org.gradle.api.reflect.HasPublicType; +import org.gradle.api.reflect.TypeOf; +import org.gradle.api.tasks.GroovySourceDirectorySet; +import org.gradle.api.tasks.GroovySourceSet; + +import javax.annotation.Nullable; + +import static org.gradle.api.reflect.TypeOf.typeOf; +import static org.gradle.util.internal.ConfigureUtil.configure; + +@Deprecated +public class DefaultGroovySourceSet implements GroovySourceSet, HasPublicType { + private final GroovySourceDirectorySet groovy; + private final SourceDirectorySet allGroovy; + + public DefaultGroovySourceSet(String name, String displayName, ObjectFactory objectFactory) { + this.groovy = createGroovySourceDirectorySet(name, displayName, objectFactory); + allGroovy = objectFactory.sourceDirectorySet("all" + name, displayName + " Groovy source"); + allGroovy.source(groovy); + allGroovy.getFilter().include("**/*.groovy"); + } + + private static GroovySourceDirectorySet createGroovySourceDirectorySet(String name, String displayName, ObjectFactory objectFactory) { + GroovySourceDirectorySet groovySourceDirectorySet = new DefaultGroovySourceDirectorySet(objectFactory.sourceDirectorySet(name, displayName + " Groovy source")); + groovySourceDirectorySet.getFilter().include("**/*.java", "**/*.groovy"); + return groovySourceDirectorySet; + } + + @Override + public GroovySourceDirectorySet getGroovy() { + return groovy; + } + + @Override + public GroovySourceSet groovy(@Nullable Closure configureClosure) { + configure(configureClosure, getGroovy()); + return this; + } + + @Override + public GroovySourceSet groovy(Action configureAction) { + configureAction.execute(getGroovy()); + return this; + } + + @Override + public SourceDirectorySet getAllGroovy() { + return allGroovy; + } + + @Override + public TypeOf getPublicType() { + return typeOf(GroovySourceSet.class); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/plugins/org/gradle/api/internal/tasks/package-info.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/plugins/org/gradle/api/internal/tasks/package-info.java new file mode 100644 index 0000000..760d1d6 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/plugins/org/gradle/api/internal/tasks/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +@NonNullApi +package org.gradle.api.internal.tasks; + +import org.gradle.api.NonNullApi; diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/plugins/org/gradle/jvm/application/tasks/package-info.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/plugins/org/gradle/jvm/application/tasks/package-info.java new file mode 100644 index 0000000..9889d1e --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/plugins/org/gradle/jvm/application/tasks/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Tasks for the JVM application plugin. + */ +package org.gradle.jvm.application.tasks; \ No newline at end of file diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/publish/org/gradle/api/publish/internal/PublicationArtifactSet.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/publish/org/gradle/api/publish/internal/PublicationArtifactSet.java new file mode 100644 index 0000000..fd653d4 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/publish/org/gradle/api/publish/internal/PublicationArtifactSet.java @@ -0,0 +1,25 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.publish.internal; + +import org.gradle.api.DomainObjectSet; +import org.gradle.api.file.FileCollection; +import org.gradle.api.publish.PublicationArtifact; + +public interface PublicationArtifactSet extends DomainObjectSet { + FileCollection getFiles(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/publish/org/gradle/api/publish/internal/PublicationFieldValidator.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/publish/org/gradle/api/publish/internal/PublicationFieldValidator.java new file mode 100644 index 0000000..c25813d --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/publish/org/gradle/api/publish/internal/PublicationFieldValidator.java @@ -0,0 +1,85 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.publish.internal; + +import org.gradle.api.InvalidUserDataException; + +public abstract class PublicationFieldValidator> { + private final Class type; + protected final String publicationName; + protected final String name; + protected final String value; + + public PublicationFieldValidator(Class type, String publicationName, String name, String value) { + this.type = type; + this.publicationName = publicationName; + this.name = name; + this.value = value; + } + + public T notNull() { + if (value == null) { + String message = String.format("%s cannot be null.", name); + throw failure(message); + } + return type.cast(this); + } + + public T notEmpty() { + notNull(); + if (value.length() == 0) { + throw failure(String.format("%s cannot be empty.", name)); + } + return type.cast(this); + } + + public T validInFileName() { + if (value == null || value.length() == 0) { + return type.cast(this); + } + doesNotContainSpecialCharacters(false); + return type.cast(this); + } + + public T doesNotContainSpecialCharacters(boolean allowSlash) { + if (value == null || value.length() == 0) { + return type.cast(this); + } + // Iterate over unicode characters + int offset = 0; + while (offset < value.length()) { + final int unicodeChar = value.codePointAt(offset); + if (Character.isISOControl(unicodeChar)) { + throw failure(String.format("%s cannot contain ISO control character '\\u%04x'.", name, unicodeChar)); + } + if ('\\' == unicodeChar || ('/' == unicodeChar && !allowSlash)) { + throw failure(String.format("%s cannot contain '%c'.", name, (char) unicodeChar)); + } + offset += Character.charCount(unicodeChar); + } + return type.cast(this); + } + + public T optionalNotEmpty() { + if (value != null && value.length() == 0) { + throw failure(String.format("%s cannot be an empty string. Use null instead.", name)); + } + return type.cast(this); + } + + protected abstract InvalidUserDataException failure(String message); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/resources-gcs/org/gradle/internal/resource/transport/gcp/gcs/ResourceMapper.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/resources-gcs/org/gradle/internal/resource/transport/gcp/gcs/ResourceMapper.java new file mode 100644 index 0000000..51a6ae8 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/resources-gcs/org/gradle/internal/resource/transport/gcp/gcs/ResourceMapper.java @@ -0,0 +1,41 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.resource.transport.gcp.gcs; + +import com.google.api.services.storage.model.StorageObject; +import org.gradle.internal.resource.metadata.DefaultExternalResourceMetaData; +import org.gradle.internal.resource.metadata.ExternalResourceMetaData; + +import java.net.URI; + +final class ResourceMapper { + + static ExternalResourceMetaData toExternalResourceMetaData(URI uri, StorageObject storageObject) { + return new DefaultExternalResourceMetaData( + uri, + storageObject.getUpdated().getValue(), + storageObject.getSize().longValue(), + storageObject.getContentType(), + storageObject.getEtag(), + null // we cannot use md5 instead of sha1 here because cache will get corrupted due to its expectation of sha1 hashes + ); + } + + private ResourceMapper() { + throw new AssertionError("No instances"); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/resources-s3/org/gradle/internal/resource/transport/aws/s3/S3ConnectionProperties.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/resources-s3/org/gradle/internal/resource/transport/aws/s3/S3ConnectionProperties.java new file mode 100644 index 0000000..091b552 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/resources-s3/org/gradle/internal/resource/transport/aws/s3/S3ConnectionProperties.java @@ -0,0 +1,117 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.resource.transport.aws.s3; + +import com.google.common.base.Optional; +import com.google.common.collect.Sets; +import com.google.common.primitives.Ints; +import org.apache.commons.lang.StringUtils; +import org.gradle.internal.resource.transport.http.HttpProxySettings; +import org.gradle.internal.resource.transport.http.JavaSystemPropertiesHttpProxySettings; +import org.gradle.internal.resource.transport.http.JavaSystemPropertiesSecureHttpProxySettings; + +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Set; + +import static com.amazonaws.services.s3.internal.Constants.S3_HOSTNAME; +import static java.lang.System.getProperty; + +public class S3ConnectionProperties { + public static final String S3_ENDPOINT_PROPERTY = "org.gradle.s3.endpoint"; + //The maximum number of times to retry a request when S3 responds with a http 5xx error + public static final String S3_MAX_ERROR_RETRY = "org.gradle.s3.maxErrorRetry"; + private static final Set SUPPORTED_SCHEMES = Sets.newHashSet("HTTP", "HTTPS"); + private static final long DEFAULT_PART_SIZE = 50 * 1024 * 1024; + + private final Optional endpoint; + private final HttpProxySettings proxySettings; + private final HttpProxySettings secureProxySettings; + private final Optional maxErrorRetryCount; + private final long partSize; + + public S3ConnectionProperties() { + endpoint = configureEndpoint(getProperty(S3_ENDPOINT_PROPERTY)); + proxySettings = new JavaSystemPropertiesHttpProxySettings(); + secureProxySettings = new JavaSystemPropertiesSecureHttpProxySettings(); + maxErrorRetryCount = configureErrorRetryCount(getProperty(S3_MAX_ERROR_RETRY)); + partSize = DEFAULT_PART_SIZE; + } + + public S3ConnectionProperties(HttpProxySettings proxySettings, HttpProxySettings secureProxySettings, URI endpoint, Integer maxErrorRetryCount) { + this.endpoint = Optional.fromNullable(endpoint); + this.proxySettings = proxySettings; + this.secureProxySettings = secureProxySettings; + this.maxErrorRetryCount = Optional.fromNullable(maxErrorRetryCount); + this.partSize = DEFAULT_PART_SIZE; + } + + private Optional configureEndpoint(String property) { + URI uri = null; + if (StringUtils.isNotBlank(property)) { + try { + uri = new URI(property); + if (StringUtils.isBlank(uri.getScheme()) || !SUPPORTED_SCHEMES.contains(uri.getScheme().toUpperCase())) { + throw new IllegalArgumentException("System property [" + S3_ENDPOINT_PROPERTY + "=" + property + "] must have a scheme of 'http' or 'https'"); + } + } catch (URISyntaxException e) { + throw new IllegalArgumentException("System property [" + S3_ENDPOINT_PROPERTY + "=" + property + "] must be a valid URI"); + } + } + return Optional.fromNullable(uri); + } + + public Optional getEndpoint() { + return endpoint; + } + + public Optional getProxy() { + if (endpoint.isPresent()) { + String host = endpoint.get().getHost(); + if (endpoint.get().getScheme().toUpperCase().equals("HTTP")) { + return Optional.fromNullable(proxySettings.getProxy(host)); + } else { + return Optional.fromNullable(secureProxySettings.getProxy(host)); + } + } + return Optional.fromNullable(secureProxySettings.getProxy(S3_HOSTNAME)); + } + + private Optional configureErrorRetryCount(String property) { + Integer count = null; + if (null != property) { + count = Ints.tryParse(property); + if (null == count || count < 0) { + throw new IllegalArgumentException("System property [" + S3_MAX_ERROR_RETRY + "=" + property + "] must be a valid positive Integer"); + + } + } + return Optional.fromNullable(count); + } + + public Optional getMaxErrorRetryCount() { + return maxErrorRetryCount; + } + + public long getPartSize() { + return partSize; + } + + public long getMultipartThreshold() { + return partSize * 2; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/resources-s3/org/gradle/internal/resource/transport/aws/s3/S3ConnectorFactory.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/resources-s3/org/gradle/internal/resource/transport/aws/s3/S3ConnectorFactory.java new file mode 100644 index 0000000..d964e88 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/resources-s3/org/gradle/internal/resource/transport/aws/s3/S3ConnectorFactory.java @@ -0,0 +1,69 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.resource.transport.aws.s3; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; + +import org.gradle.api.credentials.AwsCredentials; +import org.gradle.authentication.Authentication; +import org.gradle.authentication.aws.AwsImAuthentication; +import org.gradle.internal.authentication.AllSchemesAuthentication; +import org.gradle.internal.resource.connector.ResourceConnectorFactory; +import org.gradle.internal.resource.connector.ResourceConnectorSpecification; +import org.gradle.internal.resource.transfer.ExternalResourceConnector; + +public class S3ConnectorFactory implements ResourceConnectorFactory { + @Override + public Set getSupportedProtocols() { + return Collections.singleton("s3"); + } + + @Override + public Set> getSupportedAuthentication() { + Set> supported = new HashSet>(); + supported.add(AwsImAuthentication.class); + supported.add(AllSchemesAuthentication.class); + return supported; + } + + @Override + public ExternalResourceConnector createResourceConnector(ResourceConnectorSpecification connectionDetails) { + Collection authentications = connectionDetails.getAuthentications(); + // Since s3 transport supports only one type of credentials at a time, let's use the first one found. + for (Authentication authentication : authentications) { + // We get only the first element here, nothing else. But Collection + // forces us to use an iterator. + if (authentication instanceof AllSchemesAuthentication) { + // First things first, retro compatibility + AwsCredentials awsCredentials = connectionDetails.getCredentials(AwsCredentials.class); + if (awsCredentials == null) { + throw new IllegalArgumentException("AwsCredentials must be set for S3 backed repository."); + } + return new S3ResourceConnector(new S3Client(awsCredentials, new S3ConnectionProperties())); + } + + if (authentication instanceof AwsImAuthentication) { + return new S3ResourceConnector(new S3Client(new S3ConnectionProperties())); + } + } + + throw new IllegalArgumentException("S3 resource should either specify AwsImAuthentication or provide some AwsCredentials."); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/scala/org/gradle/api/internal/tasks/DefaultScalaSourceDirectorySet.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/scala/org/gradle/api/internal/tasks/DefaultScalaSourceDirectorySet.java new file mode 100644 index 0000000..be9df49 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/scala/org/gradle/api/internal/tasks/DefaultScalaSourceDirectorySet.java @@ -0,0 +1,28 @@ +/* + * Copyright 2021 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks; + +import org.gradle.api.file.SourceDirectorySet; +import org.gradle.api.internal.file.DefaultSourceDirectorySet; +import org.gradle.api.tasks.ScalaSourceDirectorySet; + +public class DefaultScalaSourceDirectorySet extends DefaultSourceDirectorySet implements ScalaSourceDirectorySet { + + public DefaultScalaSourceDirectorySet(SourceDirectorySet sourceDirectorySet) { + super(sourceDirectorySet); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/signing/org/gradle/plugins/signing/signatory/package-info.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/signing/org/gradle/plugins/signing/signatory/package-info.java new file mode 100644 index 0000000..601f90c --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/signing/org/gradle/plugins/signing/signatory/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * The signing plugin signatory types. + */ +package org.gradle.plugins.signing.signatory; diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/snapshots/org/gradle/internal/snapshot/ChildMapFactory.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/snapshots/org/gradle/internal/snapshot/ChildMapFactory.java new file mode 100644 index 0000000..61cded9 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/snapshots/org/gradle/internal/snapshot/ChildMapFactory.java @@ -0,0 +1,62 @@ +/* + * Copyright 2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.internal.snapshot; + +import com.google.common.collect.ImmutableList; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Comparator; +import java.util.List; + +public class ChildMapFactory { + /** + * If a node has fewer children, we use a linear search for the child. + * We use this limit since {@link VfsRelativePath#compareToFirstSegment(String, CaseSensitivity)} + * is about twice as slow as {@link VfsRelativePath#hasPrefix(String, CaseSensitivity)}, + * so comparing the searched path to all of the children is actually faster than doing a binary search. + */ + private static final int MINIMUM_CHILD_COUNT_FOR_BINARY_SEARCH = 10; + + public static ChildMap childMap(CaseSensitivity caseSensitivity, Collection> entries) { + List> sortedEntries = new ArrayList<>(entries); + sortedEntries.sort(Comparator.comparing(ChildMap.Entry::getPath, PathUtil.getPathComparator(caseSensitivity))); + return childMapFromSorted(sortedEntries); + } + + public static ChildMap childMapFromSorted(List> sortedEntries) { + int size = sortedEntries.size(); + switch (size) { + case 0: + return EmptyChildMap.getInstance(); + case 1: + return new SingletonChildMap<>(sortedEntries.get(0)); + default: + return (size < MINIMUM_CHILD_COUNT_FOR_BINARY_SEARCH) + ? new MediumChildMap<>(sortedEntries) + : new LargeChildMap<>(sortedEntries); + } + } + + static ChildMap childMap(CaseSensitivity caseSensitivity, ChildMap.Entry entry1, ChildMap.Entry entry2) { + int compared = PathUtil.getPathComparator(caseSensitivity).compare(entry1.getPath(), entry2.getPath()); + List> sortedEntries = compared < 0 + ? ImmutableList.of(entry1, entry2) + : ImmutableList.of(entry2, entry1); + return childMapFromSorted(sortedEntries); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/internal/tasks/testing/DefaultTestClassRunInfo.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/internal/tasks/testing/DefaultTestClassRunInfo.java new file mode 100644 index 0000000..d2f554e --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/internal/tasks/testing/DefaultTestClassRunInfo.java @@ -0,0 +1,59 @@ +/* + * Copyright 2009 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.tasks.testing; + +import org.apache.commons.lang.StringUtils; + +public class DefaultTestClassRunInfo implements TestClassRunInfo { + private String testClassName; + + public DefaultTestClassRunInfo(String testClassName) { + if (StringUtils.isEmpty(testClassName)) { + throw new IllegalArgumentException("testClassName is empty!"); + } + + this.testClassName = testClassName; + } + + @Override + public String getTestClassName() { + return testClassName; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + DefaultTestClassRunInfo that = (DefaultTestClassRunInfo) o; + + return testClassName.equals(that.testClassName); + } + + @Override + public int hashCode() { + return testClassName.hashCode(); + } + + @Override + public String toString() { + return "DefaultTestClassRunInfo(" + testClassName + ')'; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/internal/tasks/testing/TestingBasePluginServiceRegistry.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/internal/tasks/testing/TestingBasePluginServiceRegistry.java new file mode 100644 index 0000000..8703618 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/internal/tasks/testing/TestingBasePluginServiceRegistry.java @@ -0,0 +1,30 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.testing; + +import org.gradle.api.internal.tasks.testing.operations.TestExecutionBuildOperationBuildSessionScopeServices; +import org.gradle.internal.service.ServiceRegistration; +import org.gradle.internal.service.scopes.AbstractPluginServiceRegistry; + +public class TestingBasePluginServiceRegistry extends AbstractPluginServiceRegistry { + + @Override + public void registerBuildSessionServices(ServiceRegistration registration) { + registration.addProvider(new TestExecutionBuildOperationBuildSessionScopeServices()); + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/internal/tasks/testing/junit/result/TestResultsProvider.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/internal/tasks/testing/junit/result/TestResultsProvider.java new file mode 100644 index 0000000..f63bf37 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/internal/tasks/testing/junit/result/TestResultsProvider.java @@ -0,0 +1,52 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.testing.junit.result; + +import org.gradle.api.Action; +import org.gradle.api.tasks.testing.TestOutputEvent; + +import java.io.Closeable; +import java.io.Writer; + +public interface TestResultsProvider extends Closeable { + /** + * Writes the output of the given test to the given writer. This method must be called only after {@link #visitClasses(org.gradle.api.Action)}. + * + * Writes all output for the test class. + */ + void writeAllOutput(long classId, TestOutputEvent.Destination destination, Writer writer); + + void writeNonTestOutput(long classId, TestOutputEvent.Destination destination, Writer writer); + + /** + * Writes the output of the given test to the given writer. This method must be called only after {@link #visitClasses(org.gradle.api.Action)}. + * + * Write all output for the given test case name of the test class. + */ + void writeTestOutput(long classId, long testId, TestOutputEvent.Destination destination, Writer writer); + + /** + * Visits the results of each test class, in no specific order. Each class is visited exactly once. + */ + void visitClasses(Action visitor); + + boolean hasOutput(long classId, TestOutputEvent.Destination destination); + + boolean hasOutput(long classId, long testId, TestOutputEvent.Destination destination); + + boolean isHasResults(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/internal/tasks/testing/logging/ShortExceptionFormatter.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/internal/tasks/testing/logging/ShortExceptionFormatter.java new file mode 100644 index 0000000..8357b61 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/internal/tasks/testing/logging/ShortExceptionFormatter.java @@ -0,0 +1,69 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.testing.logging; + +import com.google.common.base.Strings; +import org.gradle.api.tasks.testing.TestDescriptor; +import org.gradle.api.tasks.testing.logging.TestLogging; +import org.gradle.internal.serialize.PlaceholderExceptionSupport; + +import java.util.List; + +public class ShortExceptionFormatter implements TestExceptionFormatter { + private static final String INDENT = " "; + + private final TestLogging testLogging; + + public ShortExceptionFormatter(TestLogging testLogging) { + this.testLogging = testLogging; + } + + @Override + public String format(TestDescriptor descriptor, List exceptions) { + StringBuilder builder = new StringBuilder(); + for (Throwable exception : exceptions) { + printException(descriptor, exception, false, 1, builder); + } + return builder.toString(); + } + + private void printException(TestDescriptor descriptor, Throwable exception, boolean cause, int indentLevel, StringBuilder builder) { + String indent = Strings.repeat(INDENT, indentLevel); + builder.append(indent); + if (cause) { + builder.append("Caused by: "); + } + String className = exception instanceof PlaceholderExceptionSupport + ? ((PlaceholderExceptionSupport) exception).getExceptionClassName() : exception.getClass().getName(); + builder.append(className); + + StackTraceFilter filter = new StackTraceFilter(new ClassMethodNameStackTraceSpec(descriptor.getClassName(), null)); + List stackTrace = filter.filter(exception); + if (stackTrace.size() > 0) { + StackTraceElement element = stackTrace.get(0); + builder.append(" at "); + builder.append(element.getFileName()); + builder.append(':'); + builder.append(element.getLineNumber()); + } + builder.append('\n'); + + if (testLogging.getShowCauses() && exception.getCause() != null) { + printException(descriptor, exception.getCause(), true, indentLevel + 1, builder); + } + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/internal/tasks/testing/report/CompositeTestResults.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/internal/tasks/testing/report/CompositeTestResults.java new file mode 100644 index 0000000..e10953d --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/internal/tasks/testing/report/CompositeTestResults.java @@ -0,0 +1,158 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.tasks.testing.report; + +import java.math.BigDecimal; +import java.math.RoundingMode; +import java.util.Set; +import java.util.TreeSet; + +import static org.gradle.api.tasks.testing.TestResult.ResultType; + +public abstract class CompositeTestResults extends TestResultModel { + private final CompositeTestResults parent; + private int tests; + private final Set failures = new TreeSet(); + private final Set ignored = new TreeSet(); + private long duration; + + protected CompositeTestResults(CompositeTestResults parent) { + this.parent = parent; + } + + public CompositeTestResults getParent() { + return parent; + } + + public abstract String getBaseUrl(); + + public String getUrlTo(CompositeTestResults model) { + String otherUrl = model.getBaseUrl(); + String thisUrl = getBaseUrl(); + + int maxPos = Math.min(thisUrl.length(), otherUrl.length()); + int endPrefix = 0; + while (endPrefix < maxPos) { + int endA = thisUrl.indexOf('/', endPrefix); + int endB = otherUrl.indexOf('/', endPrefix); + if (endA != endB || endA < 0) { + break; + } + if (!thisUrl.regionMatches(endPrefix, otherUrl, endPrefix, endA - endPrefix)) { + break; + } + endPrefix = endA + 1; + } + + StringBuilder result = new StringBuilder(); + int endA = endPrefix; + while (endA < thisUrl.length()) { + int pos = thisUrl.indexOf('/', endA); + if (pos < 0) { + break; + } + result.append("../"); + endA = pos + 1; + } + result.append(otherUrl.substring(endPrefix)); + + return result.toString(); + } + + public int getTestCount() { + return tests; + } + + public int getFailureCount() { + return failures.size(); + } + + public int getIgnoredCount() { + return ignored.size(); + } + + public int getRunTestCount() { + return tests - getIgnoredCount(); + } + + @Override + public long getDuration() { + return duration; + } + + @Override + public String getFormattedDuration() { + return getTestCount() == 0 ? "-" : super.getFormattedDuration(); + } + + public Set getFailures() { + return failures; + } + + public Set getIgnored() { + return ignored; + } + + @Override + public ResultType getResultType() { + if (!failures.isEmpty()) { + return ResultType.FAILURE; + } + if (getIgnoredCount() > 0) { + return ResultType.SKIPPED; + } + return ResultType.SUCCESS; + } + + public String getFormattedSuccessRate() { + Number successRate = getSuccessRate(); + if (successRate == null) { + return "-"; + } + return successRate + "%"; + } + + public Number getSuccessRate() { + if (getRunTestCount() == 0) { + return null; + } + + BigDecimal runTests = BigDecimal.valueOf(getRunTestCount()); + BigDecimal successful = BigDecimal.valueOf(getRunTestCount() - getFailureCount()); + + return successful.divide(runTests, 2, RoundingMode.DOWN).multiply(BigDecimal.valueOf(100)).intValue(); + } + + protected void failed(TestResult failedTest) { + failures.add(failedTest); + if (parent != null) { + parent.failed(failedTest); + } + } + + protected void ignored(TestResult ignoredTest) { + ignored.add(ignoredTest); + if (parent != null) { + parent.ignored(ignoredTest); + } + } + + protected TestResult addTest(TestResult test) { + tests++; + duration += test.getDuration(); + return test; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/internal/tasks/testing/report/LocaleSafeDecimalFormat.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/internal/tasks/testing/report/LocaleSafeDecimalFormat.java new file mode 100644 index 0000000..f604e53 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/internal/tasks/testing/report/LocaleSafeDecimalFormat.java @@ -0,0 +1,39 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.api.internal.tasks.testing.report; + +import java.math.BigDecimal; +import java.text.DecimalFormat; +import java.text.DecimalFormatSymbols; +import java.text.ParseException; + +public class LocaleSafeDecimalFormat { + + /** + * Regardless of the default locale, comma ('.') is used as decimal separator + * + * @param source + * @return + * @throws ParseException + */ + public BigDecimal parse(String source) throws ParseException { + DecimalFormatSymbols symbols = new DecimalFormatSymbols(); + symbols.setDecimalSeparator('.'); + DecimalFormat format = new DecimalFormat("#.#", symbols); + format.setParseBigDecimal(true); + return (BigDecimal) format.parse(source); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/tasks/testing/JUnitXmlReport.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/tasks/testing/JUnitXmlReport.java new file mode 100644 index 0000000..c5439ad --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/tasks/testing/JUnitXmlReport.java @@ -0,0 +1,60 @@ +/* + * Copyright 2013 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.tasks.testing; + +import org.gradle.api.provider.Property; +import org.gradle.api.reporting.DirectoryReport; +import org.gradle.api.tasks.Input; + +/** + * The JUnit XML files, commonly used to communicate results to CI servers. + * + * @see TestTaskReports#getJunitXml() + */ +public interface JUnitXmlReport extends DirectoryReport { + + /** + * Should the output be associated with individual test cases instead of at the suite level. + */ + @Input + boolean isOutputPerTestCase(); + + /** + * Should the output be associated with individual test cases instead of at the suite level. + */ + void setOutputPerTestCase(boolean outputPerTestCase); + + /** + * Whether reruns or retries of a test should be merged into a combined testcase. + * + * When enabled, the XML output will be very similar to the surefire plugin of Apache Maven™ when enabling reruns. + * If a test fails but is then retried and succeeds, its failures will be recorded as {@code } + * instead of {@code }, within one {@code }. + * This can be important for build tooling that uses this XML to understand test results, + * and where distinguishing such passed-on-retry outcomes is important. + * This is the case for the Jenkins CI server and its Flaky Test Handler plugin. + * + * This value defaults to {@code false}, causing each test execution to be a discrete {@code }. + * + * @see https://maven.apache.org/components/surefire/maven-surefire-plugin/examples/rerun-failing-tests.html + * @see https://plugins.jenkins.io/flaky-test-handler + * @since 6.8 + */ + @Input + Property getMergeReruns(); + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/tasks/testing/logging/TestLoggingContainer.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/tasks/testing/logging/TestLoggingContainer.java new file mode 100644 index 0000000..2c5a3e9 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/api/tasks/testing/logging/TestLoggingContainer.java @@ -0,0 +1,187 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.tasks.testing.logging; + +import org.gradle.api.Action; +import org.gradle.api.logging.LogLevel; + +/** + * Container for all test logging related options. Different options + * can be set for each log level. Options that are set directly (without + * specifying a log level) apply to log level LIFECYCLE. Example: + * + *
+ * apply plugin: 'java'
+ *
+ * test {
+ *     testLogging {
+ *         // set options for log level LIFECYCLE
+ *         events "failed"
+ *         exceptionFormat "short"
+ *
+ *         // set options for log level DEBUG
+ *         debug {
+ *             events "started", "skipped", "failed"
+ *             exceptionFormat "full"
+ *         }
+ *
+ *         // remove standard output/error logging from --info builds
+ *         // by assigning only 'failed' and 'skipped' events
+ *         info.events = ["failed", "skipped"]
+ *     }
+ * }
+ * 
+ * + * The defaults that are in place show progressively more information + * on log levels WARN, LIFECYCLE, INFO, and DEBUG, respectively. + */ +public interface TestLoggingContainer extends TestLogging { + /** + * Returns logging options for debug level. + * + * @return logging options for debug level + */ + TestLogging getDebug(); + + /** + * Sets logging options for debug level. + * + * @param logging logging options for debug level + */ + void setDebug(TestLogging logging); + + /** + * Configures logging options for debug level. + * + * @param action logging options for debug level + */ + void debug(Action action); + + /** + * Gets logging options for info level. + * + * @return logging options for info level + */ + TestLogging getInfo(); + + /** + * Sets logging options for info level. + * + * @param logging logging options for info level + */ + void setInfo(TestLogging logging); + + /** + * Configures logging options for info level. + * + * @param action logging options for info level + */ + void info(Action action); + + /** + * Returns logging options for lifecycle level. + * + * @return logging options for lifecycle level + */ + TestLogging getLifecycle(); + + /** + * Sets logging options for lifecycle level. + * + * @param logging logging options for lifecycle level + */ + void setLifecycle(TestLogging logging); + + /** + * Configures logging options for lifecycle level. + * + * @param action logging options for lifecycle level + */ + void lifecycle(Action action); + + /** + * Gets logging options for warn level. + * + * @return logging options for warn level + */ + TestLogging getWarn(); + + /** + * Sets logging options for warn level. + * + * @param logging logging options for warn level + */ + void setWarn(TestLogging logging); + + /** + * Configures logging options for warn level. + * + * @param action logging options for warn level + */ + void warn(Action action); + + /** + * Returns logging options for quiet level. + * + * @return logging options for quiet level + */ + TestLogging getQuiet(); + + /** + * Sets logging options for quiet level. + * + * @param logging logging options for quiet level + */ + void setQuiet(TestLogging logging); + + /** + * Configures logging options for quiet level. + * + * @param action logging options for quiet level + */ + void quiet(Action action); + + /** + * Returns logging options for error level. + * + * @return logging options for error level + */ + TestLogging getError(); + + /** + * Sets logging options for error level. + * + * @param logging logging options for error level + */ + void setError(TestLogging logging); + + /** + * Configures logging options for error level. + * + * @param action logging options for error level + */ + void error(Action action); + + /** + * Returns logging options for the specified level. + * + * @param level the level whose logging options are to be returned + * + * @return logging options for the specified level + */ + TestLogging get(LogLevel level); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/testing/base/TestSuiteBinarySpec.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/testing/base/TestSuiteBinarySpec.java new file mode 100644 index 0000000..6ff152a --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-base/org/gradle/testing/base/TestSuiteBinarySpec.java @@ -0,0 +1,38 @@ +/* + * Copyright 2016 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.testing.base; + +import org.gradle.api.Incubating; +import org.gradle.platform.base.BinarySpec; + +/** + * A binary which runs a suite of tests. + */ +@Incubating +public interface TestSuiteBinarySpec extends BinarySpec { + + /** + * Returns the test suite that this binary belongs to. + */ + TestSuiteSpec getTestSuite(); + + /** + * Returns the binary tested by this test suite. + */ + BinarySpec getTestedBinary(); + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-jvm/org/gradle/api/internal/tasks/testing/junit/AbstractJUnitTestClassProcessor.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-jvm/org/gradle/api/internal/tasks/testing/junit/AbstractJUnitTestClassProcessor.java new file mode 100644 index 0000000..064c971 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-jvm/org/gradle/api/internal/tasks/testing/junit/AbstractJUnitTestClassProcessor.java @@ -0,0 +1,74 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.api.internal.tasks.testing.junit; + +import org.gradle.api.Action; +import org.gradle.api.internal.tasks.testing.TestClassProcessor; +import org.gradle.api.internal.tasks.testing.TestClassRunInfo; +import org.gradle.api.internal.tasks.testing.TestResultProcessor; +import org.gradle.internal.actor.Actor; +import org.gradle.internal.actor.ActorFactory; +import org.gradle.internal.id.IdGenerator; +import org.gradle.internal.time.Clock; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +public abstract class AbstractJUnitTestClassProcessor implements TestClassProcessor { + private static final Logger LOGGER = LoggerFactory.getLogger(AbstractJUnitTestClassProcessor.class); + + protected final T spec; + protected final IdGenerator idGenerator; + protected final Clock clock; + private final ActorFactory actorFactory; + private Actor resultProcessorActor; + private Action executor; + + public AbstractJUnitTestClassProcessor(T spec, IdGenerator idGenerator, ActorFactory actorFactory, Clock clock) { + this.idGenerator = idGenerator; + this.spec = spec; + this.actorFactory = actorFactory; + this.clock = clock; + } + + @Override + public void startProcessing(TestResultProcessor resultProcessor) { + TestResultProcessor resultProcessorChain = createResultProcessorChain(resultProcessor); + // Wrap the result processor chain up in a blocking actor, to make the whole thing thread-safe + resultProcessorActor = actorFactory.createBlockingActor(resultProcessorChain); + executor = createTestExecutor(resultProcessorActor); + } + + protected abstract TestResultProcessor createResultProcessorChain(TestResultProcessor resultProcessor); + + protected abstract Action createTestExecutor(Actor resultProcessorActor); + + @Override + public void processTestClass(TestClassRunInfo testClass) { + LOGGER.debug("Executing test class {}", testClass.getTestClassName()); + executor.execute(testClass.getTestClassName()); + } + + @Override + public void stop() { + resultProcessorActor.stop(); + } + + @Override + public void stopNow() { + throw new UnsupportedOperationException("stopNow() should not be invoked on remote worker TestClassProcessor"); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-native/org/gradle/nativeplatform/test/cpp/plugins/CppUnitTestPlugin.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-native/org/gradle/nativeplatform/test/cpp/plugins/CppUnitTestPlugin.java new file mode 100644 index 0000000..8891d77 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-native/org/gradle/nativeplatform/test/cpp/plugins/CppUnitTestPlugin.java @@ -0,0 +1,224 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.nativeplatform.test.cpp.plugins; + +import org.gradle.api.Plugin; +import org.gradle.api.Project; +import org.gradle.api.artifacts.Dependency; +import org.gradle.api.file.ConfigurableFileCollection; +import org.gradle.api.internal.attributes.ImmutableAttributesFactory; +import org.gradle.api.model.ObjectFactory; +import org.gradle.api.provider.ProviderFactory; +import org.gradle.api.provider.SetProperty; +import org.gradle.api.tasks.TaskContainer; +import org.gradle.api.tasks.TaskProvider; +import org.gradle.language.base.plugins.LifecycleBasePlugin; +import org.gradle.language.cpp.CppApplication; +import org.gradle.language.cpp.CppBinary; +import org.gradle.language.cpp.CppComponent; +import org.gradle.language.cpp.CppPlatform; +import org.gradle.language.cpp.ProductionCppComponent; +import org.gradle.language.cpp.internal.DefaultCppBinary; +import org.gradle.language.cpp.internal.DefaultCppPlatform; +import org.gradle.language.cpp.plugins.CppBasePlugin; +import org.gradle.language.internal.NativeComponentFactory; +import org.gradle.language.nativeplatform.internal.ConfigurableComponentWithLinkUsage; +import org.gradle.language.nativeplatform.internal.Dimensions; +import org.gradle.language.nativeplatform.internal.toolchains.ToolChainSelector; +import org.gradle.language.nativeplatform.tasks.UnexportMainSymbol; +import org.gradle.nativeplatform.TargetMachine; +import org.gradle.nativeplatform.TargetMachineFactory; +import org.gradle.nativeplatform.platform.NativePlatform; +import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform; +import org.gradle.nativeplatform.tasks.InstallExecutable; +import org.gradle.nativeplatform.test.cpp.CppTestExecutable; +import org.gradle.nativeplatform.test.cpp.CppTestSuite; +import org.gradle.nativeplatform.test.cpp.internal.DefaultCppTestExecutable; +import org.gradle.nativeplatform.test.cpp.internal.DefaultCppTestSuite; +import org.gradle.nativeplatform.test.plugins.NativeTestingBasePlugin; +import org.gradle.nativeplatform.test.tasks.RunTestExecutable; + +import javax.inject.Inject; +import java.util.concurrent.Callable; +import java.util.stream.Stream; + +import static org.gradle.language.nativeplatform.internal.Dimensions.tryToBuildOnHost; + +/** + * A plugin that sets up the infrastructure for testing C++ binaries using a simple test executable. + * + * Gradle will create a {@link RunTestExecutable} task that relies on the exit code of the binary. + * + * @since 4.4 + */ +public class CppUnitTestPlugin implements Plugin { + private final NativeComponentFactory componentFactory; + private final ToolChainSelector toolChainSelector; + private final ObjectFactory objectFactory; + private final ImmutableAttributesFactory attributesFactory; + private final TargetMachineFactory targetMachineFactory; + + @Inject + public CppUnitTestPlugin(NativeComponentFactory componentFactory, ToolChainSelector toolChainSelector, ObjectFactory objectFactory, ImmutableAttributesFactory attributesFactory, TargetMachineFactory targetMachineFactory) { + this.componentFactory = componentFactory; + this.toolChainSelector = toolChainSelector; + this.objectFactory = objectFactory; + this.attributesFactory = attributesFactory; + this.targetMachineFactory = targetMachineFactory; + } + + @Override + public void apply(final Project project) { + project.getPluginManager().apply(CppBasePlugin.class); + project.getPluginManager().apply(NativeTestingBasePlugin.class); + + final ProviderFactory providers = project.getProviders(); + final TaskContainer tasks = project.getTasks(); + + // Add the unit test and extension + final DefaultCppTestSuite testComponent = componentFactory.newInstance(CppTestSuite.class, DefaultCppTestSuite.class, "test"); + project.getExtensions().add(CppTestSuite.class, "unitTest", testComponent); + project.getComponents().add(testComponent); + + testComponent.getBaseName().convention(project.getName() + "Test"); + testComponent.getTargetMachines().convention(Dimensions.useHostAsDefaultTargetMachine(targetMachineFactory)); + + final String mainComponentName = "main"; + project.getComponents().withType(ProductionCppComponent.class, component -> { + if (mainComponentName.equals(component.getName())) { + testComponent.getTargetMachines().convention(component.getTargetMachines()); + testComponent.getTestedComponent().convention(component); + } + }); + + testComponent.getTestBinary().convention(project.provider(new Callable() { + @Override + public CppTestExecutable call() throws Exception { + return getAllBuildableTestExecutable() + .filter(it -> isCurrentArchitecture(it.getNativePlatform())) + .findFirst() + .orElse( + getAllBuildableTestExecutable().findFirst().orElse( + getAllTestExecutable().findFirst().orElse(null))); + } + + private boolean isCurrentArchitecture(NativePlatform targetPlatform) { + return targetPlatform.getArchitecture().equals(DefaultNativePlatform.getCurrentArchitecture()); + } + + private Stream getAllBuildableTestExecutable() { + return getAllTestExecutable().filter(it -> it.getPlatformToolProvider().isAvailable()); + } + + private Stream getAllTestExecutable() { + return testComponent.getBinaries().get().stream() + .filter(CppTestExecutable.class::isInstance) + .map(DefaultCppTestExecutable.class::cast); + } + })); + + testComponent.getBinaries().whenElementKnown(DefaultCppTestExecutable.class, binary -> { + // TODO: Replace with native test task + final TaskProvider testTask = tasks.register(binary.getNames().getTaskName("run"), RunTestExecutable.class, task -> { + task.setGroup(LifecycleBasePlugin.VERIFICATION_GROUP); + task.setDescription("Executes C++ unit tests."); + + final InstallExecutable installTask = binary.getInstallTask().get(); + task.onlyIf(element -> binary.getInstallDirectory().get().getAsFile().exists()); + task.getInputs().dir(binary.getInstallDirectory()); + task.setExecutable(installTask.getRunScriptFile().get().getAsFile()); + task.dependsOn(binary.getInstallDirectory()); + // TODO: Honor changes to build directory + task.setOutputDir(project.getLayout().getBuildDirectory().dir("test-results/" + binary.getNames().getDirName()).get().getAsFile()); + }); + binary.getRunTask().set(testTask); + + configureTestSuiteWithTestedComponentWhenAvailable(project, testComponent, binary); + }); + + project.afterEvaluate(p -> { + final CppComponent mainComponent = testComponent.getTestedComponent().getOrNull(); + final SetProperty mainTargetMachines = mainComponent != null ? mainComponent.getTargetMachines() : null; + Dimensions.unitTestVariants(testComponent.getBaseName(), testComponent.getTargetMachines(), mainTargetMachines, + objectFactory, attributesFactory, + providers.provider(() -> project.getGroup().toString()), providers.provider(() -> project.getVersion().toString()), + variantIdentity -> { + if (tryToBuildOnHost(variantIdentity)) { + ToolChainSelector.Result result = toolChainSelector.select(CppPlatform.class, new DefaultCppPlatform(variantIdentity.getTargetMachine())); + // TODO: Removing `debug` from variant name to keep parity with previous Gradle version in tooling models + CppTestExecutable testExecutable = testComponent.addExecutable(variantIdentity.getName().replace("debug", ""), variantIdentity, result.getTargetPlatform(), result.getToolChain(), result.getPlatformToolProvider()); + } + }); + // TODO: Publishing for test executable? + testComponent.getBinaries().realizeNow(); + }); + } + + private void configureTestSuiteWithTestedComponentWhenAvailable(Project project, DefaultCppTestSuite testSuite, DefaultCppTestExecutable testExecutable) { + CppComponent target = testSuite.getTestedComponent().getOrNull(); + if (!(target instanceof ProductionCppComponent)) { + return; + } + final ProductionCppComponent testedComponent = (ProductionCppComponent) target; + + final TaskContainer tasks = project.getTasks(); + testedComponent.getBinaries().whenElementFinalized(testedBinary -> { + if (!isTestedBinary(testExecutable, testedComponent, testedBinary)) { + return; + } + // TODO - move this to a base plugin + // Setup the dependency on the main binary + // This should all be replaced by a single dependency that points at some "testable" variants of the main binary + + // Inherit implementation dependencies + testExecutable.getImplementationDependencies().extendsFrom(((DefaultCppBinary) testedBinary).getImplementationDependencies()); + + // Configure test binary to link against tested component compiled objects + ConfigurableFileCollection testableObjects = project.files(); + if (target instanceof CppApplication) { + // TODO - this should be an outgoing variant of the component under test + TaskProvider unexportMainSymbol = tasks.register(testExecutable.getNames().getTaskName("relocateMainFor"), UnexportMainSymbol.class, task -> { + String dirName = ((DefaultCppBinary) testedBinary).getNames().getDirName(); + task.getOutputDirectory().set(project.getLayout().getBuildDirectory().dir("obj/for-test/" + dirName)); + task.getObjects().from(testedBinary.getObjects()); + }); + testableObjects.from(unexportMainSymbol.map(task -> task.getRelocatedObjects())); + } else { + testableObjects.from(testedBinary.getObjects()); + } + Dependency linkDependency = project.getDependencies().create(testableObjects); + testExecutable.getLinkConfiguration().getDependencies().add(linkDependency); + }); + } + + private boolean isTestedBinary(DefaultCppTestExecutable testExecutable, ProductionCppComponent mainComponent, CppBinary testedBinary) { + // TODO: Make this more intelligent by matching the attributes of the runtime usage on the variant identities + return testedBinary.getTargetMachine().getOperatingSystemFamily().getName().equals(testExecutable.getTargetMachine().getOperatingSystemFamily().getName()) + && testedBinary.getTargetMachine().getArchitecture().getName().equals(testExecutable.getTargetMachine().getArchitecture().getName()) + && !testedBinary.isOptimized() + && hasDevelopmentBinaryLinkage(mainComponent, testedBinary); + } + + private boolean hasDevelopmentBinaryLinkage(ProductionCppComponent mainComponent, CppBinary testedBinary) { + if (!(testedBinary instanceof ConfigurableComponentWithLinkUsage)) { + return true; + } + ConfigurableComponentWithLinkUsage developmentBinaryWithUsage = (ConfigurableComponentWithLinkUsage) mainComponent.getDevelopmentBinary().get(); + ConfigurableComponentWithLinkUsage testedBinaryWithUsage = (ConfigurableComponentWithLinkUsage)testedBinary; + return testedBinaryWithUsage.getLinkage() == developmentBinaryWithUsage.getLinkage(); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-native/org/gradle/nativeplatform/test/xctest/internal/DefaultSwiftXCTestBinary.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-native/org/gradle/nativeplatform/test/xctest/internal/DefaultSwiftXCTestBinary.java new file mode 100644 index 0000000..0e6400f --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/testing-native/org/gradle/nativeplatform/test/xctest/internal/DefaultSwiftXCTestBinary.java @@ -0,0 +1,75 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.nativeplatform.test.xctest.internal; + +import org.gradle.api.artifacts.Configuration; +import org.gradle.api.artifacts.ConfigurationContainer; +import org.gradle.api.file.DirectoryProperty; +import org.gradle.api.file.FileCollection; +import org.gradle.api.file.RegularFileProperty; +import org.gradle.api.model.ObjectFactory; +import org.gradle.api.provider.Property; +import org.gradle.api.provider.Provider; +import org.gradle.language.cpp.internal.NativeVariantIdentity; +import org.gradle.language.nativeplatform.internal.Names; +import org.gradle.language.swift.SwiftPlatform; +import org.gradle.language.swift.internal.DefaultSwiftBinary; +import org.gradle.nativeplatform.test.xctest.SwiftXCTestBinary; +import org.gradle.nativeplatform.test.xctest.tasks.XCTest; +import org.gradle.nativeplatform.toolchain.internal.NativeToolChainInternal; +import org.gradle.nativeplatform.toolchain.internal.PlatformToolProvider; + +/** + * Binary of a XCTest suite component. + * This may be an executable that can be executed directly or a bundle that must be executed through xctest. + * + * Either way, the installation provides a single entry point for executing this binary. + */ +public abstract class DefaultSwiftXCTestBinary extends DefaultSwiftBinary implements SwiftXCTestBinary { + private final RegularFileProperty executableFile; + private final DirectoryProperty installDirectory; + private final RegularFileProperty runScriptFile; + private final Property runTaskProperty; + + public DefaultSwiftXCTestBinary(Names names, ObjectFactory objectFactory, Provider module, boolean testable, FileCollection source, ConfigurationContainer configurations, Configuration implementation, SwiftPlatform targetPlatform, NativeToolChainInternal toolChain, PlatformToolProvider platformToolProvider, NativeVariantIdentity identity) { + super(names, objectFactory, module, testable, source, configurations, implementation, targetPlatform, toolChain, platformToolProvider, identity); + this.executableFile = objectFactory.fileProperty(); + this.installDirectory = objectFactory.directoryProperty(); + this.runScriptFile = objectFactory.fileProperty(); + this.runTaskProperty = objectFactory.property(XCTest.class); + } + + @Override + public RegularFileProperty getExecutableFile() { + return executableFile; + } + + @Override + public DirectoryProperty getInstallDirectory() { + return installDirectory; + } + + @Override + public RegularFileProperty getRunScriptFile() { + return runScriptFile; + } + + @Override + public Property getRunTask() { + return runTaskProperty; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/ProjectConnection.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/ProjectConnection.java new file mode 100644 index 0000000..8a7856e --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/ProjectConnection.java @@ -0,0 +1,200 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.tooling; + +import java.io.Closeable; +import java.nio.file.Path; +import java.util.List; + +/** + *

Represents a long-lived connection to a Gradle project. You obtain an instance of a {@code ProjectConnection} by using {@link org.gradle.tooling.GradleConnector#connect()}.

+ * + *
+ *
+ * try (ProjectConnection connection = GradleConnector.newConnector()
+ *        .forProjectDirectory(new File("someFolder"))
+ *        .connect()) {
+ *
+ *    //obtain some information from the build
+ *    BuildEnvironment environment = connection.model(BuildEnvironment.class).get();
+ *
+ *    //run some tasks
+ *    connection.newBuild()
+ *      .forTasks("tasks")
+ *      .setStandardOutput(System.out)
+ *      .run();
+ *
+ * }
+ * 
+ * + *

Thread safety information

+ * + *

All implementations of {@code ProjectConnection} are thread-safe, and may be shared by any number of threads.

+ * + *

All notifications from a given {@code ProjectConnection} instance are delivered by a single thread at a time. Note, however, that the delivery thread may change over time.

+ * + * @since 1.0-milestone-3 + */ +public interface ProjectConnection extends Closeable { + /** + * Fetches a snapshot of the model of the given type for this project. This method blocks until the model is available. + * + *

This method is simply a convenience for calling {@code model(modelType).get()}

+ * + * @param modelType The model type. + * @param The model type. + * @return The model. + * @throws UnsupportedVersionException When the target Gradle version does not support the given model. + * @throws UnknownModelException When the target Gradle version or build does not support the requested model. + * @throws BuildException On some failure executing the Gradle build, in order to build the model. + * @throws GradleConnectionException On some other failure using the connection. + * @throws IllegalStateException When this connection has been closed or is closing. + * @since 1.0-milestone-3 + */ + T getModel(Class modelType) throws GradleConnectionException, IllegalStateException; + + /** + * Starts fetching a snapshot of the given model, passing the result to the given handler when complete. This method returns immediately, and the result is later + * passed to the given handler's {@link ResultHandler#onComplete(Object)} method. + * + *

If the operation fails, the handler's {@link ResultHandler#onFailure(GradleConnectionException)} method is called with the appropriate exception. + * See {@link #getModel(Class)} for a description of the various exceptions that the operation may fail with. + * + *

This method is simply a convenience for calling {@code model(modelType).get(handler)}

+ * + * @param modelType The model type. + * @param handler The handler to pass the result to. + * @param The model type. + * @throws IllegalStateException When this connection has been closed or is closing. + * @since 1.0-milestone-3 + */ + void getModel(Class modelType, ResultHandler handler) throws IllegalStateException; + + /** + * Creates a launcher which can be used to execute a build. + * + *

Requires Gradle 1.0-milestone-8 or later.

+ * + * @return The launcher. + * @since 1.0-milestone-3 + */ + BuildLauncher newBuild(); + + /** + * Creates a test launcher which can be used to execute tests. + * + *

Requires Gradle 2.6 or later.

+ * + * @return The launcher. + * @since 2.6 + */ + TestLauncher newTestLauncher(); + + /** + * Creates a builder which can be used to query the model of the given type. + * + *

Any of following models types may be available, depending on the version of Gradle being used by the target + * build: + * + *

    + *
  • {@link org.gradle.tooling.model.gradle.GradleBuild}
  • + *
  • {@link org.gradle.tooling.model.build.BuildEnvironment}
  • + *
  • {@link org.gradle.tooling.model.GradleProject}
  • + *
  • {@link org.gradle.tooling.model.gradle.BuildInvocations}
  • + *
  • {@link org.gradle.tooling.model.gradle.ProjectPublications}
  • + *
  • {@link org.gradle.tooling.model.idea.IdeaProject}
  • + *
  • {@link org.gradle.tooling.model.idea.BasicIdeaProject}
  • + *
  • {@link org.gradle.tooling.model.eclipse.EclipseProject}
  • + *
  • {@link org.gradle.tooling.model.eclipse.HierarchicalEclipseProject}
  • + *
+ * + *

A build may also expose additional custom tooling models. You can use this method to query these models. + * + *

Requires Gradle 1.0-milestone-8 or later.

+ * + * @param modelType The model type + * @param The model type. + * @return The builder. + * @since 1.0-milestone-3 + */ + ModelBuilder model(Class modelType); + + /** + * Creates an executer which can be used to run the given action when the build has finished. The action is serialized into the build + * process and executed, then its result is serialized back to the caller. + * + *

Requires Gradle 1.8 or later.

+ * + * @param buildAction The action to run. + * @param The result type. + * @return The builder. + * @since 1.8 + * @see #action() if you want to hook into different points of the build lifecycle. + */ + BuildActionExecuter action(BuildAction buildAction); + + /** + * Creates a builder for an executer which can be used to run actions in different phases of the build. + * The actions are serialized into the build process and executed, then its result is serialized back to the caller. + * + *

Requires Gradle 4.8 or later. + * + * @return The builder. + * @since 4.8 + */ + BuildActionExecuter.Builder action(); + + /** + * Notifies all daemons about file changes made by an external process, like an IDE. + * + *

The daemons will use this information to update the retained file system state. + * + *

The method should be invoked on every change done by the external process. + * For example, an IDE should notify Gradle when the user saves a changed file, or + * after some refactoring finished. + * This will guarantee that Gradle picks up changes when trigerring a build, even + * if the file system is too slow to notify file watchers. + * + * The caller shouldn't notify Gradle about changes detected by using other file + * watchers, since Gradle already will be using its own file watcher. + * + *

The paths which are passed in need to be absolute, canonicalized paths. + * For a delete, the deleted path should be passed. + * For a rename, the old and the new path should be passed. + * When creating a new file, the path to the file should be passed. + * + *

The call is synchronous, i.e. the method ensures that the changed paths are taken into account + * by the daemon after it returned. This ensures that for every build started + * after this method has been called knows about the changed paths. + * + *

If the version of Gradle does not support virtual file system retention (i.e. < 6.1), + * then the operation is a no-op. + * + * @param changedPaths Absolute paths which have been changed by the external process. + * @throws IllegalArgumentException When the paths are not absolute. + * @throws UnsupportedVersionException When the target Gradle version is <= 2.5. + * @throws GradleConnectionException On some other failure using the connection. + * @since 6.1 + */ + void notifyDaemonsAboutChangedPaths(List changedPaths); + + /** + * Closes this connection. Blocks until any pending operations are complete. Once this method has returned, no more notifications will be delivered by any threads. + * @since 1.0-milestone-3 + */ + @Override + void close(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/events/internal/ConsumerOperationDescriptor.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/events/internal/ConsumerOperationDescriptor.java new file mode 100644 index 0000000..e96f2f6 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/events/internal/ConsumerOperationDescriptor.java @@ -0,0 +1,53 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.events.internal; + +import org.gradle.tooling.events.OperationDescriptor; + +import javax.annotation.Nullable; + +/** + * Implementation of the {@link OperationDescriptor} interface, for those operations which are performed by the consumer. + */ +public class ConsumerOperationDescriptor implements OperationDescriptor { + private final String displayName; + + public ConsumerOperationDescriptor(String displayName) { + this.displayName = displayName; + } + + @Override + public String getName() { + return displayName; + } + + @Override + public String toString() { + return displayName; + } + + @Override + public String getDisplayName() { + return displayName; + } + + @Nullable + @Override + public OperationDescriptor getParent() { + return null; + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/events/test/JvmTestKind.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/events/test/JvmTestKind.java new file mode 100644 index 0000000..59d3ebe --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/events/test/JvmTestKind.java @@ -0,0 +1,44 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.tooling.events.test; + +/** + * Enumerates the different kinds of JVM tests. This allows to differentiate between test suites, atomic tests, etc. + * + * @since 2.4 + */ +public enum JvmTestKind { + + SUITE("Test suite"), + ATOMIC("Atomic test"), + UNKNOWN("Unknown test kind"); + + private final String label; + + JvmTestKind(String label) { + this.label = label; + } + + /** + * Returns a label for the test kind. The label can be used to generate a prettified version of the test descriptor. + * + * @return a label corresponding to the test kind + */ + public String getLabel() { + return label; + } + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/events/test/TestSkippedResult.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/events/test/TestSkippedResult.java new file mode 100644 index 0000000..268570e --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/events/test/TestSkippedResult.java @@ -0,0 +1,27 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.events.test; + +import org.gradle.tooling.events.SkippedResult; + +/** + * Describes how a test operation was skipped. + * + * @since 2.4 + */ +public interface TestSkippedResult extends TestOperationResult, SkippedResult { +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/events/test/internal/DefaultTestOperationDescriptor.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/events/test/internal/DefaultTestOperationDescriptor.java new file mode 100644 index 0000000..3b5d518 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/events/test/internal/DefaultTestOperationDescriptor.java @@ -0,0 +1,32 @@ +/* + * Copyright 2015 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.events.test.internal; + +import org.gradle.tooling.events.OperationDescriptor; +import org.gradle.tooling.events.internal.DefaultOperationDescriptor; +import org.gradle.tooling.events.test.TestOperationDescriptor; +import org.gradle.tooling.internal.protocol.events.InternalTestDescriptor; + +/** + * Implementation of the {@code TestOperationDescriptor} interface. + */ +public class DefaultTestOperationDescriptor extends DefaultOperationDescriptor implements TestOperationDescriptor { + + public DefaultTestOperationDescriptor(InternalTestDescriptor internalTestDescriptor, OperationDescriptor parent) { + super(internalTestDescriptor, parent); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/events/transform/TransformSuccessResult.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/events/transform/TransformSuccessResult.java new file mode 100644 index 0000000..1af9f68 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/events/transform/TransformSuccessResult.java @@ -0,0 +1,27 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.events.transform; + +import org.gradle.tooling.events.SuccessResult; + +/** + * Describes how a transform operation finished successfully. + * + * @since 5.1 + */ +public interface TransformSuccessResult extends TransformOperationResult, SuccessResult { +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/events/transform/package-info.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/events/transform/package-info.java new file mode 100644 index 0000000..b84c5b8 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/events/transform/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Artifact transform execution specific interfaces and classes related to event notifications. + */ +package org.gradle.tooling.events.transform; diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/events/work/package-info.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/events/work/package-info.java new file mode 100644 index 0000000..0f707f7 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/events/work/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/** + * Work item execution specific interfaces and classes related to event notifications. + */ +package org.gradle.tooling.events.work; diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/internal/adapter/ViewBuilder.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/internal/adapter/ViewBuilder.java new file mode 100644 index 0000000..3f57c8c --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/internal/adapter/ViewBuilder.java @@ -0,0 +1,49 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.adapter; + +import javax.annotation.Nullable; + +public interface ViewBuilder { + + /** + * Mixes the given object into all views of the given type created using {@link #build(Object)}. + * Applied to all views reachable from created views. The mix-in object should be serializable. + * + * When a given method cannot be found on the source object for a view, the mix-in object is searched for a compatible method. + * For a getter method, the mix-in may also provide a method that takes the view as a parameter. + * + * @return this + */ + ViewBuilder mixInTo(Class targetType, Object mixIn); + + /** + * Mixes the given type into all views of the given type created using {@link #build(Object)}. + * Applied to all views reachable from created views. + * + * An instance of the class is created for each view of the given type that is created. The class should have a constructor that accepts the view as a parameter. + * When a given method cannot be found on the source object for a view, the mix-in object is searched for a compatible method. + * + * @return this + */ + ViewBuilder mixInTo(Class targetType, Class mixInType); + + /** + * Creates a view for the given source object. Returns null when source object is null. + */ + T build(@Nullable Object sourceObject); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/internal/consumer/connection/ParameterizedActionRunner.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/internal/consumer/connection/ParameterizedActionRunner.java new file mode 100644 index 0000000..4c4d775 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/internal/consumer/connection/ParameterizedActionRunner.java @@ -0,0 +1,38 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.consumer.connection; + +import org.gradle.api.Transformer; +import org.gradle.tooling.internal.consumer.versioning.VersionDetails; +import org.gradle.tooling.internal.protocol.BuildParameters; +import org.gradle.tooling.internal.protocol.BuildResult; +import org.gradle.tooling.internal.protocol.InternalCancellationToken; +import org.gradle.tooling.internal.protocol.InternalParameterAcceptingConnection; + +class ParameterizedActionRunner extends CancellableActionRunner { + private final InternalParameterAcceptingConnection executor; + + ParameterizedActionRunner(InternalParameterAcceptingConnection executor, Transformer exceptionTransformer, VersionDetails versionDetails) { + super(null, exceptionTransformer, versionDetails); + this.executor = executor; + } + + @Override + protected BuildResult execute(InternalBuildActionAdapter buildActionAdapter, InternalCancellationToken cancellationTokenAdapter, BuildParameters operationParameters) { + return executor.run(buildActionAdapter, cancellationTokenAdapter, operationParameters); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/internal/gradle/TaskListingLaunchable.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/internal/gradle/TaskListingLaunchable.java new file mode 100644 index 0000000..787b182 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/internal/gradle/TaskListingLaunchable.java @@ -0,0 +1,23 @@ +/* + * Copyright 2014 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.gradle; + +import java.util.SortedSet; + +public interface TaskListingLaunchable { + SortedSet getTaskNames(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/internal/protocol/BuildResult.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/internal/protocol/BuildResult.java new file mode 100644 index 0000000..1107249 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/internal/protocol/BuildResult.java @@ -0,0 +1,29 @@ +/* + * Copyright 2012 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.internal.protocol; + +/** + * The result of running a build. + * + *

This is a mostly-empty interface. Instances are queried dynamically to see which properties they support. + * See {@code ProviderBuildResult} for details on properties supported by the provider. + * + * @since 1.2-rc-1 + */ +public interface BuildResult extends InternalProtocolInterface { + T getModel(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/internal/protocol/ProgressListenerVersion1.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/internal/protocol/ProgressListenerVersion1.java new file mode 100644 index 0000000..a91f8e8 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/internal/protocol/ProgressListenerVersion1.java @@ -0,0 +1,25 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.tooling.internal.protocol; + +/** + * DO NOT CHANGE THIS INTERFACE. It is part of the cross-version protocol. + */ +public interface ProgressListenerVersion1 { + void onOperationStart(String description); + + void onOperationEnd(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/model/BuildableElement.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/model/BuildableElement.java new file mode 100644 index 0000000..c4274b9 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/model/BuildableElement.java @@ -0,0 +1,34 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.model; + +/** + * Represents an element which has Gradle tasks associated with it. + * + * @since 1.0-milestone-5 + */ +public interface BuildableElement extends Element { + + /** + * Returns the tasks of this project. + * + * @return The tasks of this project. + * @since 1.0-milestone-5 + */ + DomainObjectSet getTasks(); + +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/model/HasGradleProject.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/model/HasGradleProject.java new file mode 100644 index 0000000..e303c4e --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/model/HasGradleProject.java @@ -0,0 +1,35 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.tooling.model; + +/** + * An element that is associated with a Gradle project. Via the Gradle project you can access (list, run, etc.) Gradle tasks. + */ +public interface HasGradleProject extends ProjectModel { + + /** + * Returns the identifier for the project that this model is associated with. + * @since 3.3 + */ + @Override + ProjectIdentifier getProjectIdentifier(); + + /** + * The associated Gradle project. Via the gradle project you can access (list, run, etc.) Gradle tasks. + */ + GradleProject getGradleProject(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/model/Task.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/model/Task.java new file mode 100644 index 0000000..ed59d43 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-api/org/gradle/tooling/model/Task.java @@ -0,0 +1,62 @@ +/* + * Copyright 2011 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.gradle.tooling.model; + +import javax.annotation.Nullable; + +/** + * Represents a task which is executable by Gradle. + * + *

Note: {@code Task} extends {@code Launchable} since 1.12.

+ * + * @since 1.0-milestone-3 + */ +public interface Task extends Launchable { + /** + * Returns the path of this task. This is a fully qualified unique name for this task. + * + * @return The path of this task. + * @since 1.0-milestone-3 + */ + String getPath(); + + /** + * Returns the name of this task. Note that the name is not necessarily a unique identifier for the task. + * + * @return The name of this task. + * @since 1.0-milestone-3 + */ + String getName(); + + /** + * Returns the description of this task, or {@code null} if it has no description. + * + * @return The description of this task, or {@code null} if it has no description. + * @since 1.0-milestone-3 + */ + @Override + @Nullable + String getDescription(); + + /** + * Returns the group a task belongs to. + * + * @return the group a task belongs to. + * @since 2.5 + */ + @Nullable + String getGroup(); +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-native/org/gradle/language/cpp/internal/tooling/DefaultCppApplicationModel.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-native/org/gradle/language/cpp/internal/tooling/DefaultCppApplicationModel.java new file mode 100644 index 0000000..9712808 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-native/org/gradle/language/cpp/internal/tooling/DefaultCppApplicationModel.java @@ -0,0 +1,27 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.cpp.internal.tooling; + +import org.gradle.tooling.internal.protocol.cpp.InternalCppApplication; + +import java.util.List; + +public class DefaultCppApplicationModel extends DefaultCppComponentModel implements InternalCppApplication { + public DefaultCppApplicationModel(String name, String baseName, List binaries) { + super(name, baseName, binaries); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-native/org/gradle/language/cpp/internal/tooling/DefaultCppLibraryModel.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-native/org/gradle/language/cpp/internal/tooling/DefaultCppLibraryModel.java new file mode 100644 index 0000000..b4697fd --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/tooling-native/org/gradle/language/cpp/internal/tooling/DefaultCppLibraryModel.java @@ -0,0 +1,27 @@ +/* + * Copyright 2018 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.language.cpp.internal.tooling; + +import org.gradle.tooling.internal.protocol.cpp.InternalCppLibrary; + +import java.util.List; + +public class DefaultCppLibraryModel extends DefaultCppComponentModel implements InternalCppLibrary { + public DefaultCppLibraryModel(String name, String baseName, List binaries) { + super(name, baseName, binaries); + } +} diff --git a/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/version-control/org/gradle/vcs/git/internal/GitVersionControlSystem.java b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/version-control/org/gradle/vcs/git/internal/GitVersionControlSystem.java new file mode 100644 index 0000000..178b590 --- /dev/null +++ b/wrapper/dists/gradle-7.2-all/260hg96vuh6ex27h9vo47iv4d/gradle-7.2/src/version-control/org/gradle/vcs/git/internal/GitVersionControlSystem.java @@ -0,0 +1,214 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.gradle.vcs.git.internal; + +import com.google.common.collect.Sets; +import com.jcraft.jsch.Session; +import org.eclipse.jgit.api.CloneCommand; +import org.eclipse.jgit.api.Git; +import org.eclipse.jgit.api.ResetCommand; +import org.eclipse.jgit.api.TransportCommand; +import org.eclipse.jgit.api.TransportConfigCallback; +import org.eclipse.jgit.api.errors.GitAPIException; +import org.eclipse.jgit.api.errors.JGitInternalException; +import org.eclipse.jgit.lib.Ref; +import org.eclipse.jgit.lib.Repository; +import org.eclipse.jgit.submodule.SubmoduleWalk; +import org.eclipse.jgit.transport.JschConfigSessionFactory; +import org.eclipse.jgit.transport.OpenSshConfig; +import org.eclipse.jgit.transport.SshTransport; +import org.eclipse.jgit.transport.Transport; +import org.eclipse.jgit.transport.URIish; +import org.gradle.api.GradleException; +import org.gradle.api.logging.Logger; +import org.gradle.api.logging.Logging; +import org.gradle.vcs.VersionControlSpec; +import org.gradle.vcs.git.GitVersionControlSpec; +import org.gradle.vcs.internal.VersionControlSystem; +import org.gradle.vcs.internal.VersionRef; + +import javax.annotation.Nullable; +import java.io.File; +import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; +import java.util.Collection; +import java.util.Set; + +/** + * A Git {@link VersionControlSystem} implementation. + */ +public class GitVersionControlSystem implements VersionControlSystem { + + private static final Logger LOGGER = Logging.getLogger(GitVersionControlSystem.class); + + @Override + public void populate(File workingDir, VersionRef ref, VersionControlSpec spec) { + GitVersionControlSpec gitSpec = cast(spec); + LOGGER.info("Populating VCS workingDir {}/{} with ref {}", workingDir.getParentFile().getName(), workingDir.getName(), ref); + if (workingDir.isDirectory()) { + // Directory has something in it already + String[] contents = workingDir.list(); + if (contents!=null && contents.length > 0) { + resetRepo(workingDir, gitSpec, ref); + return; + } + } + + cloneRepo(workingDir, gitSpec, ref); + } + + @Override + public Set getAvailableVersions(VersionControlSpec spec) { + GitVersionControlSpec gitSpec = cast(spec); + Collection refs = getRemoteRefs(gitSpec, true, false); + Set versions = Sets.newHashSet(); + for (Ref ref : refs) { + GitVersionRef gitRef = GitVersionRef.from(ref); + versions.add(gitRef); + } + return versions; + } + + @Override + public VersionRef getDefaultBranch(VersionControlSpec spec) { + GitVersionControlSpec gitSpec = cast(spec); + Collection refs = getRemoteRefs(gitSpec, false, true); + for (Ref ref : refs) { + // TODO: Default branch can be different from just master + if (ref.getName().equals("refs/heads/master")) { + return GitVersionRef.from(ref); + } + } + throw new UnsupportedOperationException("Git repository has no master branch"); + } + + @Nullable + @Override + public VersionRef getBranch(VersionControlSpec spec, String branch) { + GitVersionControlSpec gitSpec = cast(spec); + Collection refs = getRemoteRefs(gitSpec, false, true); + String refName = "refs/heads/" + branch; + for (Ref ref : refs) { + if (ref.getName().equals(refName)) { + return GitVersionRef.from(ref); + } + } + return null; + } + + private Collection getRemoteRefs(GitVersionControlSpec gitSpec, boolean tags, boolean heads) { + try { + return configureTransport(Git.lsRemoteRepository()).setRemote(normalizeUri(gitSpec.getUrl())).setTags(tags).setHeads(heads).call(); + } catch (URISyntaxException | GitAPIException e) { + throw wrapGitCommandException("ls-remote", gitSpec.getUrl(), null, e); + } + } + + private static void cloneRepo(File workingDir, GitVersionControlSpec gitSpec, VersionRef ref) { + Git git = null; + try { + CloneCommand clone = configureTransport(Git.cloneRepository()). + setURI(normalizeUri(gitSpec.getUrl())). + setDirectory(workingDir). + setCloneSubmodules(true); + git = clone.call(); + git.reset().setMode(ResetCommand.ResetType.HARD).setRef(ref.getCanonicalId()).call(); + } catch (GitAPIException | URISyntaxException | JGitInternalException e) { + throw wrapGitCommandException("clone", gitSpec.getUrl(), workingDir, e); + } finally { + if (git != null) { + git.close(); + } + } + } + + private static void resetRepo(File workingDir, GitVersionControlSpec gitSpec, VersionRef ref) { + Git git = null; + try { + git = Git.open(workingDir); + git.reset().setMode(ResetCommand.ResetType.HARD).setRef(ref.getCanonicalId()).call(); + updateSubModules(git); + } catch (IOException | JGitInternalException | GitAPIException e) { + throw wrapGitCommandException("reset", gitSpec.getUrl(), workingDir, e); + } finally { + if (git != null) { + git.close(); + } + } + } + + private static void updateSubModules(Git git) throws IOException, GitAPIException { + SubmoduleWalk walker = SubmoduleWalk.forIndex(git.getRepository()); + try { + while (walker.next()) { + Repository submodule = walker.getRepository(); + try { + Git submoduleGit = Git.wrap(submodule); + configureTransport(submoduleGit.fetch()).call(); + git.submoduleUpdate().addPath(walker.getPath()).call(); + submoduleGit.reset().setMode(ResetCommand.ResetType.HARD).call(); + updateSubModules(submoduleGit); + } finally { + submodule.close(); + } + } + } finally { + walker.close(); + } + } + + private static String normalizeUri(URI uri) throws URISyntaxException { + // We have to go through URIish and back to deal with differences between how + // Java File and Git implement file URIs. + return new URIish(uri.toString()).toPrivateASCIIString(); + } + + private static GitVersionControlSpec cast(VersionControlSpec spec) { + if (!(spec instanceof GitVersionControlSpec)) { + throw new IllegalArgumentException("The GitVersionControlSystem can only handle GitVersionControlSpec instances."); + } + return (GitVersionControlSpec) spec; + } + + private static GradleException wrapGitCommandException(String commandName, URI repoUrl, File workingDir, Exception e) { + if (workingDir == null) { + return new GradleException(String.format("Could not run %s for %s", commandName, repoUrl), e); + } + return new GradleException(String.format("Could not %s from %s in %s", commandName, repoUrl, workingDir), e); + } + + private static > T configureTransport(T command) { + command.setTransportConfigCallback(new DefaultTransportConfigCallback()); + return command; + } + + private static class DefaultTransportConfigCallback implements TransportConfigCallback { + @Override + public void configure(Transport transport) { + if (transport instanceof SshTransport) { + SshTransport sshTransport = (SshTransport) transport; + sshTransport.setSshSessionFactory(new JschConfigSessionFactory() { + @Override + protected void configure(OpenSshConfig.Host hc, Session session) { + // TODO: This is where the password information would go + } + }); + } + } + } +}