-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[vendordeps] handle null keysets better
- Loading branch information
1 parent
c5e7751
commit 7425883
Showing
3 changed files
with
109 additions
and
32 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
src/main/java/edu/wpi/first/nativeutils/vendordeps/VendorParsingError.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,9 @@ | ||
package edu.wpi.first.nativeutils.vendordeps; | ||
|
||
public enum VendorParsingError { | ||
MissingName, | ||
MissingCppDeps, | ||
MissingJniDeps, | ||
MissingJavaDeps, | ||
NoMavenUrl, | ||
} |
47 changes: 47 additions & 0 deletions
47
src/main/java/edu/wpi/first/nativeutils/vendordeps/VendorParsingException.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,47 @@ | ||
package edu.wpi.first.nativeutils.vendordeps; | ||
|
||
import org.gradle.tooling.BuildException; | ||
|
||
public class VendorParsingException extends Exception { | ||
public VendorParsingException(String file, VendorParsingError error) { | ||
switch (error) { | ||
case NoMavenUrl: | ||
System.err.println("The vendordep " + file + " is missing the required maven url."); | ||
break; | ||
|
||
case MissingCppDeps: | ||
System.err.println("The vendordep " + file + " is missing the required C++ dependencies key."); | ||
System.err.println("If you would not like to declare any Cpp deps use an empty list."); | ||
break; | ||
|
||
case MissingJniDeps: | ||
System.err.println("The vendordep " + file + " is missing the required Jni dependencies key."); | ||
System.err.println("If you would not like to declare any Jni deps use an empty list."); | ||
break; | ||
|
||
case MissingJavaDeps: | ||
System.err.println("The vendordep " + file + " is missing the required Java dependencies key."); | ||
System.err.println("If you would not like to declare any Java deps use an empty list."); | ||
break; | ||
|
||
default: | ||
throw new BuildException( | ||
"Unhandled case in VendorParsingException. This is a bug and should be reported", | ||
new Exception()); | ||
} | ||
} | ||
|
||
// should only be called if we don't have access to a name yet | ||
public VendorParsingException(VendorParsingError error) { | ||
switch (error) { | ||
case MissingName: | ||
System.err.println("One of the vendordep files does not have a name"); | ||
break; | ||
|
||
default: | ||
throw new BuildException( | ||
"Unhandled case in VendorParsingException. This is a bug and should be reported", | ||
new Exception()); | ||
} | ||
} | ||
} |
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