Repository navigation
Strongback Executable - New project and log converter - #15
Conversation
Files in the ant/project folder will be duplicated and modified for each project using strongback. Files in the ant/strongback folder will be distributed with the library.
There was a problem hiding this comment.
Yes. Basically, we need a properties file in the JAR (e.g., org/strongback/strongback.properties) that would look like:
version=${project.version}
buildDate=${project.version}
Ant can either generate this or append to an existing file in the source, or it can even replace these variables when it builds (see here).
Then, we add methods in Strongback to expose these values. For example, we could add this interface:
public static interface Metadata {
public String version();
public String buildDate();
}
and then add a method to the Strongback class that reads the properties file and returns the values. Really, Metadata just wraps that properties file using a Properties object:
public static Metadata metadata() {
InputStream file = Strongback.class.getResourceAsStream("org/strongback/strongback.properties");
assert file != null;
Properties props = Properties.load(file);
return new Metadata() {
public String version() {
return props.getProperty("version")
}
public String buildDate() {
return props.getProperty("buildDate")
}
};
}
Maven makes it very easy to update these properties files with the Maven-specific properties (like ${project.version}), but Ant should be fine since we'll likely have to specify the version in the build script anyway.
You can either implement this now, or keep your TODO and create an issue to fix it.
|
Looks great. The only question is whether you want to handle the TODO mentioned above now or later, and that's up to you. |
|
BTW, I think we should hold off on the |
|
One more thing: you said the directory structure would include: Why create 2 JAR files? Wouldn't it just be easier to create a single |
|
I thought we talked about having one |
|
@Zabot, I'd suggest having the script look at the first parameter and using it to pick the class file to run as main, and passing all other parameters as-is. But, it'd be nice if it could support a |
|
Bat file works in wine, I don't have a native windows machine to test it on right now. Both scripts do have a |
|
@Zabot, can you combine the scripts into one? I'd really like to have a single executable. |
|
I did, |
|
@Zabot, sorry about that. Looks good to me. Is there anything else you want to wait for, or can this be merged? |
|
Its good to go. Anything else can be taken care of in separate issues. |
|
Thanks, @Zabot. Nice work, as usual. |
Strongback Executable - New project and log converter
Here it is, there still is a bit of cleanup to do, but its pretty much ready to go, and it does affect #4, so I wanted to get it pushed.
NewProjectfunctions as both anew projectand aconvert projectif the override flag is set. It doesn't set any eclipse settings (classpath variables or user libraries), that will be handled by either another command, or instructions to the user, in case their wpilib is in a strange place.LogDecodergot copied, the old one still works, but it can probably be deprecated if not removed entirely now.IncludeInBuildshould be copied into the distributed file by Creating a build system #4.strongback.propertiesshould end up in the root of the distribution. That is the only file that needs to go somewhere specific, everything else can use a variable instrongback.properties. Below is the structure for the distribution file that I used for testing. In the actual distribution, the links will be replaced by the file they are linking to,/is the repository root.Before merge:
Add strongback 'install' script/appSupersedes #14
Closes #6
Distribution file structure: