mirror of
https://github.com/bitwarden/android.git
synced 2026-04-27 11:28:41 -05:00
Update to Java 21 (#5835)
This commit is contained in:
2
.github/workflows/build-authenticator.yml
vendored
2
.github/workflows/build-authenticator.yml
vendored
@@ -28,7 +28,7 @@ on:
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
JAVA_VERSION: 17
|
||||
JAVA_VERSION: 21
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -28,7 +28,7 @@ on:
|
||||
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
JAVA_VERSION: 17
|
||||
JAVA_VERSION: 21
|
||||
GITHUB_ACTION_RUN_URL: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
|
||||
|
||||
permissions:
|
||||
|
||||
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@@ -13,7 +13,7 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
_JAVA_VERSION: 17
|
||||
_JAVA_VERSION: 21
|
||||
_GITHUB_ACTION_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}
|
||||
|
||||
|
||||
|
||||
@@ -52,12 +52,12 @@
|
||||
|
||||
Please avoid mixing formatting and logical changes in the same commit/PR. When possible, fix any large formatting issues in a separate PR before opening one to make logical changes to the same code. This helps others focus on the meaningful code changes when reviewing the code.
|
||||
|
||||
4. Setup JDK `Version` `17`:
|
||||
4. Setup JDK `Version` `21`:
|
||||
|
||||
- Navigate to `Preferences > Build, Execution, Deployment > Build Tools > Gradle`.
|
||||
- Hit the selected Gradle JDK next to `Gradle JDK:`.
|
||||
- Select a `17.x` version or hit `Download JDK...` if not present.
|
||||
- Select `Version` `17`.
|
||||
- Select a `21.x` version or hit `Download JDK...` if not present.
|
||||
- Select `Version` `21`.
|
||||
- Select your preferred `Vendor`.
|
||||
- Hit `Download`.
|
||||
- Hit `Apply`.
|
||||
|
||||
@@ -46,7 +46,7 @@ class FlightRecorderDataSetExtensionsTest {
|
||||
),
|
||||
)
|
||||
val result = dataset.getStopsLoggingStringForActiveLog(clock = FIXED_CLOCK)
|
||||
assertEquals(BitwardenString.stops_logging_on.asText("1/21/70", "4:27 AM"), result)
|
||||
assertEquals(BitwardenString.stops_logging_on.asText("1/21/70", "4:27\u202FAM"), result)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -195,7 +195,7 @@ class LoginApprovalViewModelTest : BaseViewModelTest() {
|
||||
email = EMAIL,
|
||||
fingerprint = AUTH_REQUEST.fingerprint,
|
||||
ipAddress = AUTH_REQUEST.ipAddress,
|
||||
time = "9/13/24, 12:00 AM",
|
||||
time = "9/13/24, 12:00\u202FAM",
|
||||
),
|
||||
)
|
||||
val viewModel = createViewModel()
|
||||
|
||||
@@ -124,7 +124,7 @@ class FlightRecorderDataSetExtensionsTest {
|
||||
id = "51",
|
||||
title = "2015-10-10T02:55:52 – 2015-10-10T03:55:52".asText(),
|
||||
subtextStart = "1.00 KB".asText(),
|
||||
subtextEnd = BitwardenString.expires_at.asText("10:15 PM"),
|
||||
subtextEnd = BitwardenString.expires_at.asText("10:15\u202FPM"),
|
||||
isDeletedEnabled = true,
|
||||
),
|
||||
RecordedLogsState.DisplayItem(
|
||||
|
||||
@@ -157,7 +157,7 @@ class OtherViewModelTest : BaseViewModelTest() {
|
||||
mutableVaultLastSyncStateFlow.tryEmit(newSyncTime)
|
||||
assertEquals(
|
||||
DEFAULT_STATE.copy(
|
||||
lastSyncTime = "Oct 27, 2023, 12:00 PM",
|
||||
lastSyncTime = "Oct 27, 2023, 12:00\u202FPM",
|
||||
dialogState = null,
|
||||
),
|
||||
awaitItem(),
|
||||
@@ -236,6 +236,6 @@ private val DEFAULT_STATE = OtherState(
|
||||
allowScreenCapture = false,
|
||||
allowSyncOnRefresh = false,
|
||||
clearClipboardFrequency = ClearClipboardFrequency.NEVER,
|
||||
lastSyncTime = "Oct 26, 2023, 12:00 PM",
|
||||
lastSyncTime = "Oct 26, 2023, 12:00\u202FPM",
|
||||
dialogState = null,
|
||||
)
|
||||
|
||||
@@ -172,7 +172,7 @@ class PasswordHistoryViewModelTest : BaseViewModelTest() {
|
||||
passwords = listOf(
|
||||
PasswordHistoryState.GeneratedPassword(
|
||||
password = "mockPassword-1",
|
||||
date = "10/27/23, 12:00 PM",
|
||||
date = "10/27/23, 12:00\u202FPM",
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -78,7 +78,7 @@ class SendDataExtensionsTest {
|
||||
SendState.ViewState.Content.SendItem(
|
||||
id = "mockId-1",
|
||||
name = "mockName-1",
|
||||
deletionDate = "Oct 27, 2023, 12:00 PM",
|
||||
deletionDate = "Oct 27, 2023, 12:00\u202FPM",
|
||||
type = SendState.ViewState.Content.SendItem.Type.FILE,
|
||||
iconList = DEFAULT_SEND_STATUS_ICONS,
|
||||
shareUrl = "www.test.com/#/send/mockAccessId-1/mockKey-1",
|
||||
@@ -87,7 +87,7 @@ class SendDataExtensionsTest {
|
||||
SendState.ViewState.Content.SendItem(
|
||||
id = "mockId-2",
|
||||
name = "mockName-2",
|
||||
deletionDate = "Oct 27, 2023, 12:00 PM",
|
||||
deletionDate = "Oct 27, 2023, 12:00\u202FPM",
|
||||
type = SendState.ViewState.Content.SendItem.Type.TEXT,
|
||||
iconList = DEFAULT_SEND_STATUS_ICONS,
|
||||
shareUrl = "www.test.com/#/send/mockAccessId-2/mockKey-2",
|
||||
|
||||
@@ -48,7 +48,7 @@ class SendViewExtensionsTest {
|
||||
),
|
||||
shareLink = sendUrl,
|
||||
sendName = "mockName-1",
|
||||
deletionDate = "Oct 27, 2023, 12:00 PM",
|
||||
deletionDate = "Oct 27, 2023, 12:00\u202FPM",
|
||||
maxAccessCount = 1,
|
||||
currentAccessCount = 1,
|
||||
notes = "mockNotes-1",
|
||||
@@ -76,7 +76,7 @@ class SendViewExtensionsTest {
|
||||
),
|
||||
shareLink = sendUrl,
|
||||
sendName = "mockName-2",
|
||||
deletionDate = "Oct 27, 2023, 12:00 PM",
|
||||
deletionDate = "Oct 27, 2023, 12:00\u202FPM",
|
||||
maxAccessCount = 1,
|
||||
currentAccessCount = 1,
|
||||
notes = "mockNotes-2",
|
||||
|
||||
@@ -217,7 +217,7 @@ class CipherViewExtensionsTest {
|
||||
totp = "otpauth://totp/Example:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example",
|
||||
canViewPassword = false,
|
||||
fido2CredentialCreationDateTime = BitwardenString.created_x.asText(
|
||||
"Oct 27, 2023, 12:00 PM",
|
||||
"Oct 27, 2023, 12:00\u202FPM",
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -278,7 +278,7 @@ class CipherViewExtensionsTest {
|
||||
totp = totp,
|
||||
canViewPassword = false,
|
||||
fido2CredentialCreationDateTime = BitwardenString.created_x.asText(
|
||||
"Oct 27, 2023, 12:00 PM",
|
||||
"Oct 27, 2023, 12:00\u202FPM",
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -170,8 +170,8 @@ fun createCommonContent(
|
||||
if (isEmpty) {
|
||||
VaultItemState.ViewState.Content.Common(
|
||||
name = "mockName",
|
||||
created = BitwardenString.created.asText("Jan 1, 1970, 12:16 AM"),
|
||||
lastUpdated = BitwardenString.last_edited.asText("Jan 1, 1970, 12:16 AM"),
|
||||
created = BitwardenString.created.asText("Jan 1, 1970, 12:16\u202FAM"),
|
||||
lastUpdated = BitwardenString.last_edited.asText("Jan 1, 1970, 12:16\u202FAM"),
|
||||
notes = null,
|
||||
customFields = emptyList(),
|
||||
requiresCloneConfirmation = false,
|
||||
@@ -188,8 +188,8 @@ fun createCommonContent(
|
||||
} else {
|
||||
VaultItemState.ViewState.Content.Common(
|
||||
name = "mockName",
|
||||
created = BitwardenString.created.asText("Jan 1, 1970, 12:16 AM"),
|
||||
lastUpdated = BitwardenString.last_edited.asText("Jan 1, 1970, 12:16 AM"),
|
||||
created = BitwardenString.created.asText("Jan 1, 1970, 12:16\u202FAM"),
|
||||
lastUpdated = BitwardenString.last_edited.asText("Jan 1, 1970, 12:16\u202FAM"),
|
||||
notes = "Lots of notes",
|
||||
customFields = listOf(
|
||||
FieldView(
|
||||
@@ -271,7 +271,7 @@ fun createLoginContent(isEmpty: Boolean): VaultItemState.ViewState.Content.ItemT
|
||||
)
|
||||
},
|
||||
passwordRevisionDate = BitwardenString.password_last_updated
|
||||
.asText("Jan 1, 1970, 12:16 AM")
|
||||
.asText("Jan 1, 1970, 12:16\u202FAM")
|
||||
.takeUnless { isEmpty },
|
||||
isPremiumUser = true,
|
||||
totpCodeItemData = TotpCodeItemData(
|
||||
@@ -281,7 +281,7 @@ fun createLoginContent(isEmpty: Boolean): VaultItemState.ViewState.Content.ItemT
|
||||
)
|
||||
.takeUnless { isEmpty },
|
||||
fido2CredentialCreationDateText = BitwardenString.created_x
|
||||
.asText("Oct 27, 2023, 12:00 PM")
|
||||
.asText("Oct 27, 2023, 12:00\u202FPM")
|
||||
.takeUnless { isEmpty },
|
||||
canViewTotpCode = true,
|
||||
)
|
||||
|
||||
@@ -69,7 +69,7 @@ class FlightRecorderDataSetExtensionsTest {
|
||||
assertEquals(
|
||||
BitwardenSnackbarData(
|
||||
message = BitwardenString.flight_recorder_banner_message
|
||||
.asText("4/12/25", "9:15 AM"),
|
||||
.asText("4/12/25", "9:15\u202FAM"),
|
||||
messageHeader = BitwardenString.flight_recorder_banner_title.asText(),
|
||||
actionLabel = BitwardenString.go_to_settings.asText(),
|
||||
withDismissAction = true,
|
||||
|
||||
@@ -102,7 +102,7 @@ class TemporalAccessorExtensionsTest {
|
||||
|
||||
// US locale
|
||||
assertEquals(
|
||||
"3:30 PM",
|
||||
"3:30\u202FPM",
|
||||
instant.toFormattedTimeStyle(
|
||||
timeStyle = FormatStyle.SHORT,
|
||||
locale = Locale.US,
|
||||
@@ -110,7 +110,7 @@ class TemporalAccessorExtensionsTest {
|
||||
),
|
||||
)
|
||||
assertEquals(
|
||||
"3:30:00 PM",
|
||||
"3:30:00\u202FPM",
|
||||
instant.toFormattedTimeStyle(
|
||||
timeStyle = FormatStyle.MEDIUM,
|
||||
locale = Locale.US,
|
||||
@@ -118,7 +118,7 @@ class TemporalAccessorExtensionsTest {
|
||||
),
|
||||
)
|
||||
assertEquals(
|
||||
"3:30:00 PM Z",
|
||||
"3:30:00\u202FPM Z",
|
||||
instant.toFormattedTimeStyle(
|
||||
timeStyle = FormatStyle.LONG,
|
||||
locale = Locale.US,
|
||||
@@ -126,7 +126,7 @@ class TemporalAccessorExtensionsTest {
|
||||
),
|
||||
)
|
||||
assertEquals(
|
||||
"3:30:00 PM Z",
|
||||
"3:30:00\u202FPM Z",
|
||||
instant.toFormattedTimeStyle(
|
||||
timeStyle = FormatStyle.FULL,
|
||||
locale = Locale.US,
|
||||
@@ -175,7 +175,7 @@ class TemporalAccessorExtensionsTest {
|
||||
|
||||
// US locale
|
||||
assertEquals(
|
||||
"12/10/23, 3:30 PM",
|
||||
"12/10/23, 3:30\u202FPM",
|
||||
instant.toFormattedDateTimeStyle(
|
||||
dateStyle = FormatStyle.SHORT,
|
||||
timeStyle = FormatStyle.SHORT,
|
||||
@@ -184,7 +184,7 @@ class TemporalAccessorExtensionsTest {
|
||||
),
|
||||
)
|
||||
assertEquals(
|
||||
"Dec 10, 2023, 3:30:00 PM",
|
||||
"Dec 10, 2023, 3:30:00\u202FPM",
|
||||
instant.toFormattedDateTimeStyle(
|
||||
dateStyle = FormatStyle.MEDIUM,
|
||||
timeStyle = FormatStyle.MEDIUM,
|
||||
@@ -193,7 +193,7 @@ class TemporalAccessorExtensionsTest {
|
||||
),
|
||||
)
|
||||
assertEquals(
|
||||
"December 10, 2023 at 3:30:00 PM Z",
|
||||
"December 10, 2023, 3:30:00\u202FPM Z",
|
||||
instant.toFormattedDateTimeStyle(
|
||||
dateStyle = FormatStyle.LONG,
|
||||
timeStyle = FormatStyle.LONG,
|
||||
@@ -202,7 +202,7 @@ class TemporalAccessorExtensionsTest {
|
||||
),
|
||||
)
|
||||
assertEquals(
|
||||
"Sunday, December 10, 2023 at 3:30:00 PM Z",
|
||||
"Sunday, December 10, 2023, 3:30:00\u202FPM Z",
|
||||
instant.toFormattedDateTimeStyle(
|
||||
dateStyle = FormatStyle.FULL,
|
||||
timeStyle = FormatStyle.FULL,
|
||||
@@ -231,7 +231,7 @@ class TemporalAccessorExtensionsTest {
|
||||
),
|
||||
)
|
||||
assertEquals(
|
||||
"10 December 2023 at 15:30:00 Z",
|
||||
"10 December 2023, 15:30:00 Z",
|
||||
instant.toFormattedDateTimeStyle(
|
||||
dateStyle = FormatStyle.LONG,
|
||||
timeStyle = FormatStyle.LONG,
|
||||
@@ -240,7 +240,7 @@ class TemporalAccessorExtensionsTest {
|
||||
),
|
||||
)
|
||||
assertEquals(
|
||||
"Sunday, 10 December 2023 at 15:30:00 Z",
|
||||
"Sunday, 10 December 2023, 15:30:00 Z",
|
||||
instant.toFormattedDateTimeStyle(
|
||||
dateStyle = FormatStyle.FULL,
|
||||
timeStyle = FormatStyle.FULL,
|
||||
|
||||
@@ -41,7 +41,7 @@ googleServices = "4.4.3"
|
||||
googleReview = "2.0.2"
|
||||
hilt = "2.57.1"
|
||||
junit5 = "5.13.4"
|
||||
jvmTarget = "17"
|
||||
jvmTarget = "21"
|
||||
# kotlin and ksp **must** use compatible versions, do not update either without the other.
|
||||
kotlin = "2.2.10"
|
||||
kotlinxCollectionsImmutable = "0.4.0"
|
||||
|
||||
Reference in New Issue
Block a user