ProjectInfo_Path.m 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // ProjectInfo_Path.m
  3. // UUTUtils
  4. //
  5. // Created by zhuge on 2017/12/25.
  6. // Copyright © 2017年 zhuge. All rights reserved.
  7. // 存放目录信息
  8. #import "ProjectInfo_Path.h"
  9. #import "DataUtils.h"
  10. #import "ZGFileUtils.h"
  11. @implementation ProjectInfo_Path_Config
  12. + (ProjectInfo_Path_Config *)createWithRoot:(NSString *)projectRoot {
  13. ProjectInfo_Path_Config *config = [[ProjectInfo_Path_Config alloc] init];
  14. [config initWithRoot:projectRoot];
  15. return config;
  16. }
  17. - (void)initWithRoot:(NSString *)projectRoot {
  18. self.root = [projectRoot stringByAppendingString:@"/config"];
  19. self.translate = [self.root stringByAppendingString:@"/translate"];
  20. self.icon = [self.root stringByAppendingString:@"/playstore.png"];
  21. self.top = [self.root stringByAppendingString:@"/top.jpg"];
  22. // 查找keystore
  23. NSArray *arrKeystores = [ZGFileUtils arrayOfFileAtDir:self.root extensionFilterArray:@[@"keystore"]];
  24. self.keystore = [arrKeystores firstObject];
  25. }
  26. @end
  27. @implementation ProjectInfo_Path
  28. + (ProjectInfo_Path *)create:(NSString *)package {
  29. ProjectInfo_Path *path = [[ProjectInfo_Path alloc] init];
  30. [path init:package];
  31. return path;
  32. }
  33. - (void)init:(NSString *)package {
  34. self.root = [NSString stringWithFormat:@"%@/%@", [DataUtils getRootPath], package];
  35. self.config = [ProjectInfo_Path_Config createWithRoot:self.root];
  36. self.cache = [self.root stringByAppendingString:@"/cache"];
  37. self.configPlist = [self.root stringByAppendingString:@"/config.plist"];
  38. self.adJsonPath = [self.root stringByAppendingString:@"/ad.json"];
  39. self.output = [self.root stringByAppendingString:@"/output"];
  40. self.apkCode = [self.root stringByAppendingString:@"/apkCode"];
  41. self.adNamePlist = [self.root stringByAppendingString:@"/adNames.plist"];
  42. self.adNameInCSVPlist = [self.root stringByAppendingString:@"/adNameInCSVs.plist"];
  43. self.adWorthJsonPath = [self.root stringByAppendingString:@"/ad_worth.json"];
  44. }
  45. @end