File: java9.gradle

package info (click to toggle)
gradle 4.4.1-6
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 85,104 kB
  • sloc: java: 319,724; xml: 14,356; cpp: 4,200; ansic: 1,025; sh: 300; makefile: 60; asm: 17; jsp: 17; objc: 10
file content (177 lines) | stat: -rw-r--r-- 7,998 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
/**
 * Tests tasks to allow the gradual introduction of JDK 9 support
 */
String jdkVarName = 'JAVA_9'

task java9IntegTest(type: org.gradle.testing.IntegrationTest) {
    description "Run integTests with Java9 and forking executer"
    excludes = [
        // TODO requires investigation
        "DaemonGroovyCompilerIntegrationTest",
        "DaemonJavaCompilerIntegrationTest",
        "InProcessJavaCompilerIntegrationTest",
        "CommandLineJavaCompilerIntegrationTest",
        "CommandLineJavaCompilerForExecutableIntegrationTest",
        "JavadocIntegrationTest",

        // Caused by: java.lang.IncompatibleClassChangeError: Method Person.getName()Ljava/lang/String; must be InterfaceMethodref constant
        // Fail since build 125
        "InterfaceBackedManagedTypeIntegrationTest",

        // "targetplatforms sample creates a binary specific source set" tries to compile for Java 5 - need to update test, samples and userguide
        "SampleJavaLanguageIntegrationTest",

        // Cannot obtain Jvm arguments via java.lang.management.ManagementFactory.runtimeMXBean.inputArguments module java.management does not export sun.management to unnamed module @6427ecb
        "BuildEnvironmentModelCrossVersionSpec",  // "informs about java args as in the build script"
        "JavaConfigurabilityCrossVersionSpec", // "customized java args are reflected in the inputArguments and the build model", "tooling api provided jvm args take precedence over gradle.properties"
        "GradlePropertiesToolingApiCrossVersionSpec", // "tooling api honours jvm args specified in gradle.properties"

        // Add a dedicated Findbugs test for Java 9
        "FindBugsIntegrationTest",
        "FindBugsRelocationIntegrationTest",

        // Osgi is broken with a NPE in Processor - need to investigate
        "OsgiPluginIntegrationSpec",

        // Attempts to run Gradle 2.8 on Java 9
        "HeterogeneousCompositeBuildCrossVersionSpec",

        // Broken scala and twirl compilation
        "MixedPlayAndJvmLibraryProjectIntegrationTest",
        "PlayAppWithFailingTestsIntegrationTest",
        "PlayMultiProjectApplicationIntegrationTest",
        "PlayPlatformIntegrationTest",
        "PlayBinaryAdvancedAppIntegrationTest",
        "PlayDistributionAdvancedAppIntegrationTest",
        "PlayBinaryBasicAppIntegrationTest",
        "PlayDistributionBasicAppIntegrationTest",
        "PlayTestBasicAppIntegrationTest",
        "PlayContinuousBuildIntegrationTest",
        "PlayContinuousBuildReloadIntegrationTest",
        "PlayContinuousBuildReloadWaitingIntegrationTest",
        "PlayMultiProjectContinuousBuildIntegrationTest",
        "PlayMultiProjectReloadIntegrationTest",
        "PlayReloadIntegrationTest",
        "PlayReloadWaitingIntegrationTest",
        "PlayTwirlCompilerContinuousIntegrationTest",
        "PlayBinaryAppWithDependenciesIntegrationTest",
        "PlayDistributionAppWithDependenciesIntegrationTest",
        "PlayTestAppWithDependenciesIntegrationTest",
        "AdvancedPlaySampleIntegrationTest",
        "BasicPlaySampleIntegrationTest",
        "MultiprojectPlaySampleIntegrationTest",
        "UserGuidePlaySamplesIntegrationTest",
        "PlayApplicationPluginIntegrationTest",
        "Play23RoutesCompileIntegrationTest",
        "Play24RoutesCompileIntegrationTest",
        "PlayAssetsJarIntegrationTest",
        "PlayRunIntegrationTest",
        "TwirlCompileIntegrationTest",
        "TwirlVersionIntegrationTest",
        "PlayIdeaPluginAdvancedIntegrationTest",
        "PlayIdeaPluginBasicIntegrationTest",
        "PlayIdeaPluginMultiprojectIntegrationTest",
        "ProjectLayoutIntegrationTest",
        "SamplesMixedJavaAndScalaIntegrationTest",
        "SamplesScalaCustomizedLayoutIntegrationTest",
        "SamplesScalaQuickstartIntegrationTest",
        "JointScalaLangIntegrationTest",
        "SampleScalaLanguageIntegrationTest",
        "ScalaCompileParallelIntegrationTest",
        "ScalaCompilerContinuousIntegrationTest",
        "ScalaLanguageIncrementalBuildIntegrationTest",
        "ScalaLanguageIntegrationTest",
        "ScalaCrossCompilationIntegrationTest",
        "IncrementalScalaCompileIntegrationTest",
        "ZincScalaCompilerIntegrationTest",
        "ScalaTestIntegrationTest",
        "ScalaLibraryInitIntegrationTest",
        "ZincScalaCompilerMultiVersionIntegrationTest",
        "PlayCompositeBuildIntegrationTest",
        "PlayJavaAnnotationProcessingIntegrationTest",
        "ScalaAnnotationProcessingIntegrationTest",
        "CachedScalaCompileIntegrationTest",
        "ScalaCompileRelocationIntegrationTest",
        "UpToDateScalaCompileIntegrationTest",
        "ScalaDocIntegrationTest",
        "ScalaCompilerDaemonReuseIntegrationTest",
        "ScalaComponentCompilerDaemonReuseIntegrationTest",

        // Sample attempts to set max perm space
        "SamplesScalaZincIntegrationTest",

        // Cannot build Gradle with Java 9, compiler bug
        "SrcDistributionIntegrationSpec",

        // Test compiles for Java 5
        "ToolingApiUnsupportedClientJvmCrossVersionSpec",
        "MavenConversionIntegrationTest",

        // Jetty version does not work on Java 9
        "JettyIntegrationSpec",
        "SamplesWebQuickstartIntegrationTest",

        // Missing class javax/xml/bind/DatatypeConverter on PUT to S3
        // These tests need jvmArgs '-addmods', 'java.xml.bind'
        // At some point Gradle should import this module automatically
        "IvyPublishS3IntegrationTest",
        "IvyS3UploadArchivesIntegrationTest",
        "MavenPublishS3IntegrationTest",
        "MavenPublishS3ErrorsIntegrationTest",

        // Various problems, eg scala compile
        "UserGuideSamplesIntegrationTest",

        /*
         Changes in Javadoc generation
         */
        "SamplesJavaMultiProjectIntegrationTest",

        /*
         Caused by: java.lang.IllegalAccessException: class org.mozilla.javascript.MemberBox cannot access class sun.net.www.protocol.http.HttpURLConnection (in module java.base) because module java.base does not export sun.net.www.protocol.http to unnamed module @2afcc5b3
            at jdk.internal.reflect.Reflection.throwIllegalAccessException(java.base@9-ea/Reflection.java:405)
            at jdk.internal.reflect.Reflection.throwIllegalAccessException(java.base@9-ea/Reflection.java:396)
            at jdk.internal.reflect.Reflection.ensureMemberAccess(java.base@9-ea/Reflection.java:98)
            at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:161)
            for "can evaluate content"
         */
        "EnvJsPluginIntegrationTest",

        /*
         Uses bytebuddy in a test which uses asm which cannot read Java 9 classfiles
         */
        "DirectoryScanningIntegTest",

        /*
          MaxPermSize as GRADLE_OPTS
         */
        "ClientShutdownCrossVersionSpec",
    ].collect { "**/*${it}*" }
}

task java9Test(type: Test) {
}

tasks.withType(Test).matching { it.name.startsWith("java9") }.all {
    def java9Home = System.getenv('JAVA_9')
    executable = "${java9Home}/bin/java"
    environment['JAVA_HOME'] = java9Home
    reports.junitXml.destination = file("${project.testResultsDir}/$name")
    reports.html.destination = file("${project.reporting.baseDir}/$name")
    if (name.contains('IntegTest')) {
        systemProperties['org.gradle.integtest.executer'] = 'forking'
    }
}

if (!gradle.hasProperty("haveInstalledJava9Guard")) {
    gradle.taskGraph.whenReady { graph ->
        if (gradle.taskGraph.allTasks.any { it.name.startsWith("java9") }) {
            // Ideally, this would be a validate rule but it's not convenient to express this in the DSL yet
            if (!System.getenv(jdkVarName)) {
                throw new GradleException("A '$jdkVarName' environment variable, " +
                    "pointing to a java 9 JDK image, is required to run java9 tests!")
            }
        }
    }
    gradle.ext.haveInstalledJava9Guard = true
}