commit | author | age
|
f6740d
|
1 |
/*
|
JM |
2 |
* Copyright 2011 gitblit.com.
|
|
3 |
*
|
|
4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5 |
* you may not use this file except in compliance with the License.
|
|
6 |
* You may obtain a copy of the License at
|
|
7 |
*
|
|
8 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9 |
*
|
|
10 |
* Unless required by applicable law or agreed to in writing, software
|
|
11 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13 |
* See the License for the specific language governing permissions and
|
|
14 |
* limitations under the License.
|
|
15 |
*/
|
|
16 |
package com.gitblit;
|
|
17 |
|
|
18 |
import java.io.File;
|
|
19 |
import java.io.IOException;
|
|
20 |
import java.util.Collections;
|
|
21 |
import java.util.List;
|
|
22 |
|
|
23 |
import com.gitblit.build.Build;
|
|
24 |
|
|
25 |
/**
|
|
26 |
* Downloads dependencies and launches command-line Federation client.
|
|
27 |
*
|
|
28 |
* @author James Moger
|
|
29 |
*
|
|
30 |
*/
|
|
31 |
public class FederationClientLauncher {
|
|
32 |
|
|
33 |
public static void main(String[] args) {
|
|
34 |
// download federation client runtime dependencies
|
|
35 |
Build.federationClient();
|
|
36 |
|
|
37 |
File libFolder = new File("ext");
|
|
38 |
List<File> jars = Launcher.findJars(libFolder.getAbsoluteFile());
|
|
39 |
|
|
40 |
// sort the jars by name and then reverse the order so the newer version
|
|
41 |
// of the library gets loaded in the event that this is an upgrade
|
|
42 |
Collections.sort(jars);
|
|
43 |
Collections.reverse(jars);
|
|
44 |
for (File jar : jars) {
|
|
45 |
try {
|
|
46 |
Launcher.addJarFile(jar);
|
|
47 |
} catch (IOException e) {
|
|
48 |
|
|
49 |
}
|
|
50 |
}
|
|
51 |
|
|
52 |
FederationClient.main(args);
|
|
53 |
}
|
|
54 |
}
|