Skip to content
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

Rework build on import #374

Merged
merged 7 commits into from
Mar 26, 2020
Merged

Rework build on import #374

merged 7 commits into from
Mar 26, 2020

Conversation

maihacke
Copy link
Member

Proposal to fix #372

Users have to provide params for the build command (e.g. dependency:go-offline to just download libs). Without params build is skipped.

@maihacke
Copy link
Member Author

@hohwille there are changes in the ide script I did not intend 3.3.0 vs variable. Is there any magic about this aspect in place I do not know?

then
cd "${project_path}/${project_build_path}" || exit 255
doDevonCommand build
doDevonCommand build ${project_build_params}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But that's just passing parameters.
As of our last discussion, I even thought of running doDevonCommand ${project_post_build_command} and let the user specify what to do. So a user could even decide to do something like py doSomeGreatSetup.

Even the question is here whether we should also support anything like also git bash standard commands, such that I could process something like an sed command or anything like this.

Copy link
Member Author

@maihacke maihacke Mar 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about security problems this might introduce, if users provide something like rm -rf / as build command.
We have to check which level of security we want here and what doDevonCommand provides.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. My view on that is simple:
With great power comes great responsibility. I don't think that we have to discuss about attackers but just about faulty configurations. But in my opinion it's quite obvious that you should not put here any cd / && rm -Rf :)
But for me it would be even ok if we simply skip execution possibilities of any non devonfw command.

Copy link
Member Author

@maihacke maihacke Mar 25, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then you would propose?
doDevonCommand ${project_build_cmd}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

et voilà!


doDebug "Project (Path: ${project_path}, Url: ${project_git_url}, Branch: ${project_git_branch}, Eclipse: ${project_eclipse}, Workspace: ${project_workspace}, Workingsets: ${project_workingsets})"
doDebug "Pull or clone git project ${project_path}..."
project_workspace_path="${DEVON_IDE_HOME}/workspaces/${project_workspace}"
mkdir -p "${project_workspace_path}"
cd "${project_workspace_path}" || exit 255
doGitPullOrClone "${project_path}" "${project_git_url}" "${project_git_branch}"
if [ -n "${project_build_path}" ]
doDebug "Building project with params: ${project_build_params}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

old reference in debug log

@maihacke maihacke merged commit 45a745a into devonfw:master Mar 26, 2020
@maihacke maihacke deleted the rework-build-on-import branch March 26, 2020 06:56
@hohwille hohwille added this to the release:2020.04.001 milestone Mar 26, 2020
@hohwille hohwille added enhancement New feature or request projects Auto cloning and import of projects. setup related to the setup process of devonfw-ide (setup[.bat] and devon ... setup) labels Mar 26, 2020
@hohwille
Copy link
Member

@maihacke
What to do about the default settings? Is the import with m2e working for a fresh IDE installation with devon4j and mts? I expect it to fail so we would still need a change in ide-settings to add the build.command, right?

@maihacke
Copy link
Member Author

@maihacke
What to do about the default settings? Is the import with m2e working for a fresh IDE installation with devon4j and mts? I expect it to fail so we would still need a change in ide-settings to add the build.command, right?

Yes that's true. I checked a fresh install, without "pre-loading" libgs via mvn, m2e fails to download the deps...

@maihacke
Copy link
Member Author

maihacke commented Mar 27, 2020

I created a PR with the necessary changes to ide-settings

maihacke added a commit to maihacke/ide-settings that referenced this pull request Mar 27, 2020
maybeec pushed a commit to devonfw/ide-settings that referenced this pull request May 25, 2020
hohwille pushed a commit to m-m-m/settings that referenced this pull request Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request projects Auto cloning and import of projects. setup related to the setup process of devonfw-ide (setup[.bat] and devon ... setup)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not setup devonfw projects by default
3 participants