Skip to content
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
27 changes: 27 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -311,3 +311,30 @@ jobs:
run: ./scripts/run-linkage-test.sh
env:
JAVA_HOME: ${{ env.JAVA_HOME }}

verify-wrap-java-idempotent:
name: JavaStdlib wrap-java up-to-date
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
jdk_vendor: ['corretto']
container:
image: swift:6.3-jammy
steps:
- uses: actions/checkout@v6
- name: Mark workspace as safe for git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Prepare CI Environment
uses: ./.github/actions/prepare_env
- name: Regenerate JavaStdlib wrappers
env:
JAVA_HOME: ${{ env.JAVA_HOME_25 }}
run: ./scripts/wrap-java-generate.sh
- name: Verify no changes (whitespace-tolerant)
run: |
if ! git diff --ignore-all-space --ignore-blank-lines --exit-code -- '**/generated/*.swift'; then
echo "::error::wrap-java output drifted. Re-run ./scripts/wrap-java-generate.sh and commit the result."
git diff --ignore-all-space --ignore-blank-lines -- '**/generated/*.swift'
exit 1
fi
36 changes: 18 additions & 18 deletions Sources/JavaStdlib/JavaIO/generated/BufferedInputStream.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ open class BufferedInputStream: InputStream {
@JavaMethod
@_nonoverride public convenience init(_ arg0: InputStream?, _ arg1: Int32, environment: JNIEnvironment? = nil)

/// Java method `reset`.
/// Java method `available`.
///
/// ### Java method signature
/// ```java
/// public synchronized void java.io.BufferedInputStream.reset() throws java.io.IOException
/// public synchronized int java.io.BufferedInputStream.available() throws java.io.IOException
/// ```
@JavaMethod
open override func reset() throws
open override func available() throws -> Int32

/// Java method `close`.
///
Expand All @@ -37,14 +37,14 @@ open class BufferedInputStream: InputStream {
@JavaMethod
open override func mark(_ arg0: Int32)

/// Java method `read`.
/// Java method `markSupported`.
///
/// ### Java method signature
/// ```java
/// public synchronized int java.io.BufferedInputStream.read(byte[],int,int) throws java.io.IOException
/// public boolean java.io.BufferedInputStream.markSupported()
/// ```
@JavaMethod
open override func read(_ arg0: [Int8], _ arg1: Int32, _ arg2: Int32) throws -> Int32
open override func markSupported() -> Bool

/// Java method `read`.
///
Expand All @@ -55,39 +55,39 @@ open class BufferedInputStream: InputStream {
@JavaMethod
open override func read() throws -> Int32

/// Java method `transferTo`.
/// Java method `read`.
///
/// ### Java method signature
/// ```java
/// public synchronized long java.io.BufferedInputStream.transferTo(java.io.OutputStream) throws java.io.IOException
/// public synchronized int java.io.BufferedInputStream.read(byte[],int,int) throws java.io.IOException
/// ```
@JavaMethod
open override func transferTo(_ arg0: OutputStream?) throws -> Int64
open override func read(_ arg0: [Int8], _ arg1: Int32, _ arg2: Int32) throws -> Int32

/// Java method `skip`.
/// Java method `reset`.
///
/// ### Java method signature
/// ```java
/// public synchronized long java.io.BufferedInputStream.skip(long) throws java.io.IOException
/// public synchronized void java.io.BufferedInputStream.reset() throws java.io.IOException
/// ```
@JavaMethod
open override func skip(_ arg0: Int64) throws -> Int64
open override func reset() throws

/// Java method `available`.
/// Java method `skip`.
///
/// ### Java method signature
/// ```java
/// public synchronized int java.io.BufferedInputStream.available() throws java.io.IOException
/// public synchronized long java.io.BufferedInputStream.skip(long) throws java.io.IOException
/// ```
@JavaMethod
open override func available() throws -> Int32
open override func skip(_ arg0: Int64) throws -> Int64

/// Java method `markSupported`.
/// Java method `transferTo`.
///
/// ### Java method signature
/// ```java
/// public boolean java.io.BufferedInputStream.markSupported()
/// public synchronized long java.io.BufferedInputStream.transferTo(java.io.OutputStream) throws java.io.IOException
/// ```
@JavaMethod
open override func markSupported() -> Bool
open override func transferTo(_ arg0: OutputStream?) throws -> Int64
}
20 changes: 10 additions & 10 deletions Sources/JavaStdlib/JavaIO/generated/FileDescriptor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
import SwiftJava
import SwiftJavaJNICore

extension JavaClass<FileDescriptor> {
@JavaStaticField(isFinal: true)
public var err: FileDescriptor!

@JavaStaticField("in", isFinal: true)
public var `in`: FileDescriptor!

@JavaStaticField(isFinal: true)
public var out: FileDescriptor!
}
@JavaClass("java.io.FileDescriptor")
open class FileDescriptor: JavaObject {
@JavaMethod
Expand All @@ -25,13 +35,3 @@ open class FileDescriptor: JavaObject {
@JavaMethod
open func valid() -> Bool
}
extension JavaClass<FileDescriptor> {
@JavaStaticField("in", isFinal: true)
public var `in`: FileDescriptor!

@JavaStaticField(isFinal: true)
public var out: FileDescriptor!

@JavaStaticField(isFinal: true)
public var err: FileDescriptor!
}
8 changes: 4 additions & 4 deletions Sources/JavaStdlib/JavaIO/generated/FileReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import SwiftJavaJNICore
@JavaClass("java.io.FileReader")
open class FileReader: InputStreamReader {
@JavaMethod
@_nonoverride public convenience init(_ arg0: File?, _ arg1: Charset?, environment: JNIEnvironment? = nil) throws
@_nonoverride public convenience init(_ arg0: File?, environment: JNIEnvironment? = nil) throws

@JavaMethod
@_nonoverride public convenience init(_ arg0: String, _ arg1: Charset?, environment: JNIEnvironment? = nil) throws
@_nonoverride public convenience init(_ arg0: File?, _ arg1: Charset?, environment: JNIEnvironment? = nil) throws

@JavaMethod
@_nonoverride public convenience init(_ arg0: FileDescriptor?, environment: JNIEnvironment? = nil)

@JavaMethod
@_nonoverride public convenience init(_ arg0: File?, environment: JNIEnvironment? = nil) throws
@_nonoverride public convenience init(_ arg0: String, environment: JNIEnvironment? = nil) throws

@JavaMethod
@_nonoverride public convenience init(_ arg0: String, environment: JNIEnvironment? = nil) throws
@_nonoverride public convenience init(_ arg0: String, _ arg1: Charset?, environment: JNIEnvironment? = nil) throws
}
30 changes: 15 additions & 15 deletions Sources/JavaStdlib/JavaIO/generated/InputStreamReader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,56 +5,56 @@ import SwiftJavaJNICore
@JavaClass("java.io.InputStreamReader")
open class InputStreamReader: Reader {
@JavaMethod
@_nonoverride public convenience init(_ arg0: InputStream?, _ arg1: Charset?, environment: JNIEnvironment? = nil)
@_nonoverride public convenience init(_ arg0: InputStream?, environment: JNIEnvironment? = nil)

@JavaMethod
@_nonoverride public convenience init(_ arg0: InputStream?, _ arg1: String, environment: JNIEnvironment? = nil) throws

@JavaMethod
@_nonoverride public convenience init(_ arg0: InputStream?, environment: JNIEnvironment? = nil)
@_nonoverride public convenience init(_ arg0: InputStream?, _ arg1: Charset?, environment: JNIEnvironment? = nil)

/// Java method `ready`.
/// Java method `close`.
///
/// ### Java method signature
/// ```java
/// public boolean java.io.InputStreamReader.ready() throws java.io.IOException
/// public void java.io.InputStreamReader.close() throws java.io.IOException
/// ```
@JavaMethod
open override func ready() throws -> Bool
open override func close() throws

/// Java method `close`.
/// Java method `getEncoding`.
///
/// ### Java method signature
/// ```java
/// public void java.io.InputStreamReader.close() throws java.io.IOException
/// public java.lang.String java.io.InputStreamReader.getEncoding()
/// ```
@JavaMethod
open override func close() throws
open func getEncoding() -> String

/// Java method `read`.
///
/// ### Java method signature
/// ```java
/// public int java.io.InputStreamReader.read(char[],int,int) throws java.io.IOException
/// public int java.io.InputStreamReader.read() throws java.io.IOException
/// ```
@JavaMethod
open override func read(_ arg0: [UInt16], _ arg1: Int32, _ arg2: Int32) throws -> Int32
open override func read() throws -> Int32

/// Java method `read`.
///
/// ### Java method signature
/// ```java
/// public int java.io.InputStreamReader.read() throws java.io.IOException
/// public int java.io.InputStreamReader.read(char[],int,int) throws java.io.IOException
/// ```
@JavaMethod
open override func read() throws -> Int32
open override func read(_ arg0: [UInt16], _ arg1: Int32, _ arg2: Int32) throws -> Int32

/// Java method `getEncoding`.
/// Java method `ready`.
///
/// ### Java method signature
/// ```java
/// public java.lang.String java.io.InputStreamReader.getEncoding()
/// public boolean java.io.InputStreamReader.ready() throws java.io.IOException
/// ```
@JavaMethod
open func getEncoding() -> String
open override func ready() throws -> Bool
}
84 changes: 42 additions & 42 deletions Sources/JavaStdlib/JavaIO/generated/Reader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,27 @@
import SwiftJava
import SwiftJavaJNICore

@JavaClass("java.io.Reader", implements: Readable.self, Closeable.self)
open class Reader: JavaObject {
/// Java method `ready`.
///
/// ### Java method signature
/// ```java
/// public boolean java.io.Reader.ready() throws java.io.IOException
/// ```
@JavaMethod
open func ready() throws -> Bool

/// Java method `readAllAsString`.
extension JavaClass<Reader> {
/// Java method `nullReader`.
///
/// ### Java method signature
/// ```java
/// public java.lang.String java.io.Reader.readAllAsString() throws java.io.IOException
/// public static java.io.Reader java.io.Reader.nullReader()
/// ```
@JavaMethod
open func readAllAsString() throws -> String
@JavaStaticMethod
public func nullReader() -> Reader!

/// Java method `reset`.
/// Java method `of`.
///
/// ### Java method signature
/// ```java
/// public void java.io.Reader.reset() throws java.io.IOException
/// public static java.io.Reader java.io.Reader.of(java.lang.CharSequence)
/// ```
@JavaMethod
open func reset() throws

@JavaStaticMethod
public func of(_ arg0: CharSequence?) -> Reader!
}
@JavaClass("java.io.Reader", implements: Readable.self, Closeable.self)
open class Reader: JavaObject {
/// Java method `close`.
///
/// ### Java method signature
Expand All @@ -49,6 +41,15 @@ open class Reader: JavaObject {
@JavaMethod
open func mark(_ arg0: Int32) throws

/// Java method `markSupported`.
///
/// ### Java method signature
/// ```java
/// public boolean java.io.Reader.markSupported()
/// ```
@JavaMethod
open func markSupported() -> Bool

/// Java method `read`.
///
/// ### Java method signature
Expand Down Expand Up @@ -76,58 +77,57 @@ open class Reader: JavaObject {
@JavaMethod
open func read(_ arg0: [UInt16]) throws -> Int32

/// Java method `transferTo`.
/// Java method `readAllAsString`.
///
/// ### Java method signature
/// ```java
/// public long java.io.Reader.transferTo(java.io.Writer) throws java.io.IOException
/// public java.lang.String java.io.Reader.readAllAsString() throws java.io.IOException
/// ```
@JavaMethod
open func transferTo(_ arg0: Writer?) throws -> Int64
open func readAllAsString() throws -> String

/// Java method `skip`.
/// Java method `readAllLines`.
///
/// ### Java method signature
/// ```java
/// public long java.io.Reader.skip(long) throws java.io.IOException
/// public java.util.List<java.lang.String> java.io.Reader.readAllLines() throws java.io.IOException
/// ```
@JavaMethod
open func skip(_ arg0: Int64) throws -> Int64
open func readAllLines() throws -> List<JavaString>!

/// Java method `markSupported`.
/// Java method `ready`.
///
/// ### Java method signature
/// ```java
/// public boolean java.io.Reader.markSupported()
/// public boolean java.io.Reader.ready() throws java.io.IOException
/// ```
@JavaMethod
open func markSupported() -> Bool
open func ready() throws -> Bool

/// Java method `readAllLines`.
/// Java method `reset`.
///
/// ### Java method signature
/// ```java
/// public java.util.List<java.lang.String> java.io.Reader.readAllLines() throws java.io.IOException
/// public void java.io.Reader.reset() throws java.io.IOException
/// ```
@JavaMethod
open func readAllLines() throws -> List<JavaString>!
}
extension JavaClass<Reader> {
/// Java method `nullReader`.
open func reset() throws

/// Java method `skip`.
///
/// ### Java method signature
/// ```java
/// public static java.io.Reader java.io.Reader.nullReader()
/// public long java.io.Reader.skip(long) throws java.io.IOException
/// ```
@JavaStaticMethod
public func nullReader() -> Reader!
@JavaMethod
open func skip(_ arg0: Int64) throws -> Int64

/// Java method `of`.
/// Java method `transferTo`.
///
/// ### Java method signature
/// ```java
/// public static java.io.Reader java.io.Reader.of(java.lang.CharSequence)
/// public long java.io.Reader.transferTo(java.io.Writer) throws java.io.IOException
/// ```
@JavaStaticMethod
public func of(_ arg0: CharSequence?) -> Reader!
@JavaMethod
open func transferTo(_ arg0: Writer?) throws -> Int64
}
Loading
Loading