8000 Add support for JEP 418: Internet-Address Resolution SPI by ibauersachs · Pull Request #290 · dnsjava/dnsjava · GitHub
[go: up one dir, main page]

Skip to content

Add support for JEP 418: Internet-Address Resolution SPI #290

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ indent_size = 2
insert_final_newline = true
charset = utf-8
end_of_line = lf
trim_trailing_whitespace = true

[{pom.xml,*.md}]
indent_style = space
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/prepare-analysis/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ runs:
echo "check_name<<EOF"$'\n'"${check_name}EOF" >> $GITHUB_OUTPUT

- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
uses: mikepenz/action-junit-report@v4
with:
commit: ${{ github.event.workflow_run.head_sha }}
report_paths: ${{ steps.junit_paths.outputs.report_paths }}
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permissions:
checks: write

env:
BUILD_JAVA_VERSION: '20'
BUILD_JAVA_VERSION: '21'

jobs:
analyze:
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
number: ${{ steps.pr_number.outputs.pr_number }}

- name: Checkout PR
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ github.event.workflow_run.head_repository.full_name }}
ref: ${{ github.event.workflow_run.head_sha }}
Expand All @@ -60,7 +60,7 @@ jobs:
run: rm -rf base

- name: Checkout base
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: ${{ github.event.repository.full_name }}
ref: ${{ fromJson(steps.get_pr_data.outputs.data).base.ref }}
Expand Down
45 changes: 36 additions & 9 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v3
Expand All @@ -56,6 +56,16 @@ jobs:
mv jacoco.exec jacoco-${{ matrix.java }}-${{ matrix.arch }}-${{ matrix.os }}.exec
mv surefire-reports surefire-reports-${{ matrix.java }}-${{ matrix.arch }}-${{ matrix.os }}

- name: Verify that the main classes are really compiled for Java 8
if: matrix.os == 'ubuntu-latest'
run: |
class_file_version=$(javap -v target/classes/org/xbill/DNS/SimpleResolver.class | grep -oP "major version: \K\d+")
echo "::notice file=SimpleResolver.class::Class file version ${class_file_version}"
if [ "${class_file_version}" != "52" ]; then
echo "::error file=SimpleResolver.class::Class file version is not Java 8"
exit 1
fi

- name: Upload classes
uses: ./.github/actions/upload-artifact
if: always() && matrix.java == env.BUILD_JAVA_VERSION && matrix.arch == 'x64' && matrix.os == 'ubuntu-latest'
Expand Down Expand Up @@ -85,7 +95,7 @@ jobs:
needs: test
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v3
Expand Down Expand Up @@ -133,7 +143,7 @@ jobs:
if: github.event_name == 'push' || github.event.pull_request.head.repo.owner.login == 'dnsjava'
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# for Sonar
fetch-depth: 0
Expand All @@ -160,12 +170,12 @@ jobs:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up JDK 8
- name: Set up JDK ${env.BUILD_JAVA_VERSION}
uses: actions/setup-java@v3
with:
java-version: '8'
java-version: env.BUILD_JAVA_VERSION
architecture: 'x64'
distribution: temurin
cache: maven
Expand All @@ -183,6 +193,23 @@ jobs:
mvn \
--no-transfer-progress \
--batch-mode \
-Dgpg.passphrase="${{ secrets.GPG_PW }}" \
-DperformRelease=true \
deploy
compile
# Verify that the main classes are really compiled for Java 8
class_file_version=$(javap -v target/classes/org/xbill/DNS/SimpleResolver.class | grep -oP "major version: \K\d+")
echo "::notice file=SimpleResolver.class::Class file version ${class_file_version}"
if [ "${class_file_version}" == "52" ]; then
mvn \
--no-transfer-progress \
--batch-mode \
-Dgpg.passphrase="${{ secrets.GPG_PW }}" \
-DperformRelease=true \
-DskipTests \
-Dmaven.test.skip.exec \
-Dcheckstyle.skip \
-Dspotless.check.skip=true \
-Danimal.sniffer.skip=true
deploy
else
echo "::error file=SimpleResolver.class::Class file version is not Java 8"
exit 1
fi
20 changes: 16 additions & 4 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,36 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: java

- name: Set up JDK 11
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 11
java-version: 21
distribution: temurin
check-latest: true
cache: maven

- name: Build with Maven
run: mvn verify -B -"Dgpg.skip"
# Skip tests, code style, etc. This is handled in the regular CI workflows.
run: |
mvn clean package -B -V \
-DskipTests \
-Dmaven.test.skip.exec \
-Dgpg.skip \
-Dcheckstyle.skip \
-Denforcer.skip \
-Dmaven.javadoc.skip \
-Dspotless.check.skip=true \
-Danimal.sniffer.skip=true \
compile \
test-compile

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
24 changes: 24 additions & 0 deletions .github/workflows/report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: report
on:
workflow_run:
workflows: [ build ]
types: [ completed ]

permissions:
checks: write

jobs:
checks:
runs-on: ubuntu-latest
steps:
- name: Download Test Report
uses: dawidd6/action-download-artifact@v2
with:
name: junit-test-results
workflow: ${{ github.event.workflow.id }}
run_id: ${{ github.event.workflow_run.id }}
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
with:
commit: ${{ github.event.workflow_run.head_sha }}
report_paths: 'target/surefire-reports/TEST-*.xml'
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Copyright (c) 1998-2019, Brian Wellington
Copyright (c) 2005 VeriSign. All rights reserved.
Copyright (c) 2019-2021, dnsjava authors
Copyright (c) 2019-2023, dnsjava authors

All rights reserved.

Expand Down
2 changes: 1 addition & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ The servers can either be IP addresses or hostnames (which are resolved using Ja
- On Windows, if https://github.com/java-native-access/jna[JNA] is available on the classpath, the `GetAdaptersAddresses` API is used.
- On Android the `ConnectivityManager` is used (requires initialization using `org.xbill.DNS.config.AndroidResolverConfigProvider.setContext`).
- The `sun.net.dns.ResolverConfiguration` class is queried if enabled.
As of Java 16 the JVM flag `--add-opens java.base/sun.net.dns=ALL-UNNAMED` is also required.
As of Java 16 the JVM flag `--add-opens java.base/sun.net.dns=ALL-UNNAMED` (classpath) or `--add-opens java.base/sun.net.dns=org.dnsjava` (modules) is also required.
- If available and no servers have been found yet, https://docs.oracle.com/javase/8/docs/technotes/guides/jndi/jndi-dns.html[JNDI-DNS] is used.
- If still no servers have been found yet, use the fallback properties.
This can be used to query e.g. a well-known public DNS server instead of localhost.
Expand Down
4 changes: 4 additions & 0 deletions checkstyle/checkstyle-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@
<property name="headerFile" value="checkstyle/header.template.txt"/>
<property name="fileExtensions" value="java"/>
</module>
<!-- Excludes all 'module-info.java' files, see https://github.com/checkstyle/checkstyle/issues/8240 -->
<module name="BeforeExecutionExclusionFileFilter">
<property name="fileNamePattern" value="module\-info\.java$"/>
</module>
</module>
Loading
0