Skip to content

Conversation

@bozali
Copy link

@bozali bozali commented Apr 11, 2020

It is now possible to use the crawler through the command-line e.g.
crawler.jar crawl --language="CPP" --build-system="CUSTOM" --stars=1
If you execute the jar file without any parameters it will load the configuration file.

It now supports now sub-commands but the only sub-command that is added is "crawl" with three parameters.
Also the configuration file was moved to the %USERDATA%/crawler/config.yaml for easier management (de-/serialization). Along the configuration changes some other models have been recreated like BuildSystem.java for the Yaml serializer. With the changes it is now possible to define custom Build-Systems inside the configuration.

WARNING:
There are some configuration items that needs to be changed. Not everything was changed with this pull request. There are some util classes that still use the empty static config file like FileHelper.getRepositoriesJsonFilePath. The static config file must be fully replaced by the CrawlerConfig.

Also I am not sure if my changes are working 100% like before this needs to be tested and reviewed!

bozali added 4 commits April 10, 2020 23:32
…t so the enduser is able to add BuildSystems through the configuration file
… deserialize to yaml. Also add the CrawlerConfig to the GitHubCrawler
…e, build-system and stars through the commandline
*/
private BuildSystem getFileContentsAtRootDir(Repository repository) {
BuildSystem detectedBuildSystem = BuildSystem.UNKNOWN;
BuildSystem detectedBuildSystem = BuildSystem.UNKOWN;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo in Unkown should be UNKNOWN

@Gismo150 Gismo150 self-requested a review April 13, 2020 10:07
Comment on lines +14 to +16
public static final String FILEPATH = null;//PropertyFileReader.getInstance().getProperty(EConfig.FILEPATH);
public static final String JSONFILENAME = null;//"repositories.json";
public static final String CUSTOMFILE = null;//PropertyFileReader.getInstance().getProperty(EConfig.CUSTOMFILE);
Copy link
Owner

@Gismo150 Gismo150 Apr 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These properties are never set by the configservice.
Read the comment on the ConfigurationService file.

The FileHelper.java file then needs to be updated to get the configs from the CrawlerConfig and not the old Config file.

Copy link
Owner

@Gismo150 Gismo150 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please read the comments within the commited files.

*
* @return Returns the @see CrawlerConfig.
*/
public CrawlerConfig getConfig() {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need another function that we can call to simply get the already parsed Configuration.
This service should only parse the yaml file once and provide the CrawlerConfig with a getter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants