@nx-dotnet/core
Advanced tools
Comparing version 0.2.0-dev.7 to 0.2.0-dev.8
@@ -0,1 +1,8 @@ | ||
# [0.2.0-dev.8](https://github.com/nx-dotnet/nx-dotnet/compare/v0.2.0-dev.7...v0.2.0-dev.8) (2021-04-27) | ||
### Bug Fixes | ||
* **core:** use full project path in output directory ([d9e5988](https://github.com/nx-dotnet/nx-dotnet/commit/d9e5988e5fbc0cfac15c3b5808bcce27835cfeb3)), closes [#27](https://github.com/nx-dotnet/nx-dotnet/issues/27) | ||
# [0.2.0-dev.7](https://github.com/nx-dotnet/nx-dotnet/compare/v0.2.0-dev.6...v0.2.0-dev.7) (2021-04-26) | ||
@@ -2,0 +9,0 @@ |
@@ -8,4 +8,4 @@ { | ||
"dependencies": { | ||
"@nx-dotnet/dotnet": "0.2.0-dev.7", | ||
"@nx-dotnet/utils": "0.2.0-dev.7", | ||
"@nx-dotnet/dotnet": "0.2.0-dev.8", | ||
"@nx-dotnet/utils": "0.2.0-dev.8", | ||
"glob": "^7.1.6", | ||
@@ -17,5 +17,5 @@ "rimraf": "^3.0.2", | ||
"license": "MIT", | ||
"version": "0.2.0-dev.7", | ||
"version": "0.2.0-dev.8", | ||
"typings": "./src/index.d.ts", | ||
"peerDependencies": {} | ||
} |
@@ -48,3 +48,3 @@ "use strict"; | ||
targets: { | ||
build: models_1.GetBuildExecutorConfiguration(testName), | ||
build: models_1.GetBuildExecutorConfiguration(testRoot), | ||
test: models_1.GetTestExecutorConfig(), | ||
@@ -76,5 +76,5 @@ }, | ||
const testCsProj = yield utils_1.findProjectFileInPath(testRoot); | ||
SetOutputPath(host, testProjectName, testCsProj); | ||
SetOutputPath(host, testRoot, testCsProj); | ||
const baseCsProj = yield utils_1.findProjectFileInPath(schema.projectRoot); | ||
SetOutputPath(host, schema.projectName, baseCsProj); | ||
SetOutputPath(host, schema.projectRoot, baseCsProj); | ||
dotnetClient.addProjectReference(testCsProj, baseCsProj); | ||
@@ -84,6 +84,6 @@ } | ||
} | ||
function SetOutputPath(host, projectName, projectFilePath) { | ||
function SetOutputPath(host, projectRootPath, projectFilePath) { | ||
var _a; | ||
const xml = new xmldoc_1.XmlDocument(fs_1.readFileSync(projectFilePath).toString()); | ||
let outputPath = `${path_1.relative(path_1.dirname(projectFilePath), process.cwd())}/dist/${projectName}`; | ||
let outputPath = `${path_1.relative(path_1.dirname(projectFilePath), process.cwd())}/dist/${projectRootPath}`; | ||
outputPath = outputPath.replace('\\', '/'); // Forward slash works on windows, backslash does not work on mac/linux | ||
@@ -120,3 +120,3 @@ const textNode = { | ||
targets: { | ||
build: models_1.GetBuildExecutorConfiguration(normalizedOptions.name), | ||
build: models_1.GetBuildExecutorConfiguration(normalizedOptions.projectRoot), | ||
serve: models_1.GetServeExecutorConfig(), | ||
@@ -154,3 +154,3 @@ }, | ||
else if (!options.skipOutputPathManipulation) { | ||
SetOutputPath(host, normalizedOptions.projectName, yield utils_1.findProjectFileInPath(normalizedOptions.projectRoot)); | ||
SetOutputPath(host, normalizedOptions.projectRoot, yield utils_1.findProjectFileInPath(normalizedOptions.projectRoot)); | ||
} | ||
@@ -157,0 +157,0 @@ yield devkit_1.formatFiles(host); |
@@ -57,6 +57,18 @@ import { readProjectConfiguration, Tree } from '@nrwl/devkit'; | ||
it('should set output paths in build target', async () => { | ||
await GenerateProject(appTree, options, dotnetClient, 'application'); | ||
const config = readProjectConfiguration(appTree, 'test'); | ||
const outputPath = config.targets.build.options.output; | ||
expect(outputPath).toBeTruthy(); | ||
const absoluteDistPath = resolve(appTree.root, outputPath); | ||
const expectedDistPath = resolve(appTree.root, './dist/apps/test'); | ||
expect(absoluteDistPath).toEqual(expectedDistPath); | ||
}); | ||
/** | ||
* This test requires a live dotnet client. | ||
*/ | ||
it('should update output paths', async () => { | ||
it('should update output paths in project file', async () => { | ||
await GenerateProject( | ||
@@ -83,3 +95,3 @@ appTree, | ||
const absoluteDistPath = resolve(config.root, outputPath); | ||
const expectedDistPath = resolve('./dist/test'); | ||
const expectedDistPath = resolve('./dist/libs/test'); | ||
@@ -86,0 +98,0 @@ expect(absoluteDistPath).toEqual(expectedDistPath); |
@@ -5,3 +5,3 @@ import { TargetConfiguration } from '@nrwl/devkit'; | ||
*/ | ||
export declare function GetBuildExecutorConfiguration(projectName: string): BuildExecutorConfiguration; | ||
export declare function GetBuildExecutorConfiguration(projectRoot: string): BuildExecutorConfiguration; | ||
/** | ||
@@ -8,0 +8,0 @@ * Configuration options relevant for the build executor |
@@ -7,7 +7,7 @@ "use strict"; | ||
*/ | ||
function GetBuildExecutorConfiguration(projectName) { | ||
const outputDirectory = `dist/${projectName}`; | ||
function GetBuildExecutorConfiguration(projectRoot) { | ||
const outputDirectory = `dist/${projectRoot}`; | ||
return { | ||
executor: '@nx-dotnet/core:build', | ||
outputs: [outputDirectory], | ||
outputs: ['{options.output}'], | ||
options: { | ||
@@ -14,0 +14,0 @@ output: outputDirectory, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
68944
1199
+ Added@nx-dotnet/dotnet@0.2.0-dev.8(transitive)
+ Added@nx-dotnet/utils@0.2.0-dev.8(transitive)
- Removed@nx-dotnet/dotnet@0.2.0-dev.7(transitive)
- Removed@nx-dotnet/utils@0.2.0-dev.7(transitive)
Updated@nx-dotnet/utils@0.2.0-dev.8