forked from mmcc007/screenshots
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request mmcc007#84 from mmcc007/#77_output_dir
Added archive run mode to generate screenshots for local use only
- Loading branch information
Showing
15 changed files
with
214 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import 'globals.dart'; | ||
import 'utils.dart' as utils; | ||
|
||
/// Archive screenshots generated by a run. | ||
class Archive { | ||
static final _timeStamp = getTimestamp(); | ||
|
||
final _stagingTestDir; | ||
final archiveDirPrefix; | ||
|
||
Archive(String stagingDir, String archiveDir) | ||
: _stagingTestDir = '$stagingDir/$kTestScreenshotsDir', | ||
archiveDirPrefix = '$archiveDir/$_timeStamp'; | ||
|
||
String dstDir(DeviceType deviceType, String locale) => | ||
'$archiveDirPrefix/${utils.getStringFromEnum(deviceType)}/$locale'; | ||
} | ||
|
||
/// Generates timestamp as [DateTime] in milliseconds | ||
DateTime getTimestamp() { | ||
final timestamp = DateTime.fromMillisecondsSinceEpoch( | ||
DateTime.now().millisecondsSinceEpoch); | ||
return timestamp; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.