diff --git a/gerrit-pgm/BUCK b/gerrit-pgm/BUCK index 8e40ee1953..4d4b7948c0 100644 --- a/gerrit-pgm/BUCK +++ b/gerrit-pgm/BUCK @@ -24,8 +24,11 @@ java_sources( visibility = ['PUBLIC'], ) -INIT_SRCS = [SRCS + 'BaseInit.java'] + glob([SRCS + 'init/*.java']) -INIT_RSRCS = ['src/main/resources/com/google/gerrit/pgm/libraries.config'] +INIT_SRCS = glob([SRCS + 'init/*.java']) +INIT_RSRCS = [ + 'src/main/resources/com/google/gerrit/pgm/libraries.config', + 'src/main/resources/com/google/gerrit/pgm/init/gerrit.sh', +] java_library( name = 'init', diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Init.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Init.java index 8dad506df5..f0115adce6 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Init.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/Init.java @@ -19,6 +19,7 @@ import com.google.common.base.Joiner; import com.google.common.collect.Lists; import com.google.gerrit.common.PageLinks; import com.google.gerrit.common.PluginData; +import com.google.gerrit.pgm.init.BaseInit; import com.google.gerrit.pgm.init.Browser; import com.google.gerrit.pgm.init.InitPlugins; import com.google.gerrit.pgm.init.api.ConsoleUI; diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/BaseInit.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/BaseInit.java similarity index 96% rename from gerrit-pgm/src/main/java/com/google/gerrit/pgm/BaseInit.java rename to gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/BaseInit.java index 62a9cf3a7d..b95859e905 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/BaseInit.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/BaseInit.java @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -package com.google.gerrit.pgm; +package com.google.gerrit.pgm.init; import static com.google.gerrit.server.schema.DataSourceProvider.Context.SINGLE_USER; import static com.google.inject.Stage.PRODUCTION; @@ -20,9 +20,6 @@ import static com.google.inject.Stage.PRODUCTION; import com.google.common.base.Objects; import com.google.common.collect.Lists; import com.google.gerrit.common.Die; -import com.google.gerrit.pgm.init.InitModule; -import com.google.gerrit.pgm.init.PluginsDistribution; -import com.google.gerrit.pgm.init.SitePathInitializer; import com.google.gerrit.pgm.init.api.ConsoleUI; import com.google.gerrit.pgm.init.api.InitFlags; import com.google.gerrit.pgm.init.api.InstallPlugins; @@ -166,8 +163,8 @@ public class BaseInit extends SiteProgram { return false; } - static class SiteInit { - final SitePaths site; + public static class SiteInit { + public final SitePaths site; final InitFlags flags; final ConsoleUI ui; final SitePathInitializer initializer; @@ -228,10 +225,10 @@ public class BaseInit extends SiteProgram { return ConsoleUI.getInstance(false); } - static class SiteRun { - final ConsoleUI ui; - final SitePaths site; - final InitFlags flags; + public static class SiteRun { + public final ConsoleUI ui; + public final SitePaths site; + public final InitFlags flags; final SchemaUpdater schemaUpdater; final SchemaFactory schema; final GitRepositoryManager repositoryManager; diff --git a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/SitePathInitializer.java b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/SitePathInitializer.java index 575ec1dd16..c172e7b03b 100644 --- a/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/SitePathInitializer.java +++ b/gerrit-pgm/src/main/java/com/google/gerrit/pgm/init/SitePathInitializer.java @@ -22,7 +22,6 @@ import static com.google.gerrit.pgm.init.InitUtil.savePublic; import static com.google.gerrit.pgm.init.InitUtil.saveSecure; import static com.google.gerrit.pgm.init.InitUtil.version; -import com.google.gerrit.pgm.BaseInit; import com.google.gerrit.pgm.init.api.ConsoleUI; import com.google.gerrit.pgm.init.api.InitFlags; import com.google.gerrit.pgm.init.api.InitStep; @@ -87,7 +86,7 @@ public class SitePathInitializer { savePublic(flags.cfg); saveSecure(flags.sec); - extract(site.gerrit_sh, BaseInit.class, "gerrit.sh"); + extract(site.gerrit_sh, getClass(), "gerrit.sh"); chmod(0755, site.gerrit_sh); chmod(0700, site.tmp_dir); diff --git a/gerrit-pgm/src/main/resources/com/google/gerrit/pgm/gerrit.sh b/gerrit-pgm/src/main/resources/com/google/gerrit/pgm/init/gerrit.sh similarity index 100% rename from gerrit-pgm/src/main/resources/com/google/gerrit/pgm/gerrit.sh rename to gerrit-pgm/src/main/resources/com/google/gerrit/pgm/init/gerrit.sh diff --git a/gerrit-war/src/main/java/com/google/gerrit/httpd/SiteInitializer.java b/gerrit-war/src/main/java/com/google/gerrit/httpd/SiteInitializer.java index 9665cdda45..37f8d25338 100644 --- a/gerrit-war/src/main/java/com/google/gerrit/httpd/SiteInitializer.java +++ b/gerrit-war/src/main/java/com/google/gerrit/httpd/SiteInitializer.java @@ -14,7 +14,7 @@ package com.google.gerrit.httpd; -import com.google.gerrit.pgm.BaseInit; +import com.google.gerrit.pgm.init.BaseInit; import com.google.gerrit.pgm.init.PluginsDistribution; import org.slf4j.Logger;