-
Notifications
You must be signed in to change notification settings - Fork 18
Feature/createproject #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
maybeec
merged 61 commits into
devonfw-tutorials:main
from
denise-khuu:feature/createproject
Dec 9, 2020
Merged
Changes from all commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
4c794fc
"tutorial repo"
denise-khuu 26eb021
tutorial repo
denise-khuu c154ca3
Update Playbook
denise-khuu 8516461
Playbook repo
denise-khuu a907100
Feature add Project and Playbook repo
denise-khuu 2d992e9
createProject
denise-khuu 664b7a7
createProject() and cd-Template
denise-khuu 081df1e
createProject() and cd-Template
denise-khuu 67274b2
createProject() and cd-Template
denise-khuu d7b3090
Playbook
denise-khuu 90b2c3f
playbook
denise-khuu c2d6a08
createProject added Comments
denise-khuu 709f4b1
createProject and currentDir added
denise-khuu dcd83e1
createProject and currentDir
denise-khuu 2921d99
index.asciidoc createProject added
denise-khuu efe47a5
Merge branch 'main' of https://github.com/devonfw-forge/tutorial-comp…
denise-khuu df3ed0b
merging problems solved
denise-khuu eb6317d
merging problems solved
denise-khuu 322b704
merging problems solved
denise-khuu eaba1a1
git modules deleted and added functions console/index.ts
denise-khuu 6cd7590
git modules deleted and added functions console/index.ts
denise-khuu 8c981c1
git modules deleted and added functions console/index.ts
denise-khuu 4ae350e
currentDir changed with path.join
denise-khuu 1e6534c
currentDir changed with path.join
denise-khuu e69f8a6
currentDir changed with path.join
denise-khuu f3c07eb
added name and language variables
denise-khuu ceb5f79
added name and language variables
denise-khuu dde0695
project name and language are added
denise-khuu 0c7cae6
cd.md changed the instructions
denise-khuu 3fcff73
cd.md changed the instructions
denise-khuu e61b2d9
added parameters to runcreateProject
denise-khuu 9175012
added name tag to createProject
denise-khuu 0a233a3
Merge branch 'main' of https://github.com/devonfw-forge/tutorial-comp…
denise-khuu 92536d5
update
denise-khuu a5ef5a3
changeCurrentDir is splitted to a function generating a template and …
denise-khuu f63da61
Merge pull request #5 from denise-khuu/main
denise-khuu 7f3a1dc
Merge pull request #6 from denise-khuu/feature/changecurrentdir
denise-khuu b6aba5a
deleted relPath
denise-khuu cab266a
changed newPath to dirPaths
denise-khuu 8f97bdc
dirUtils replace concat with path.join
denise-khuu 95a0b26
replace dummy path
denise-khuu f9ea402
Template will only be generated, if targetDir and currentDir have dif…
denise-khuu e94c16a
function changed to createDevon4jProject
denise-khuu 23b9ef9
function changed to createDevon4jProject
denise-khuu 4e07be2
WIP: feature/buildJava
denise-khuu b96aa95
npm dependency of jasmine changed
denise-khuu 2d505c9
npm test in buildRun.sh
denise-khuu 14ab8e8
npm test in buildRun.sh
denise-khuu c07d6a6
npm test in buildRun.sh
denise-khuu 993a283
jasmine without @types
denise-khuu db775ec
jasmine without @types
denise-khuu d0740ae
jasmine without @types
denise-khuu eac509b
jasmine without @types and dirUtilsSpec changed
denise-khuu 37a8c85
jasmine in dependencies not devd
denise-khuu 11f22d5
Merge pull request #8 from denise-khuu/main
denise-khuu 10a8d44
@types/jasmine is added to package.json and path param
denise-khuu 698af05
documentation
denise-khuu db6742e
Exit code and slash instead of backslash
denise-khuu 92e585c
changed back to createproject with one param and cd commands in template
denise-khuu ae466ec
Function.md changed back
denise-khuu 1551bde
Merge branch 'main' into feature/createproject
denise-khuu File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,3 @@ | ||
| tsc | ||
| npm test | ||
| if(-not $?){ throw 'tests failed' } |
This file contains hidden or 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,6 @@ | ||
| tsc | ||
| npm test | ||
| if [ $? -eq 1 ]; then | ||
| echo 'tests failed' | ||
| exit 1 | ||
| fi |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or 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 hidden or 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 hidden or 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,51 @@ | ||
| import * as path from 'path'; | ||
|
|
||
| export class DirUtils{ | ||
|
|
||
| getCdParam(currentDir:string, targetDir:string):string{ | ||
|
|
||
| //returns an empty string, if both variables have the same path | ||
| if(currentDir == targetDir){ | ||
| return ""; | ||
| } | ||
|
|
||
| let dirPath = ""; | ||
|
|
||
| let currentPaths = currentDir.split(path.sep); | ||
| let targetPaths = targetDir.split(path.sep); | ||
|
|
||
| let index; | ||
| let isEqual = true; | ||
|
|
||
| //saves the remaining path, if currentdir is the prefix of targetDir | ||
| if(targetDir.substring(0,currentDir.length) == currentDir){ | ||
| return path.join(targetDir.replace(currentDir + path.sep, '')).replace("\\", "/"); | ||
| } | ||
|
|
||
|
|
||
| else{ | ||
| //returns the absolut directory, if the first parent folder is different | ||
| if(currentPaths[1] != targetPaths[1]){ | ||
| return targetDir.replace("\\", "/"); | ||
| } | ||
|
|
||
| //iterates throught currentPath array to compare parent directories | ||
| currentPaths.forEach((currentPath, i) => { | ||
| if(currentPath == targetPaths[i] && isEqual == true){ | ||
| index = i; | ||
| }else{ | ||
| isEqual = false; | ||
| dirPath = path.join(dirPath,'..'); | ||
| } | ||
| }) | ||
|
|
||
| //slice targetPaths to get the relative path | ||
| targetPaths = targetPaths.slice(index + 1, targetPaths.length); | ||
|
|
||
| return path.join(dirPath, targetPaths.join(path.sep)).replace("\\", "/"); | ||
|
|
||
| } | ||
|
|
||
| } | ||
|
|
||
| } |
This file contains hidden or 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 hidden or 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,4 @@ | ||
|
|
||
| Please change the folder to <%= dir; %> | ||
|
|
||
| `cd <%= dir; %>`{{execute}} |
This file contains hidden or 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,13 @@ | ||
| <%= text; %> | ||
|
|
||
| ## Setting up your java project | ||
|
|
||
| <%= cdCommand; %> | ||
|
|
||
| Navigate to the 'workspaces/main/' folder in your devonfw installation directory. | ||
| `cd workspaces/main`{{execute}} | ||
|
|
||
| Now you can use devonfw to setup a java project for you by executing the following devon command. | ||
| `devon java create com.example.application.<%= name; %>`{{execute}} | ||
|
|
||
| <%= textAfter; %> |
This file contains hidden or 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 hidden or 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,25 @@ | ||
| import 'jasmine'; | ||
| import * as path from 'path'; | ||
| import { DirUtils } from '../../../runners/katacoda/dirUtils'; | ||
|
|
||
| describe("DirUtils", () => { | ||
| let target = new DirUtils(); | ||
| describe("changeCurrentDir", () => { | ||
| it("is already in the right folder", () => { | ||
| expect(target.getCdParam(path.join('/root'), path.join('/root'))).toBe(''); | ||
| }); | ||
| it("changes directly to the child folder, because currentDir is the prefix of dir", () => { | ||
| expect(target.getCdParam(path.join('/root/devonfw'), path.join('/root/devonfw/setup'))).toBe(path.join('setup').replace("\\", "/")); | ||
| }); | ||
| it("returns an absolute path, because both dirs don't have matching parent folders", () => { | ||
| expect(target.getCdParam(path.join('/setup'), path.join('/root/devonfw/setup'))).toBe(path.join('/root/devonfw/setup').replace("\\", "/")); | ||
| }); | ||
| it("changes to parent folder before changing to child folder", () => { | ||
| expect(target.getCdParam(path.join('/root/devonfw'), path.join('/root/setup/folder0/folder1'))).toBe(path.join('../setup/folder0/folder1').replace("\\", "/")); | ||
| }); | ||
| it("changes to parent folder before changing to child folder and one child folder has the same position and name", () => { | ||
| expect(target.getCdParam(path.join('/root/devonfw/folder/setup'), path.join('/root/devonfw/setup/setup'))).toBe(path.join('../../setup/setup').replace("\\", "/")); | ||
| }); | ||
|
|
||
| }); | ||
| }); |
This file contains hidden or 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,11 @@ | ||
| { | ||
| "spec_dir": "build/spec", | ||
| "spec_files": [ | ||
| "**/*[sS]pec.js" | ||
| ], | ||
| "helpers": [ | ||
| "helpers/**/*.js" | ||
| ], | ||
| "stopSpecOnExpectationFailure": false, | ||
| "random": true | ||
| } |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.