Skip to content

Commit 5668758

Browse files
committed
Fix Gulpfile to not mangle jars
1 parent c2d788e commit 5668758

File tree

1 file changed

+25
-5
lines changed

1 file changed

+25
-5
lines changed

gulpfile.js

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,33 @@ function downloadServerImpl() {
144144

145145
function buildServerImpl() {
146146
fs.rmSync('./server', { recursive: true, force: true });
147-
cp.execSync(mvnw() + ' clean package -DskipTests=true', {
148-
cwd: BAZEL_ECLIPSE_DIR,
149-
stdio: [0, 1, 2],
150-
});
147+
const jdtlsJar = fs
148+
.readdirSync(
149+
BAZEL_ECLIPSE_DIR + '/releng/p2repository/target/repository/plugins/'
150+
)
151+
.find(
152+
(file) =>
153+
file.startsWith('com.salesforce.bazel.eclipse.jdtls') &&
154+
file.endsWith('.jar')
155+
);
156+
157+
if (jdtlsJar) {
158+
console.log(
159+
'NOTE: skipping build and re-using existing "' +
160+
jdtlsJar +
161+
'" from ../bazel-eclipse/releng/p2repository/target/repository/plugins'
162+
);
163+
} else {
164+
cp.execSync(mvnw() + ' clean package -DskipTests=true', {
165+
cwd: BAZEL_ECLIPSE_DIR,
166+
stdio: [0, 1, 2],
167+
});
168+
}
151169
gulp
152170
.src(
153-
BAZEL_ECLIPSE_DIR + '/releng/p2repository/target/repository/plugins/*.jar'
171+
BAZEL_ECLIPSE_DIR +
172+
'/releng/p2repository/target/repository/plugins/*.jar',
173+
{ encoding: false } // prevent gulp from reading the content as it's not needed
154174
)
155175
.pipe(DROP_JAR_VERSION)
156176
.pipe(jarIsIncludedInPackageJson)

0 commit comments

Comments
 (0)