Skip to content

Commit 4617c05

Browse files
authored
Merge pull request #16336 from smowton/smowton/admin/android-8-test
Java: Add Android Gradle Plugin 8 and Spring Boot 3 tests
2 parents eb9c734 + a50584c commit 4617c05

File tree

35 files changed

+1075
-42
lines changed

35 files changed

+1075
-42
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import os.path
2+
import sys
3+
import tempfile
4+
5+
def actions_expose_all_toolchains():
6+
7+
# On actions, expose all usable toolchains so that we can test version-selection logic.
8+
9+
toolchains_dir = tempfile.mkdtemp(prefix="integration-tests-toolchains-")
10+
toolchains_file = os.path.join(toolchains_dir, "toolchains.xml")
11+
12+
def none_or_blank(s):
13+
return s is None or s == ""
14+
15+
with open(toolchains_file, "w") as f:
16+
f.write('<?xml version="1.0" encoding="UTF-8"?>\n<toolchains>\n')
17+
18+
for v in [8, 11, 17, 21]:
19+
homedir = os.getenv("JAVA_HOME_%d_X64" % v)
20+
if none_or_blank(homedir):
21+
homedir = os.getenv("JAVA_HOME_%d_arm64" % v)
22+
if none_or_blank(homedir) and v == 8 and not none_or_blank(os.getenv("JAVA_HOME_11_arm64")):
23+
print("Mocking a toolchain entry using Java 11 install as a fake Java 8 entry, so this test behaves the same on x64 and arm64 runners", file = sys.stderr)
24+
homedir = os.getenv("JAVA_HOME_11_arm64")
25+
if homedir is not None and homedir != "":
26+
f.write("""
27+
<toolchain>
28+
<type>jdk</type>
29+
<provides>
30+
<version>%d</version>
31+
<vendor>oracle</vendor>
32+
</provides>
33+
<configuration>
34+
<jdkHome>%s</jdkHome>
35+
</configuration>
36+
</toolchain>
37+
""" % (v, homedir))
38+
39+
f.write("</toolchains>")
40+
41+
return toolchains_file
42+
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#
2+
# https://help.github.com/articles/dealing-with-line-endings/
3+
#
4+
# These are explicitly windows files and should use crlf
5+
*.bat text eol=crlf
6+
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
HELP.md
2+
.gradle
3+
build/
4+
!gradle/wrapper/gradle-wrapper.jar
5+
!**/src/main/**/build/
6+
!**/src/test/**/build/
7+
8+
### STS ###
9+
.apt_generated
10+
.classpath
11+
.factorypath
12+
.project
13+
.settings
14+
.springBeans
15+
.sts4-cache
16+
bin/
17+
!**/src/main/**/bin/
18+
!**/src/test/**/bin/
19+
20+
### IntelliJ IDEA ###
21+
.idea
22+
*.iws
23+
*.iml
24+
*.ipr
25+
out/
26+
!**/src/main/**/out/
27+
!**/src/test/**/out/
28+
29+
### NetBeans ###
30+
/nbproject/private/
31+
/nbbuild/
32+
/dist/
33+
/nbdist/
34+
/.nb-gradle/
35+
36+
### VS Code ###
37+
.vscode/
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
plugins {
2+
3+
/**
4+
* Use `apply false` in the top-level build.gradle file to add a Gradle
5+
* plugin as a build dependency but not apply it to the current (root)
6+
* project. Don't use `apply false` in sub-projects. For more information,
7+
* see Applying external plugins with same version to subprojects.
8+
*/
9+
10+
id 'com.android.application' version '8.0.0' apply false
11+
id 'com.android.library' version '8.0.0' apply false
12+
id 'org.jetbrains.kotlin.android' version '1.7.20' apply false
13+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# We currently have a bug where gradle tests become flaky when executed in parallel
2+
# - sometimes, gradle fails to connect to the gradle daemon.
3+
# Therefore, force this test to run sequentially.
4+
# Additionally, Android SDK on-demand downloading can fail when multiple tests try to download the same SDK in parallel.
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
4+
zipStoreBase=GRADLE_USER_HOME
5+
zipStorePath=wrapper/dists

java/ql/integration-tests/all-platforms/java/android-8-sample/gradlew

Lines changed: 240 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)