Skip to content

Commit 7ff5d22

Browse files
committed
Merge BRANCH_3.3
2 parents 7f389db + 57fec31 commit 7ff5d22

File tree

6 files changed

+36
-11
lines changed

6 files changed

+36
-11
lines changed

.github/workflows/build-packages.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55
branches: ['master', 'BRANCH*']
66
paths: ['ganttproject-builder/BUILD-HISTORY-MAJOR']
77
env:
8-
BUILD_NUMBER: 3313
9-
VERSION: 3.3.3313
8+
BUILD_NUMBER: 3316
9+
VERSION: 3.3.3316
1010
WINDOWS_APP_FOLDER_NAME: GanttProject-3.3
1111
MAC_APP_NAME: GanttProject 3.3
1212
MACOS_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE }}
@@ -29,7 +29,7 @@ jobs:
2929
- uses: actions/setup-java@v3
3030
with:
3131
distribution: 'liberica'
32-
java-version: 17.0.13
32+
java-version: 17.0.14
3333
java-package: jdk+fx
3434
cache: 'gradle'
3535
- name: Build GanttProject
@@ -73,7 +73,7 @@ jobs:
7373
- uses: actions/setup-java@v3
7474
with:
7575
distribution: 'liberica'
76-
java-version: 17.0.13
76+
java-version: 17.0.14
7777
java-package: jdk+fx
7878
cache: 'gradle'
7979
- name: Build GanttProject
@@ -144,7 +144,7 @@ jobs:
144144
- uses: actions/setup-java@v3
145145
with:
146146
distribution: 'liberica'
147-
java-version: 17.0.13
147+
java-version: 17.0.14
148148
java-package: jdk+fx
149149
cache: 'gradle'
150150
- name: Build GanttProject
@@ -192,7 +192,7 @@ jobs:
192192
- uses: actions/setup-java@v3
193193
with:
194194
distribution: 'liberica'
195-
java-version: 17.0.13
195+
java-version: 17.0.14
196196
java-package: jdk+fx
197197
cache: 'gradle'
198198
- name: Build GanttProject

biz.ganttproject.impex.msproject2/src/main/java/biz/ganttproject/impex/msproject2/ProjectFileImporterImpl.kt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -539,10 +539,16 @@ class ProjectFileImporterImpl(private val myProjectFile: ProjectFile, private va
539539
if (t.milestone) {
540540
return@Function Pair.create<TimeDuration, TimeDuration>(getTaskManager().createLength(1), null)
541541
}
542-
getDurations(
543-
ProjectFileImporter.toJavaDate(t.start.toLocalDate()),
544-
myNativeProject.timeUnitStack.defaultTimeUnit.adjustRight(ProjectFileImporter.toJavaDate(t.finish.toLocalDate()))
545-
)
542+
val defaultTimeUnit = myNativeProject.timeUnitStack.defaultTimeUnit
543+
var finishDate = ProjectFileImporter.toJavaDate(t.finish.toLocalDate())
544+
// If the finish time is at the midnight between the finish date and the next day then
545+
// this if condition will evaluate to false. Otherwise, e.g. when the finish date is at 20:00, we
546+
// will adjust it to the right properly.
547+
// Without this hack we would add one day to such tasks.
548+
if (defaultTimeUnit.adjustLeft(finishDate).before(finishDate)) {
549+
finishDate = defaultTimeUnit.adjustRight(finishDate);
550+
}
551+
getDurations(ProjectFileImporter.toJavaDate(t.start.toLocalDate()), finishDate);
546552
}
547553

548554
private val DURATION_FROM_START_AND_DURATION: java.util.function.Function<net.sf.mpxj.Task, Pair<TimeDuration, TimeDuration>> =

ganttproject-builder/BUILD-HISTORY-MAJOR

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,7 @@
55
2024-09-30 3312 again, maybe now we will build pretty signed notarized packages
66
2024-11-29 3313 update launchers in ZIP and dependencies in deb package with the latest Java runtimes
77
2024-11-29 3313 again, now with the right build number
8+
2025-01-23 3315
9+
2025-01-23 3315 again, now with updated agreement with Apple
10+
2025-01-29 3316 fixed issue 2569, added group to MSI silent
811
--

ganttproject-builder/BUILD-HISTORY-MINOR

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
2024-09-20 3310 ganttproject,biz.ganttproject.app.localization,biz.ganttproject.core
88
2024-09-21 3311 ganttproject,biz.ganttproject.app.localization,biz.ganttproject.core,org.ganttproject.impex.htmlpdf
99
2025-01-14 3314 ganttproject,biz.ganttproject.app.localization
10+
2025-01-22 3315 ganttproject,biz.ganttproject.app.localization

ganttproject-tester/test/biz/ganttproject/impex/msproject2/ProjectCalendarTest.kt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import net.sf.mpxj.ProjectFile
2626
import net.sourceforge.ganttproject.GanttProjectImpl
2727
import net.sourceforge.ganttproject.TestSetupHelper
2828
import net.sourceforge.ganttproject.importer.ImporterFromGanttFile
29+
import org.junit.jupiter.api.BeforeEach
2930
import org.junit.jupiter.api.Test
3031
import java.awt.Color
3132
import java.io.File
@@ -55,6 +56,7 @@ fun initLocale() {
5556
* Tests project calendar export and import.
5657
*/
5758
class ProjectCalendarTest: TestCase() {
59+
@BeforeEach
5860
override fun setUp() {
5961
super.setUp()
6062
initLocale()
@@ -137,6 +139,19 @@ class ProjectCalendarTest: TestCase() {
137139
.setDate(2023, 0, 2)
138140
.build().get(Calendar.WEEK_OF_YEAR))
139141
}
142+
143+
@Test
144+
fun `issue 2659`() {
145+
val project = GanttProjectImpl()
146+
val columns = ImporterFromGanttFile.VisibleFieldsImpl()
147+
val fileUrl = ProjectCalendarTest::class.java.getResource("/issue2659.xml")
148+
assertNotNull(fileUrl)
149+
val importer = ProjectFileImporter(project, columns, File(fileUrl.toURI()))
150+
importer.setPatchMspdi(false)
151+
importer.run()
152+
153+
assertEquals(1, project.taskManager.tasks[0].duration.length)
154+
}
140155
}
141156

142157
fun Date.toLocalDate() = toInstant().atZone(ZoneId.systemDefault()).toLocalDate()

ganttproject/src/main/java/biz/ganttproject/platform/PgpUtil.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ object PgpUtil {
4444
private val FP_CALC: KeyFingerPrintCalculator = BcKeyFingerprintCalculator()
4545

4646
private val ourPublicKey by lazy {
47-
val publicKeyResource = System.getProperty("app.update.public_key", "/ganttproject-3.3.3311.pub.asc")
47+
val publicKeyResource = System.getProperty("app.update.public_key", "/ganttproject-3.3.3315.pub.asc")
4848
val publicKeyStream = Eclipsito::class.java.getResourceAsStream(publicKeyResource) ?:
4949
throw RuntimeException(
5050
"Failed to read the public key from $publicKeyResource. This resource is missing.".also { LOG.error(it) }

0 commit comments

Comments
 (0)