-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If a save file cannot be loaded, no changes happen to the pipeline and the user is notified. This will happen for any save file, pre-versioning or otherwise. When saving a loaded project, the original version string will be changed to the version of GRIP that saved it. Pre-versioning save files will also be upgraded to the versioned format and have the current version of GRIP
- Loading branch information
1 parent
54d98ea
commit f3a0f53
Showing
53 changed files
with
477 additions
and
151 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package edu.wpi.grip.core; | ||
|
||
import edu.wpi.grip.core.exception.IncompatibleVersionException; | ||
|
||
import com.github.zafarkhaja.semver.Version; | ||
|
||
/** | ||
* Manager for GRIP versions. | ||
*/ | ||
public final class VersionManager { | ||
|
||
/** | ||
* The final release of GRIP without versioned saves. | ||
*/ | ||
public static final Version LAST_UNVERSIONED_RELEASE = Version.valueOf("1.5.0"); | ||
|
||
/** | ||
* The current version of GRIP. | ||
*/ | ||
public static final Version CURRENT_VERSION = Version.valueOf("2.0.0-beta"); | ||
|
||
/** | ||
* Checks compatibility between two versions of GRIP. | ||
* | ||
* @param current the current version of GRIP | ||
* @param check the version to check | ||
* | ||
* @throws IncompatibleVersionException if the versions are incompatible | ||
*/ | ||
public static void checkVersionCompatibility(Version current, Version check) | ||
throws IncompatibleVersionException { | ||
if (check.getMajorVersion() > current.getMajorVersion() | ||
|| check.getMinorVersion() > current.getMinorVersion()) { | ||
throw new IncompatibleVersionException("Incompatible future version: " + check); | ||
} | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
core/src/main/java/edu/wpi/grip/core/exception/IncompatibleVersionException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package edu.wpi.grip.core.exception; | ||
|
||
/** | ||
* An exception thrown when trying to load a saved project created in an incompatible version | ||
* of GRIP. | ||
*/ | ||
public class IncompatibleVersionException extends InvalidSaveException { | ||
|
||
public IncompatibleVersionException(String message) { | ||
super(message); | ||
} | ||
|
||
public IncompatibleVersionException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
core/src/main/java/edu/wpi/grip/core/exception/InvalidSaveException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package edu.wpi.grip.core.exception; | ||
|
||
/** | ||
* An exception thrown when trying to load an invalid saved project. | ||
*/ | ||
public class InvalidSaveException extends GripException { | ||
|
||
public InvalidSaveException(String message) { | ||
super(message); | ||
} | ||
|
||
public InvalidSaveException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.