-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
29 changed files
with
1,677 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,9 @@ tsc | |
cd ../command | ||
npm install | ||
tsc | ||
cd ../env | ||
npm install | ||
tsc | ||
cd ../../ | ||
|
||
# Create extension | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,8 @@ cd ../analyze | |
tsc | ||
cd ../command | ||
tsc | ||
cd ../env | ||
tsc | ||
cd ../../ | ||
|
||
# Create extension | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const task = require("azure-pipelines-task-lib"); | ||
const path = require("path"); | ||
// paths | ||
const FLUTTER_EXE_RELATIVEPATH = 'bin'; | ||
const DART_EXE_RELATIVEPATH = 'cache/dart-sdk/bin'; | ||
const FLUTTER_PUB_CACHE_RELATIVEPATH = '.pub-cache/bin'; | ||
// env variables used as $('<env_var_name>') like $(FlutterToolPath)/flutter | ||
const FLUTTER_TOOL_PATH_ENV_VAR = 'FlutterToolPath'; | ||
const FLUTTER_PUBCACHE_PATH_ENV_VAR = 'FlutterPubCachePath'; | ||
const DART_TOOL_PATH_ENV_VAR = 'DartToolPath'; | ||
function main() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
// 1. Get where to get the path from | ||
let pathType = task.getInput('pathType', true); | ||
// 1.1 Getting path | ||
var flutterDir = task.getInput(pathType, true); | ||
// 2. Creating flutter environment variable | ||
let fullFlutterPath = path.join(flutterDir, FLUTTER_EXE_RELATIVEPATH); | ||
task.debug(`Set ${FLUTTER_TOOL_PATH_ENV_VAR} with '${fullFlutterPath}'`); | ||
task.setVariable(FLUTTER_TOOL_PATH_ENV_VAR, fullFlutterPath); | ||
// 2.1 Create flutter pub-cache environment variable | ||
let fullPubCachePath = path.join(flutterDir, FLUTTER_PUB_CACHE_RELATIVEPATH); | ||
task.debug(`Set ${DART_TOOL_PATH_ENV_VAR} with '${fullPubCachePath}'`); | ||
task.setVariable(FLUTTER_PUBCACHE_PATH_ENV_VAR, fullPubCachePath); | ||
// 2.2 Create dart environment variable | ||
let fullDartPath = path.join(fullFlutterPath, DART_EXE_RELATIVEPATH); | ||
task.debug(`Set ${DART_TOOL_PATH_ENV_VAR} with '${fullDartPath}'`); | ||
task.setVariable(DART_TOOL_PATH_ENV_VAR, fullDartPath); | ||
task.setResult(task.TaskResult.Succeeded, "Environment Variables Set"); | ||
}); | ||
} | ||
main().catch(error => { | ||
task.setResult(task.TaskResult.Failed, error); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import * as task from "azure-pipelines-task-lib"; | ||
import * as path from 'path'; | ||
|
||
// paths | ||
const FLUTTER_EXE_RELATIVEPATH = 'bin'; | ||
const DART_EXE_RELATIVEPATH = 'cache/dart-sdk/bin'; | ||
const FLUTTER_PUB_CACHE_RELATIVEPATH = '.pub-cache/bin'; | ||
|
||
// env variables used as $('<env_var_name>') like $(FlutterToolPath)/flutter | ||
const FLUTTER_TOOL_PATH_ENV_VAR: string = 'FlutterToolPath'; | ||
const FLUTTER_PUBCACHE_PATH_ENV_VAR: string = 'FlutterPubCachePath'; | ||
const DART_TOOL_PATH_ENV_VAR: string = 'DartToolPath'; | ||
|
||
async function main(): Promise<void> { | ||
// 1. Get where to get the path from | ||
let pathType = task.getInput('pathType', true); | ||
|
||
// 1.1 Getting path | ||
var flutterDir = task.getInput(pathType, true); | ||
|
||
// 2. Creating flutter environment variable | ||
let fullFlutterPath: string = path.join(flutterDir, FLUTTER_EXE_RELATIVEPATH); | ||
task.debug(`Set ${FLUTTER_TOOL_PATH_ENV_VAR} with '${fullFlutterPath}'`); | ||
task.setVariable(FLUTTER_TOOL_PATH_ENV_VAR, fullFlutterPath); | ||
|
||
// 2.1 Create flutter pub-cache environment variable | ||
let fullPubCachePath: string = path.join(flutterDir, FLUTTER_PUB_CACHE_RELATIVEPATH); | ||
task.debug(`Set ${DART_TOOL_PATH_ENV_VAR} with '${fullPubCachePath}'`); | ||
task.setVariable(FLUTTER_PUBCACHE_PATH_ENV_VAR, fullPubCachePath); | ||
|
||
// 2.2 Create dart environment variable | ||
let fullDartPath: string = path.join(fullFlutterPath, DART_EXE_RELATIVEPATH); | ||
task.debug(`Set ${DART_TOOL_PATH_ENV_VAR} with '${fullDartPath}'`); | ||
task.setVariable(DART_TOOL_PATH_ENV_VAR, fullDartPath); | ||
|
||
task.setResult(task.TaskResult.Succeeded, "Environment Variables Set"); | ||
} | ||
|
||
main().catch(error => { | ||
task.setResult(task.TaskResult.Failed, error); | ||
}); |
Oops, something went wrong.