Eclipse 2020-09 (4.17.0) on OS X 10.13 keeps wanting me to put .gitignore and .DS_store on the path - eclipse

I just upgraded to Eclipse 2020-09 (4.17.0) on OS X 10.13.
I have a large existing repository of java projects and I've installed the javascript and GWT plugins for Eclipse.
The problem is this: whenever I do almost anything (ex. save a file I'm working on), I get an error:
An error has occurred. See error log for more details. Path must include project and resource name: /.gitignore
specifically, the error comes from jface:
Problems occurred when invoking code from plug-in: "org.eclipse.jface".
the top of the error code is:
java.lang.IllegalArgumentException: Path must include project and resource name: /.gitignore
at org.eclipse.core.runtime.Assert.isLegal(Assert.java:66)
at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:2128)
at org.eclipse.core.internal.resources.Container.getFile(Container.java:196)
at org.eclipse.egit.ui.internal.staging.StagingViewContentProvider.getFile(StagingViewContentProvider.java:139)
at org.eclipse.egit.ui.internal.staging.StagingEntry.getFile(StagingEntry.java:213)
at org.eclipse.egit.ui.internal.staging.StagingEntry.getProblemSeverity(StagingEntry.java:244)
at org.eclipse.egit.ui.internal.decorators.ProblemLabelDecorator.decorateImage(ProblemLabelDecorator.java:84)
at org.eclipse.jface.viewers.DecoratingLabelProvider.getImage(DecoratingLabelProvider.java:101)
But, there's a .gitignore in both the repo root and the project root and the project path settings are:
PARENT_LOC /Users/brian/git/JavaCodeFromSVN
PROJECT_LOC /Users/brian/git/JavaCodeFromSVN/jsAipotu
WORKSPACE_LOC /Users/brian/git/JavaCodeFromSVN
So I can't figure out what the problem is or how to fix it.
I can work in eclipse but it's really annoying to get these messages all the time.
I'm sure it's something obvious but I'm just not seeing it.
Might anyone be able to help? It seems that every time I upgrade Eclipse, it's a headache of one kind or another. Perhaps, someday, I'll learn my lesson and not upgrade :(
thanks
Brian

I think I may have fixed the problem. Here's what I did that made this go away.
Right-click the project: Team -> advanced -> Clean... and let it clean all it found (lots of .gitignores etc)
At that point, I was getting warnings about .DS_Store pretty consistently.
I followed the directions at https://intellipaat.com/community/9089/how-can-i-remove-dsstore-files-from-a-git-repository-gitignore-dsstore (By Debashis Borgohain)
they are:
Remove existing .DS_Store files from the repo. In the top level repo directory:
find . -name .DS_Store -print0 | xargs -0 git rm -f --ignore-unmatch
Create or update the .gitignore file at the top of the repo to contain a listing for .DS_Store. WHen set like this, even if Mac OS re-creates the .DS_Store files, they will be ignored by git when you commit changes, etc. Here is one way:
echo .DS_Store >> .gitignore
Commit the revised .gitignore
git add .gitignore
git commit -m '.DS_Store banished!'
to get rid of all the .DS_Store files, tell git to ignore them, and now it seems happy.

I got this error because I have a Maven project with sub-projects, and I made my Maven (base) project folder equal to the workspace folder:
πŸ“ eclipse-workspace = maven base project folder = root of Git repo
+-- πŸ“ subproject_1
| +-- πŸ“ pom.xml (of subproject)
+-- πŸ“ subproject_2
| +-- πŸ“ pom.xml (of subproject)
+-- πŸ“ pom.xml (of base project)
The first error was, that the base project could not be imported as a project. I thought this was meaningless, since the base project doesn’t contain code in my case, it is only a container. However, it seems Eclipse requires the base project to be a folder in the workspace:
πŸ“ eclipse-workspace
+-- πŸ“ project (base project) = root of Git repo
+-- πŸ“ subproject_1
| +-- πŸ“ pom.xml (of subproject)
+-- πŸ“ subproject_2
| +-- πŸ“ pom.xml (of subproject)
+-- πŸ“ pom.xml (of base project)

Related

How to specify the main class (in the root directory) for Mill to run?

I am new to the sbt and mill, and I am practicing to use both tool to build the chisel (scala project). View this github repo as a reference, I am wondering to know how to write the mill-version build.sh in that repo.
Here is my directory structure
─ chisel-template (root directory / projects directory)
β”œβ”€β”€ build.sc
β”œβ”€β”€ build.sh
β”œβ”€β”€ src
| └─main
| └─scala
| └─lab1
| └─Mux2.scala
└── _temphelper.scala
What the build.sh do is preparing a boilerplate as main function in the root directory to make compile and run process much easier, and it's sbt version. I'm curious that why sbt can detect the main function (_temphelper.Elaborate) even it's not in the src/main directory. And when I change to use Mill, Mill can't detect the _temphelper.scala at all, unless I move the file to root/src/main. Is there settings that can make Mill do what sbt can do?
I'm not sure whether this issue is related to...
altering the sourceDirectories in sbt and chiselMoudule.sources in Mill. Any advice is welcome.
modify the millSourcePath to realize my request.
My quetions is What setting should I do to make mill can detect the main class that be in the root directory?
This is because sbt is including any Scala files it finds in the project root directory as sources files, unless told otherwise.
In contrast, Mill will only use the source files found under whatever directories are specified with sources. As a consequence, you may want to add the project root directory as source directory, but I strongly advice to do not so.
Best is to move the _temphelper.scala file either to one of the source directories or create a new dedicated directory, move the file there and add this directory to the sources like this:
object chiselModule extends CrossSbtModule // ...
{
def sources = T.sources {
super.sources() ++ Seq(PathRef(T.workspace / "your" / "new" / "directory"))
}
}

How to use babel-cli directory paths?

EDIT: Answered, below.
Also: If you are reading this you are probably new to web dev and you should consider using webpack for this instead of babel alone
I have what seems like a very simple problem but I can't solve it.
I have a directory structure
Project
|
+-- scripts
|
|
+-- src / src.js
|
|
+-- compiled / compiled.js
And I have been trying to get the following command to work when my terminal is located in the scripts folder.
C:\Users\me\JavaScriptProjects\survey\scripts>npx babel ./src/src.js --out-file ./compiled/compiled.js presets=env,react --watch
But it simply keeps returning:
C:\Users\me\JavaScriptProjects\survey\scripts>npx babel ./src/src.js --out-file ./compiled/compiled.js presets=env,react --watch
presets=env,react doesn't exist
I have tried permutations of removing the ./, replacing it with only /, going into src dir and replacing src/src.js with src.js and then doing ../compiled/compiled.js and many other permutations, but it just keeps saying it doesn't exist.
Even if I add both files to the same directory it's giving the same error.
Most annoying part is it was working fine yesterday.
Thanks in advance.
Solved.
The following has worked from within the src dir after trying for around an hour. I don't know what I've done differently, would love it if someone can point it out.
Thanks.
C:\Users\me\JavaScriptProjects\survey\scripts\src>npx babel src.js --out-file=../compiled/compiled.js --presets=env,react --watch
It could be that you have a babel.config.json file in the \scripts\src folder and that if you move to the \scripts folder to run npx, then it can't see the config file and so doesn't see react.
Project
|
+-- scripts
|
+-- src / src.js
+-- src / babel.config.json
|
+-- compiled / compiled.js

Eclipse Projectdependency on multiple src directories

today I have a special problem which already took me a while at the debugger.
I have two projects Project A and Project B.
Project A has multiple src-directories.
src
β”œβ”€β”€β”€main
β”‚ └───java
└───generated
└───java
both are recognized by eclipse as actual src directories. Both will be compiled to bin which looks like this:
bin
β”œβ”€β”€β”€main
└───generated
Project B has a Project-dependencie on Project A.
And now comes the strange part: When I look for a class from Project A/src/main/java via Class.forName() inside Project B it will be found. When i look for a class from Project A/src/generated/java I get a ClassNotFound exception.
I would be very glad if you could point out a way to tell eclipse to create a dependencie on both src-directories.
btw, just in case it is important: I am using java 9.
and here is an excerpt of .classpath from Project B
<classpathentry kind="src" path="/Project A"/>
Thanks for your help.
This looks like a bug of Eclipse, Gradle or a combination of both. Try to delete the run configuration and restart the application. Make also sure the gradle.build file is in sync with the Eclipse project. If all this doesn't help, you can use a single output folder as workaround:
Manually in Project > Properties: Java Build Path, in the tab Source:
Uncheck the checkbox Allow output folders for source folders
In the field Default output folder enter bin/main
or via following gradle.build snippet:
apply plugin: 'eclipse'
eclipse.classpath.file.whenMerged {
entries.find { it.path == 'src/main/java' }.output = 'bin/main'
entries.find { it.path == 'src/generated/java' }.output = 'bin/main'
}

What source code files should be included in version control for Ionic2 application?

Im building an Ionic 2 application. Version control will be made through SVN.
When creating the app using ionic CLI many files are generated. Same happens when adding platforms.
Is there any standard approach defining which files to include in Version Controls and which ones to ingnore. (I.E. i think platforms folder should be ignored).
You can always take a look at the conference app to see how Ionic team recommends to do things. In this case the .gitignore file looks like this:
# Specifies intentionally untracked files to ignore when using Git
# http://git-scm.com/docs/gitignore
*~
*.sw[mnpcod]
*.log
*.tmp
*.tmp.*
log.txt
*.sublime-project
*.sublime-workspace
.vscode/
npm-debug.log*
.idea/
.sass-cache/
.tmp/
.versions/
coverage/
dist/
node_modules/
tmp/
temp/
hooks/
platforms/
plugins/
plugins/android.json
plugins/ios.json
$RECYCLE.BIN/
.DS_Store
Thumbs.db
UserInterfaceState.xcuserstate
Like you can see there, the platform and the plugins folders are being ignored for example
Common Ignores
.vscode/
.DS_Store
ionic
node_modules/
plugins/
Platform iOS
*.mode1v3
*.perspectivev3
*.pbxuser
platforms/ios/build
Platform Android
platforms/android/build.xml
platforms/android/local.properties
platforms/android/gradlew
platforms/android/gradlew.bat
platforms/android/gradle
Ant builds
platforms/android/ant-build
platforms/android/ant-gen
Eclipse builds
platforms/android/gen
platforms/android/out
Gradle builds
platforms/android/build
Check - https://github.com/ionic-team/ionic/blob/master/.gitignore

Eclipse: Relocating a git repo from project to workspace

I've been working on an Eclipse plug-in project for a while now, and I've run into a situation where I need to split the project up to seperate the test cases from the plug-in package. I'm using git as version control.
To describe this simply, I'm versioning the old project like this:
workspace/
|
+-- myplugin/
|
+-- .git/ <-- Here be the git repository
|
+-- /* Source code, project stuff, etc. */
…and I'm in the situation where I need to work the plugin tests in a seperate project (so that jUnit won't be needed as a required bundle with the plugin). And I'd like the repository to version everything in the workspace. Like this:
workspace/
|
+-- .git/ <-- The repository should be relocated here instead…
|
+-- myplugin/
| |
| +-- /* Source code, project stuff, etc. */
|
+-- myplugin-test/
|
+-- /* Unit tests and stuff… */
Is there a simple way to do this without losing the history of the old project?
Here's the workflow in pseudocode:
cd workspace/myplugin
mkdir myplugin
git mv * myplugin # you might need to do that for all files/folders manualy
mkdir myplugin-test
# move/add files to myplugin-test
git commit -a -m "Reorganization"
cd workspace
mv myplugin myplugin_old
mv myplugin_old/* .
# you should end up with requested structure