• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package org.robolectric;
2 
3 /**
4  * Class that encapsulates reading global configuration options from the Java system properties file.
5  */
6 public class RoboSettings {
7 
8   private static String mavenRepositoryId;
9   private static String mavenRepositoryUrl;
10   private static String mavenRepositoryUserName;
11   private static String mavenRepositoryPassword;
12   private static boolean useGlobalScheduler;
13 
14   static {
15     mavenRepositoryId = System.getProperty("robolectric.dependency.repo.id", "sonatype");
16     mavenRepositoryUrl = System.getProperty("robolectric.dependency.repo.url", "https://oss.sonatype.org/content/groups/public/");
17     mavenRepositoryUserName = System.getProperty("robolectric.dependency.repo.username");
18     mavenRepositoryPassword = System.getProperty("robolectric.dependency.repo.password");
19     useGlobalScheduler = Boolean.getBoolean("robolectric.scheduling.global");
20   }
21 
getMavenRepositoryId()22   public static String getMavenRepositoryId() {
23     return mavenRepositoryId;
24   }
25 
setMavenRepositoryId(String mavenRepositoryId)26   public static void setMavenRepositoryId(String mavenRepositoryId) {
27     RoboSettings.mavenRepositoryId = mavenRepositoryId;
28   }
29 
getMavenRepositoryUrl()30   public static String getMavenRepositoryUrl() {
31     return mavenRepositoryUrl;
32   }
33 
setMavenRepositoryUrl(String mavenRepositoryUrl)34   public static void setMavenRepositoryUrl(String mavenRepositoryUrl) {
35     RoboSettings.mavenRepositoryUrl = mavenRepositoryUrl;
36   }
37 
getMavenRepositoryUserName()38   public static String getMavenRepositoryUserName() {
39     return mavenRepositoryUserName;
40   }
41 
setMavenRepositoryUserName(String mavenRepositoryUserName)42   public static void setMavenRepositoryUserName(String mavenRepositoryUserName) {
43     RoboSettings.mavenRepositoryUserName = mavenRepositoryUserName;
44   }
45 
getMavenRepositoryPassword()46   public static String getMavenRepositoryPassword() {
47     return mavenRepositoryPassword;
48   }
49 
setMavenRepositoryPassword(String mavenRepositoryPassword)50   public static void setMavenRepositoryPassword(String mavenRepositoryPassword) {
51     RoboSettings.mavenRepositoryPassword = mavenRepositoryPassword;
52   }
53 
isUseGlobalScheduler()54   public static boolean isUseGlobalScheduler() {
55     return useGlobalScheduler;
56   }
57 
setUseGlobalScheduler(boolean useGlobalScheduler)58   public static void setUseGlobalScheduler(boolean useGlobalScheduler) {
59     RoboSettings.useGlobalScheduler = useGlobalScheduler;
60   }
61 }
62