use of com.synopsys.integration.detectable.detectables.dart.PubSpecYamlNameVersionParser in project synopsys-detect by blackducksoftware.
the class DetectableFactory method createDartPubSpecLockDetectable.
public DartPubSpecLockDetectable createDartPubSpecLockDetectable(DetectableEnvironment environment) {
PubSpecLockParser pubSpecLockParser = new PubSpecLockParser();
PubSpecYamlNameVersionParser pubSpecYamlNameVersionParser = new PubSpecYamlNameVersionParser();
PubSpecExtractor pubSpecExtractor = new PubSpecExtractor(pubSpecLockParser, pubSpecYamlNameVersionParser);
return new DartPubSpecLockDetectable(environment, fileFinder, pubSpecExtractor);
}
use of com.synopsys.integration.detectable.detectables.dart.PubSpecYamlNameVersionParser in project synopsys-detect by blackducksoftware.
the class DetectableFactory method createDartPubDepDetectable.
public DartPubDepDetectable createDartPubDepDetectable(DetectableEnvironment environment, DartPubDepsDetectableOptions dartPubDepsDetectableOptions, DartResolver dartResolver, FlutterResolver flutterResolver) {
PubDepsParser pubDepsParser = new PubDepsParser();
PubSpecYamlNameVersionParser pubSpecYamlNameVersionParser = new PubSpecYamlNameVersionParser();
PubDepsExtractor pubDepsExtractor = new PubDepsExtractor(executableRunner, pubDepsParser, pubSpecYamlNameVersionParser, toolVersionLogger);
return new DartPubDepDetectable(environment, fileFinder, pubDepsExtractor, dartPubDepsDetectableOptions, dartResolver, flutterResolver);
}
use of com.synopsys.integration.detectable.detectables.dart.PubSpecYamlNameVersionParser in project synopsys-detect by blackducksoftware.
the class PubSpecYamlNameVersionParserTest method testParseNameVersion.
@Test
public void testParseNameVersion() throws IOException {
List<String> pubspecYaml = Arrays.asList("name: contacts_app", "description: A new Flutter project.", "", "# Test file for PubSpecYamlNameVersionParserTest", "version: 1.0.0+1");
PubSpecYamlNameVersionParser nameVersionParser = new PubSpecYamlNameVersionParser();
NameVersion nameVersion = nameVersionParser.parseNameVersion(pubspecYaml).get();
Assertions.assertEquals("contacts_app", nameVersion.getName());
Assertions.assertEquals("1.0.0+1", nameVersion.getVersion());
}
Aggregations