microsoft/vscode-react-native

Public

mirrored from https://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
fix-ts-error1

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/extension/services/validationService/checks/gradle.ts

54lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for details.
3
4import * as nls from "vscode-nls";
5import {
6 basicCheck,
7 createNotFoundMessage,
8 createVersionErrorMessage,
9 parseVersion,
10} from "../util";
11import { ValidationCategoryE, IValidation, ValidationResultT } from "./types";
12
13nls.config({
14 messageFormat: nls.MessageFormat.bundle,
15 bundleFormat: nls.BundleFormat.standalone,
16})();
17
18const toLocale = nls.loadMessageBundle();
19
20const label = "Gradle";
21
22async function test(): Promise<ValidationResultT> {
23 const result = await basicCheck({
24 command: "gradle",
25 getVersion: parseVersion.bind(null, "gradle -version", /gradle (.*?)( |$)/gim),
26 });
27
28 if (!result.exists) {
29 return {
30 status: "failure",
31 comment: createNotFoundMessage(label),
32 };
33 }
34
35 if (result.versionCompare === undefined) {
36 return {
37 status: "failure",
38 comment: createVersionErrorMessage(label),
39 };
40 }
41
42 return {
43 status: "success",
44 };
45}
46
47const main: IValidation = {
48 label,
49 description: toLocale("GradleTestDescription", "Requried for building android apps"),
50 category: ValidationCategoryE.Android,
51 exec: test,
52};
53
54export default main;
55