We updated to a newer scijava-common long ago

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Help catch problems earlier

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Allow removing a file with obsolete dependencies

This fixes https://github.com/imagej/imagej-updater/issues/24.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Verify that files with obsolete dependencies can be made obsolete

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Merge branch 'remove-with-obsolete-dep'

The main purpose of this branch is to fix
https://github.com/imagej/imagej-updater/issues/24 reported by the
tireless Curtis Rueden: files could not be marked as obsolete when
they had obsoleted dependencies.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a date/time formatter

This version is slightly improved over imagej-ui-swing's FileDetails
and should probably be used in the next version of said component.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
FileObject: add a method to determine the file name as per a given date

We're about to add a command-line method to list the history as per the
current set of update sites. To make this as informative as possible,
let's use the correct file names.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add the (hidden) 'history' function to the command-line updater

It is not really correct what this function shows because we have no
record *when* now-obsolete files became obsolete, or whether they
had been obsolete anytime in between. Nor, for that matter when files
got unshadowed/shadowed.

So let's keep this function out of the usage lest people expect it
to work flawlessly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Allow disabling the file size check

In the upcoming 'downgrade' command, we actually do not know the
correct file size. Let's interpret the file size '-1' as: Do Not
Care, Please.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a hidden command-line option for downgrading

Due to lack of metadata, the exact time when files became
obsolete/unshadowed is impossible to determine. As a consequence,
downgrading cannot be accurate. Therefore, we will keep this method
hidden because it is very likely that unsuspecting users, even when
they consider themselves savvy ones, actually in particular those,
will shoot themselves into the foot using this function.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a --simulate option to the downgrade command

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Test the 'downgrade' command

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a class to compare .dll files for *real* changes

... i.e. *not* the time stamp nor the .pdb GUID.

The problem is that recompiling *identical* code on Windows does not
result in byte-identical .dll files. The reason is that the .dll file
format *defines* time stamps to be part of the format. Even without
timestamps, there is another problem: disregarding the debug option,
Microsoft Visual C compiler still incorporates .pdb information, always,
including a Global Unified IDentifier that changes *every single time*
source code is compiled.

The DllFile class is designed to analyze .dll files and determine
whether they contain *functional* changes as opposed to circumstantial
ones, such as time stamps or GUIDs.

We need this functionality to be able to avoid uploading "different"
files every night when uploading Micro-Manager's nightly build.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add example .dll files for the upcoming DllFile test

The empty.dll file was generated by

	: > empty.c
	gcc -s -o shared empty.dll empty.c

and recompiled.dll was generated by recompiling at a later time.

The original plan was to adjust the time date stamps with PE Explorer's
trial version's Tools>TimeDateStamp Adjuster to the kick-off time of one
of the most exciting games in the past few years.

However, PE Explorer is a little bit too overzealous and does more than
just adjusting the time date stamp: in this developer's tests, it added
a BSS section!

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

squash! Add example .dll files for the upcoming DllFile test

Mention PE Explorer being too overzealous

squash! Add example .dll files for the upcoming DllFile test

Mention PE Explorer being too overzealous
Verify that the DllFile class correctly compares real .dll files

When recompiling an empty .c file into a .dll, it is a pretty surprising
thing for the unsuspecting developer that the result is not byte-wise
identical. The reason is that several time date stamps are part of the
.dll file format, and that there is a checksum, too, that changes with
the time date stamps, too.

To handle such cases, we just added a class to compare .dll files and
report whether they are functionally identical.

This commit adds a unit test.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
DllFile: compare against a URLConnection, not a File

This makes it more convenient for the intended use case: to compare .dll files against the current version on the update site.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Introduce the 'revert-unreal-changes' command

When .dll files are recompiled, their checksums change. We would like
to revert those changes, and only those changes, when uploading, say,
the Micro-Manager nightly build.

This command handles .dll files for the moment, but the idea is to
be able to handle all kinds of 'unreal' file changes in the future,
via plugins.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Updater (cmd-line): restrict output to 79 columns/line

This helps challenged (and challenging) platforms such as Windows,
where writing the last character of the line *automatically* wraps
around to the next line.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When moving .dll files out of the way, treat them like .exe files

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Merge branch 'modified-dlls' into 'downgrade'

The whole purpose of the 'downgrade' branch is to test the
'modified-dlls' branch, i.e. the new command to revert timestamp
only changes to .dll files when they are simply recompiled from
the same source code.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>