use of org.fagu.version.Version in project fmv by f-agu.
the class BuildMapping method versionDateMap.
// *************************************************
/**
* @return
*/
private static NavigableMap<Version, LocalDate> versionDateMap() {
NavigableMap<Version, LocalDate> map = new TreeMap<>();
map.put(new Version(3, 2, 2), LocalDate.of(2016, 12, 16));
map.put(new Version(3, 2), LocalDate.of(2016, 11, 6));
map.put(new Version(3, 1, 5), LocalDate.of(2016, 10, 24));
map.put(new Version(3, 1, 4), LocalDate.of(2016, 10, 19));
map.put(new Version(3, 0, 1), LocalDate.of(2016, 10, 19));
map.put(new Version(3), LocalDate.of(2016, 2, 17));
map.put(new Version(2, 8, 6), LocalDate.of(2016, 2, 3));
map.put(new Version(2, 8, 5), LocalDate.of(2016, 1, 15));
map.put(new Version(2, 8, 4), LocalDate.of(2015, 12, 23));
map.put(new Version(2, 8, 3), LocalDate.of(2015, 12, 3));
map.put(new Version(2, 8, 2), LocalDate.of(2015, 12, 3));
map.put(new Version(2, 8, 1), LocalDate.of(2015, 10, 15));
map.put(new Version(2, 8), LocalDate.of(2015, 10, 06));
map.put(new Version(2, 7), LocalDate.of(2015, 6, 12));
map.put(new Version(2, 5, 2), LocalDate.of(2014, 12, 30));
map.put(new Version(2, 4, 5), LocalDate.of(2014, 12, 30));
map.put(new Version(2, 2, 11), LocalDate.of(2014, 12, 30));
map.put(new Version(1, 2, 11), LocalDate.of(2014, 12, 30));
map.put(new Version(2, 2, 3), LocalDate.of(2014, 6, 19));
map.put(new Version(2, 2, 2), LocalDate.of(2014, 5, 22));
map.put(new Version(2, 2, 1), LocalDate.of(2014, 4, 10));
map.put(new Version(2, 1, 4), LocalDate.of(2014, 2, 26));
map.put(new Version(2, 1, 3), LocalDate.of(2014, 1, 21));
map.put(new Version(2, 1, 1), LocalDate.of(2013, 11, 20));
map.put(new Version(2, 1), LocalDate.of(2013, 10, 30));
map.put(new Version(2, 0, 2), LocalDate.of(2013, 10, 26));
map.put(new Version(2, 0, 1), LocalDate.of(2013, 9, 26));
map.put(new Version(1, 2), LocalDate.of(2013, 3, 27));
map.put(new Version(1, 1, 3), LocalDate.of(2013, 3, 03));
map.put(new Version(1, 1, 1), LocalDate.of(2013, 1, 20));
map.put(new Version(1, 1), LocalDate.of(2013, 1, 8));
map.put(new Version(1, 0, 1), LocalDate.of(2013, 1, 2));
map.put(new Version(0, 8), LocalDate.of(2011, 6, 23));
map.put(new Version(0, 7, 1), LocalDate.of(2011, 6, 23));
return map;
}
use of org.fagu.version.Version in project fmv by f-agu.
the class FFSoftPolicy method toSoftFound.
/**
* @param ffInfo
* @return
*/
public static SoftFound toSoftFound(FFInfo ffInfo) {
Objects.requireNonNull(ffInfo);
Version version = ffInfo.getVersion();
if (version != null) {
return check(version.isUpperOrEqualsThan(MIN_VERSION), ffInfo);
}
Integer builtVersion = ffInfo.getBuiltVersion();
if (builtVersion != null) {
return check(builtVersion > MIN_BUILD_VERSION, ffInfo);
}
Date builtDate = ffInfo.getBuiltDate();
if (builtDate != null) {
return check(builtDate.getTime() > MIN_TIME, ffInfo);
}
return SoftFound.foundError(ffInfo.getFile(), "Unable to verify the soft: " + ffInfo);
}
use of org.fagu.version.Version in project fmv by f-agu.
the class FFSoftProvider method createParser.
// ***********************************************************************
/**
* @param file
* @return
*/
Parser createParser(File file) {
return new Parser() {
private static final String CONFIGURATION_START_PATTERN = "configuration:";
private Version version = null;
private Date builtDate = null;
// configuration
private Set<String> configuration = null;
// lib versions
private Map<String, Version> libVersions = new HashMap<>();
private SoftFound softFound;
@Override
public void readLine(final String lineIn) {
if (StringUtils.isBlank(lineIn) || softFound != null) {
return;
}
String line = lineIn.trim();
// version
Matcher matcher = FF_FIRSTLINE_PATTERN.matcher(line);
if (matcher.matches()) {
String parsedTool = matcher.group(1).trim();
if (parsedTool.equalsIgnoreCase(getName())) {
version = getVersion(matcher.group(2).trim());
return;
}
softFound = SoftFound.foundError(file, "Wrong tool, need " + getName() + " and found " + parsedTool + ": " + line);
}
// configuration
if (line.startsWith(CONFIGURATION_START_PATTERN)) {
configuration = getConfiguration(StringUtils.substringAfter(line, CONFIGURATION_START_PATTERN).trim());
return;
}
// built
matcher = BUILD_PATTERN.matcher(line);
if (matcher.matches()) {
builtDate = getBuiltDate(matcher);
return;
}
// lib versions
matcher = LIBVERSION_PATTERN.matcher(line);
if (matcher.matches()) {
addLibVersions(libVersions, matcher);
}
}
@Override
public SoftFound closeAndParse(String cmdLineStr, int exitValue) throws IOException {
if (softFound != null) {
return softFound;
}
Integer builtVersion = null;
if (version != null && version.size() == 1) {
final int minBuildVersion = 100;
int major = version.getFieldValue(VersionUnit.VF_0_MAJOR, 0);
// N-70767-gd24af70
if (major > minBuildVersion) {
builtVersion = major;
version = null;
}
}
FFInfo ffInfo = new FFInfo(file, version, getName(), builtDate, builtVersion, configuration, libVersions);
return FFSoftPolicy.toSoftFound(ffInfo);
}
};
}
use of org.fagu.version.Version in project fmv by f-agu.
the class FFInfoTestCase method testFFMPEGFull_v2_6_1.
/**
* @throws Exception
*/
@Test
public void testFFMPEGFull_v2_6_1() throws Exception {
Parser parser = newParserFFMpeg();
parser.readLine("ffmpeg version 2.6.1 Copyright (c) 2000-2015 the FFmpeg developers");
parser.readLine("built with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)");
parser.readLine("configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvo-aacenc --enable-libvidstab");
parser.readLine("libavutil 54. 20.100 / 54. 20.100");
parser.readLine("libavcodec 56. 26.100 / 56. 26.100");
parser.readLine("libavformat 56. 25.101 / 56. 25.101");
parser.readLine("libavdevice 56. 4.100 / 56. 4.100");
parser.readLine("libavfilter 5. 11.102 / 5. 11.102");
parser.readLine("libavresample 2. 1. 0 / 2. 1. 0");
parser.readLine("libswscale 3. 1.101 / 3. 1.101");
parser.readLine("libswresample 1. 1.100 / 1. 1.100");
assertFull(parser, new Version(2, 6, 1), date(2014, 12, 30), null);
}
use of org.fagu.version.Version in project fmv by f-agu.
the class FFInfoTestCase method testFFProbeFull_v2_6_1.
/**
* @throws Exception
*/
@Test
public void testFFProbeFull_v2_6_1() throws Exception {
Parser parser = newParserProbe();
parser.readLine("ffprobe version 2.6.1 Copyright (c) 2007-2015 the FFmpeg developers");
parser.readLine("built with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1)");
parser.readLine("configuration: --extra-libs=-ldl --prefix=/opt/ffmpeg --enable-avresample --disable-debug --enable-nonfree --enable-gpl --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --disable-decoder=amrnb --disable-decoder=amrwb --enable-libpulse --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-libvorbis --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libspeex --enable-libass --enable-avisynth --enable-libsoxr --enable-libxvid --enable-libvo-aacenc --enable-libvidstab");
parser.readLine("libavutil 54. 20.100 / 54. 20.100");
parser.readLine("libavcodec 56. 26.100 / 56. 26.100");
parser.readLine("libavformat 56. 25.101 / 56. 25.101");
parser.readLine("libavdevice 56. 4.100 / 56. 4.100");
parser.readLine("libavfilter 5. 11.102 / 5. 11.102");
parser.readLine("libavresample 2. 1. 0 / 2. 1. 0");
parser.readLine("libswscale 3. 1.101 / 3. 1.101");
parser.readLine("libswresample 1. 1.100 / 1. 1.100");
parser.readLine("libpostproc 53. 3.100 / 53. 3.100");
assertFull(parser, new Version(2, 6, 1), date(2014, 12, 30), null);
}
Aggregations