pgm: Move gerrit.sh and BaseInit to init subpackage
Since the path to gerrit.sh was previously resolved relative to BaseInit within SitePathInitializer, move gerrit.sh to an init subdirectory as well. Change-Id: I4110a395e3e426faf5d8ed29db86f27a4790f69b
This commit is contained in:
parent
aba846138d
commit
5276ad45cd
@ -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',
|
||||
|
@ -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;
|
||||
|
@ -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<ReviewDb> schema;
|
||||
final GitRepositoryManager repositoryManager;
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user