├── .github ├── bef-create-update-site.sh ├── dependabot.yml ├── pages │ └── index.html └── workflows │ ├── cd.yml │ ├── ci.yml │ ├── link-checker.yml │ └── test-results.yml ├── .gitignore ├── .mvn ├── extensions.xml ├── maven.config └── wrapper │ └── maven-wrapper.properties ├── .project ├── .settings ├── org.eclipse.core.resources.prefs └── org.eclipse.core.runtime.prefs ├── .vscode ├── extensions.json ├── launch.json ├── settings.json └── tasks.json ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE-EPL-2.0.txt ├── LICENSE.txt ├── NOTICE ├── README.md ├── SECURITY.md ├── bundles ├── com.salesforce.bazel.eclipse.core │ ├── .classpath │ ├── .options │ ├── .project │ ├── .settings │ │ ├── org.eclipse.core.resources.prefs │ │ ├── org.eclipse.core.runtime.prefs │ │ ├── org.eclipse.jdt.core.prefs │ │ ├── org.eclipse.jdt.ui.prefs │ │ └── org.eclipse.pde.core.prefs │ ├── META-INF │ │ └── MANIFEST.MF │ ├── README.md │ ├── build.properties │ ├── logback.xml │ ├── plugin.xml │ ├── schema │ │ ├── com.salesforce.bazel.eclipse.core.executor.exsd │ │ ├── com.salesforce.bazel.eclipse.core.model.sync.participant.exsd │ │ └── com.salesforce.bazel.eclipse.core.model.target.discovery.exsd │ └── src │ │ └── com │ │ └── salesforce │ │ └── bazel │ │ └── eclipse │ │ ├── core │ │ ├── BazelCore.java │ │ ├── BazelCorePlugin.java │ │ ├── BazelCoreSharedContstants.java │ │ ├── builder │ │ │ └── BazelProjectBuilder.java │ │ ├── classpath │ │ │ ├── BazelClasspathContainer.java │ │ │ ├── BazelClasspathContainerInitializer.java │ │ │ ├── BazelClasspathContainerRuntimeResolver.java │ │ │ ├── BazelClasspathContainerSaveHelper.java │ │ │ ├── BazelClasspathHelpers.java │ │ │ ├── BazelClasspathManager.java │ │ │ ├── BazelClasspathScope.java │ │ │ ├── BazelSourceContainerResolver.java │ │ │ ├── CompileAndRuntimeClasspath.java │ │ │ └── InitializeOrRefreshClasspathJob.java │ │ ├── edits │ │ │ └── AddDependenciesJob.java │ │ ├── events │ │ │ ├── BazelCoreEventConstants.java │ │ │ └── SyncFinishedEvent.java │ │ ├── extensions │ │ │ ├── DetectBazelVersionAndSetBinaryJob.java │ │ │ ├── EclipseExtensionRegistryLookup.java │ │ │ ├── EclipseHeadlessBazelCommandExecutor.java │ │ │ ├── ExtensibleCommandExecutor.java │ │ │ └── PriorityAttributeComparator.java │ │ ├── launchconfiguration │ │ │ ├── BazelLaunchConfigurationConstants.java │ │ │ └── BazelRunLaunchConfigurationDelegate.java │ │ ├── model │ │ │ ├── BazelBuildFile.java │ │ │ ├── BazelBuildFileInfo.java │ │ │ ├── BazelElement.java │ │ │ ├── BazelElementCommandExecutor.java │ │ │ ├── BazelElementInfo.java │ │ │ ├── BazelElementOpenJob.java │ │ │ ├── BazelFile.java │ │ │ ├── BazelFileInfo.java │ │ │ ├── BazelModel.java │ │ │ ├── BazelModelInfo.java │ │ │ ├── BazelModelManager.java │ │ │ ├── BazelModuleFile.java │ │ │ ├── BazelModuleFileInfo.java │ │ │ ├── BazelPackage.java │ │ │ ├── BazelPackageInfo.java │ │ │ ├── BazelProject.java │ │ │ ├── BazelProjectFileSystemMapper.java │ │ │ ├── BazelRuleAttributes.java │ │ │ ├── BazelStarlarkFileReader.java │ │ │ ├── BazelTarget.java │ │ │ ├── BazelTargetInfo.java │ │ │ ├── BazelVisibility.java │ │ │ ├── BazelWorkspace.java │ │ │ ├── BazelWorkspaceBlazeInfo.java │ │ │ ├── BazelWorkspaceInfo.java │ │ │ ├── ResourceChangeProcessor.java │ │ │ ├── SynchronizationParticipant.java │ │ │ ├── SynchronizationParticipantExtensionLookup.java │ │ │ ├── SynchronizeProjectViewJob.java │ │ │ ├── buildfile │ │ │ │ ├── FunctionCall.java │ │ │ │ └── GlobInfo.java │ │ │ ├── cache │ │ │ │ ├── BazelElementInfoCache.java │ │ │ │ └── CaffeineBasedBazelElementInfoCache.java │ │ │ ├── discovery │ │ │ │ ├── BaseProvisioningStrategy.java │ │ │ │ ├── BazelBuildfileTargetDiscovery.java │ │ │ │ ├── BazelQueryTargetDiscovery.java │ │ │ │ ├── BuildFileAndVisibilityDrivenProvisioningStrategy.java │ │ │ │ ├── BuildfileDrivenProvisioningStrategy.java │ │ │ │ ├── EclipsePreferencesHelper.java │ │ │ │ ├── JavaAspectsClasspathInfo.java │ │ │ │ ├── JavaAspectsInfo.java │ │ │ │ ├── JavaClasspathJarLocationResolver.java │ │ │ │ ├── JvmConfigurator.java │ │ │ │ ├── MacroCallAnalyzer.java │ │ │ │ ├── ProjectPerPackageProvisioningStrategy.java │ │ │ │ ├── ProjectPerTargetProvisioningStrategy.java │ │ │ │ ├── TargetDiscoveryAndProvisioningExtensionLookup.java │ │ │ │ ├── TargetDiscoveryStrategy.java │ │ │ │ ├── TargetProvisioningStrategy.java │ │ │ │ ├── WorkspaceClasspathStrategy.java │ │ │ │ ├── analyzers │ │ │ │ │ ├── JavaBinaryAnalyzer.java │ │ │ │ │ ├── JavaJunit5TestAnalyzer.java │ │ │ │ │ ├── JavaLibraryAnalyzer.java │ │ │ │ │ ├── JavaTestAnalyzer.java │ │ │ │ │ ├── JavaTestSuiteAnalyzer.java │ │ │ │ │ └── starlark │ │ │ │ │ │ ├── StarlarkAnalyzeInfo.java │ │ │ │ │ │ ├── StarlarkFunctionCallInfo.java │ │ │ │ │ │ ├── StarlarkGlobInfo.java │ │ │ │ │ │ ├── StarlarkMacroCallAnalyzer.java │ │ │ │ │ │ └── StarlarkNativeModuleApiDummy.java │ │ │ │ ├── classpath │ │ │ │ │ ├── AccessRule.java │ │ │ │ │ ├── ClasspathEntry.java │ │ │ │ │ ├── libs │ │ │ │ │ │ ├── ExternalLibrariesDiscovery.java │ │ │ │ │ │ ├── GeneratedLibrariesDiscovery.java │ │ │ │ │ │ └── LibrariesDiscoveryUtil.java │ │ │ │ │ └── util │ │ │ │ │ │ └── TypeLocator.java │ │ │ │ └── projects │ │ │ │ │ ├── Entry.java │ │ │ │ │ ├── EntrySettings.java │ │ │ │ │ ├── GlobEntry.java │ │ │ │ │ ├── JavaArchiveInfo.java │ │ │ │ │ ├── JavaPluginInfo.java │ │ │ │ │ ├── JavaProjectInfo.java │ │ │ │ │ ├── JavaResourceInfo.java │ │ │ │ │ ├── JavaSourceEntry.java │ │ │ │ │ ├── JavaSourceInfo.java │ │ │ │ │ ├── JavaSrcJarEntry.java │ │ │ │ │ ├── LabelEntry.java │ │ │ │ │ └── ResourceEntry.java │ │ │ └── execution │ │ │ │ ├── BazelModelCommandExecutionService.java │ │ │ │ ├── BazelReadOnlyJob.java │ │ │ │ ├── BazelWorkspaceJob.java │ │ │ │ ├── JobsBasedExecutionService.java │ │ │ │ ├── TaskNameHelper.java │ │ │ │ └── WorkspaceLockDetectingFuture.java │ │ ├── osgi │ │ │ └── OsgiServiceTracker.java │ │ ├── projectview │ │ │ ├── BazelProjectFileReader.java │ │ │ ├── BazelProjectView.java │ │ │ ├── GlobSetMatcher.java │ │ │ └── RawSection.java │ │ ├── resources │ │ │ └── BazelOutputFilterMatcher.java │ │ ├── setup │ │ │ ├── DefaultProjectViewFileInitializer.java │ │ │ └── ImportBazelWorkspaceJob.java │ │ └── util │ │ │ ├── jar │ │ │ ├── BazelJarFile.java │ │ │ └── SourceJarFinder.java │ │ │ └── trace │ │ │ ├── StopWatch.java │ │ │ ├── Trace.java │ │ │ ├── TraceGraphDumper.java │ │ │ ├── TraceTree.java │ │ │ └── TracingSubMonitor.java │ │ └── preferences │ │ ├── BazelCorePreferenceKeys.java │ │ └── BazelPreferenceInitializer.java ├── com.salesforce.bazel.eclipse.jdtls │ ├── .classpath │ ├── .project │ ├── .settings │ │ ├── JDT.LS Bazel.launch │ │ ├── org.eclipse.core.resources.prefs │ │ ├── org.eclipse.core.runtime.prefs │ │ ├── org.eclipse.jdt.core.prefs │ │ ├── org.eclipse.jdt.ui.prefs │ │ └── org.eclipse.pde.core.prefs │ ├── META-INF │ │ └── MANIFEST.MF │ ├── OSGI-INF │ │ └── com.salesforce.bazel.eclipse.jdtls.execution.BazelJdtLsSyncStatsOutputComponent.xml │ ├── build.properties │ ├── defaultLogbackConfiguration │ │ └── logback.xml │ ├── plugin.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── salesforce │ │ └── bazel │ │ └── eclipse │ │ └── jdtls │ │ ├── BazelJdtLsPlugin.java │ │ ├── BazelJdtLsSharedContstants.java │ │ ├── commands │ │ └── BazelJdtLsDelegateCommandHandler.java │ │ ├── execution │ │ ├── BazelJdtLsSyncStatsOutputComponent.java │ │ ├── ReconnectingSocket.java │ │ ├── ReusingOutputStreamProvider.java │ │ └── StreamingSocketBazelCommandExecutor.java │ │ ├── logback │ │ ├── BazelJdtLsLogbackConfigurator.java │ │ └── StatusPrinter.java │ │ └── managers │ │ ├── BazelBuildSupport.java │ │ ├── BazelFileDetector.java │ │ ├── BazelProjectImporter.java │ │ └── JavaApplicationLaunchConfiguration.java ├── com.salesforce.bazel.eclipse.ui │ ├── .classpath │ ├── .options │ ├── .project │ ├── .settings │ │ ├── Bazel Eclipse.launch │ │ ├── org.eclipse.core.resources.prefs │ │ ├── org.eclipse.jdt.core.prefs │ │ ├── org.eclipse.jdt.ui.prefs │ │ └── org.eclipse.pde.core.prefs │ ├── META-INF │ │ └── MANIFEST.MF │ ├── OSGI-INF │ │ └── com.salesforce.bazel.eclipse.ui.execution.BazelUiSyncStatsOutputComponent.xml │ ├── about.ini │ ├── bazel-feature-image.png │ ├── bazel-feature-image@2x.png │ ├── build.properties │ ├── logo │ │ ├── Bazel_logo.png │ │ └── Bazel_logo.svg │ ├── plugin.xml │ ├── resources │ │ ├── bazelicon.gif │ │ ├── failed.png │ │ ├── failed@2x.png │ │ ├── icon.ico │ │ ├── import_bazel_workspace.gif │ │ ├── logo.png │ │ ├── logo@2x.png │ │ └── views │ │ │ ├── variable_tab.png │ │ │ └── variable_tab@2x.png │ ├── src │ │ └── com │ │ │ └── salesforce │ │ │ └── bazel │ │ │ └── eclipse │ │ │ └── ui │ │ │ ├── BazelUIPlugin.java │ │ │ ├── commands │ │ │ ├── BaseBazelProjectHandler.java │ │ │ ├── BaseBazelProjectsHandler.java │ │ │ ├── BaseJobBasedHandler.java │ │ │ ├── BazelDiagnosticsJob.java │ │ │ ├── DebugBazelExecutionHandler.java │ │ │ ├── SynchronizeAllWorkspacesHandler.java │ │ │ ├── SynchronizeProjectsHandler.java │ │ │ ├── UpdateClasspathsHandler.java │ │ │ └── classpath │ │ │ │ └── AddCompileDependencyHandler.java │ │ │ ├── execution │ │ │ ├── BazelUiSyncStatsOutputComponent.java │ │ │ ├── BazelWorkspaceConsole.java │ │ │ ├── CapturingLiniesAndForwardingOutputStream.java │ │ │ ├── EclipseConsoleBazelCommandExecutor.java │ │ │ └── EclipseConsoleStreamsProvider.java │ │ │ ├── jdt │ │ │ ├── BazelQuickFixProcessor.java │ │ │ ├── FindClassResolutionsOperation.java │ │ │ ├── JavaResolutionFactory.java │ │ │ └── UnresolvedImportFixProcessor.java │ │ │ ├── launchconfiguration │ │ │ ├── BazelArgumentsTab.java │ │ │ ├── BazelRunLaunchConfigurationTabGroup.java │ │ │ ├── BazelTargetTab.java │ │ │ ├── BazelWorkingDirectoryBlock.java │ │ │ └── CommandArgumentsBlock.java │ │ │ ├── preferences │ │ │ └── BazelPreferencePage.java │ │ │ ├── utils │ │ │ ├── BazelProjectUtilitis.java │ │ │ └── JavaSearchUtil.java │ │ │ └── wizards │ │ │ ├── BazelImportWizard.java │ │ │ ├── BazelImportWizardMainPage.java │ │ │ └── BazelImportWizardProjectViewPage.java │ └── syntaxes │ │ ├── bazel.configuration.json │ │ ├── bazel.tmLanguage.json │ │ ├── bazel.tmLanguage.license │ │ ├── bazelproject.configuration.json │ │ ├── bazelproject.tmLanguage.json │ │ ├── bazelrc.configuration.json │ │ ├── bazelrc.tmLanguage.json │ │ ├── starlark.configuration.json │ │ ├── starlark.tmLanguage.json │ │ └── starlark.tmLanguage.license ├── com.salesforce.bazel.importedsource │ ├── .classpath │ ├── .factorypath │ ├── .gitignore │ ├── .project │ ├── .settings │ │ ├── org.eclipse.core.resources.prefs │ │ ├── org.eclipse.jdt.apt.core.prefs │ │ ├── org.eclipse.jdt.core.prefs │ │ ├── org.eclipse.jdt.ui.prefs │ │ └── org.eclipse.pde.core.prefs │ ├── META-INF │ │ └── MANIFEST.MF │ ├── README.md │ ├── build.properties │ ├── proto │ │ ├── README.md │ │ ├── bazel │ │ │ ├── build.proto │ │ │ ├── build_event_stream.proto │ │ │ ├── command_line.proto │ │ │ ├── deps.proto │ │ │ ├── failure_details.proto │ │ │ ├── invocation_policy.proto │ │ │ ├── java_compilation.proto │ │ │ └── option_filters.proto │ │ ├── buildozer │ │ │ └── api.proto │ │ ├── intellij │ │ │ ├── common.proto │ │ │ └── intellij_ide_info.proto │ │ ├── protobuf │ │ │ ├── descriptor.proto │ │ │ ├── duration.proto │ │ │ └── timestamp.proto │ │ ├── protoc bazel.launch │ │ ├── protoc buildozer.launch │ │ ├── protoc intellij_ide_info.launch │ │ ├── src-proto-bazel │ │ │ └── com │ │ │ │ └── google │ │ │ │ └── devtools │ │ │ │ ├── build │ │ │ │ ├── buildjar │ │ │ │ │ └── proto │ │ │ │ │ │ └── JavaCompilation.java │ │ │ │ └── lib │ │ │ │ │ ├── buildeventstream │ │ │ │ │ └── BuildEventStreamProtos.java │ │ │ │ │ ├── query2 │ │ │ │ │ └── proto │ │ │ │ │ │ └── proto2api │ │ │ │ │ │ └── Build.java │ │ │ │ │ ├── runtime │ │ │ │ │ └── proto │ │ │ │ │ │ ├── CommandLineOuterClass.java │ │ │ │ │ │ └── InvocationPolicyOuterClass.java │ │ │ │ │ ├── server │ │ │ │ │ └── FailureDetails.java │ │ │ │ │ └── view │ │ │ │ │ └── proto │ │ │ │ │ └── Deps.java │ │ │ │ └── common │ │ │ │ └── options │ │ │ │ └── proto │ │ │ │ └── OptionFilters.java │ │ ├── src-proto-buildozer │ │ │ └── com │ │ │ │ └── google │ │ │ │ └── devtools │ │ │ │ └── buildozer │ │ │ │ └── BuildozerProtos.java │ │ └── src-proto-intellij │ │ │ └── com │ │ │ └── google │ │ │ └── devtools │ │ │ └── intellij │ │ │ ├── aspect │ │ │ └── Common.java │ │ │ └── ideinfo │ │ │ └── IntellijIdeInfo.java │ ├── src-bazel │ │ ├── com │ │ │ └── google │ │ │ │ └── devtools │ │ │ │ └── build │ │ │ │ └── lib │ │ │ │ ├── collect │ │ │ │ ├── compacthashset │ │ │ │ │ └── CompactHashSet.java │ │ │ │ └── nestedset │ │ │ │ │ ├── NestedSet.java │ │ │ │ │ ├── NestedSetBuilder.java │ │ │ │ │ ├── NestedSetVisitor.java │ │ │ │ │ └── Order.java │ │ │ │ └── concurrent │ │ │ │ └── MoreFutures.java │ │ └── net │ │ │ └── starlark │ │ │ └── java │ │ │ ├── annot │ │ │ ├── Param.java │ │ │ ├── ParamType.java │ │ │ ├── README.md │ │ │ ├── StarlarkAnnotations.java │ │ │ ├── StarlarkBuiltin.java │ │ │ ├── StarlarkMethod.java │ │ │ └── processor │ │ │ │ └── StarlarkMethodProcessor.java │ │ │ ├── cmd │ │ │ └── Main.java │ │ │ ├── eval │ │ │ ├── BuiltinFunction.java │ │ │ ├── CallUtils.java │ │ │ ├── CpuProfiler.java │ │ │ ├── Debug.java │ │ │ ├── Dict.java │ │ │ ├── Eval.java │ │ │ ├── EvalException.java │ │ │ ├── EvalUtils.java │ │ │ ├── FlagGuardedValue.java │ │ │ ├── FormatParser.java │ │ │ ├── GuardedValue.java │ │ │ ├── HasBinary.java │ │ │ ├── ImmutableSingletonStarlarkList.java │ │ │ ├── ImmutableStarlarkList.java │ │ │ ├── JNI.java │ │ │ ├── LazyImmutableStarlarkList.java │ │ │ ├── MethodDescriptor.java │ │ │ ├── MethodLibrary.java │ │ │ ├── Module.java │ │ │ ├── Mutability.java │ │ │ ├── MutableStarlarkList.java │ │ │ ├── NoneType.java │ │ │ ├── ParamDescriptor.java │ │ │ ├── Printer.java │ │ │ ├── RangeList.java │ │ │ ├── RegularImmutableStarlarkList.java │ │ │ ├── RegularTuple.java │ │ │ ├── Sequence.java │ │ │ ├── SingletonTuple.java │ │ │ ├── Starlark.java │ │ │ ├── StarlarkCallable.java │ │ │ ├── StarlarkFloat.java │ │ │ ├── StarlarkFunction.java │ │ │ ├── StarlarkIndexable.java │ │ │ ├── StarlarkInt.java │ │ │ ├── StarlarkIterable.java │ │ │ ├── StarlarkList.java │ │ │ ├── StarlarkMembershipTestable.java │ │ │ ├── StarlarkSemantics.java │ │ │ ├── StarlarkSet.java │ │ │ ├── StarlarkThread.java │ │ │ ├── StarlarkValue.java │ │ │ ├── StringModule.java │ │ │ ├── Structure.java │ │ │ ├── SymbolGenerator.java │ │ │ ├── Tuple.java │ │ │ ├── cpu_profiler_posix.cc │ │ │ └── cpu_profiler_unimpl.cc │ │ │ ├── lib │ │ │ └── json │ │ │ │ └── Json.java │ │ │ ├── spelling │ │ │ └── SpellChecker.java │ │ │ └── syntax │ │ │ ├── Argument.java │ │ │ ├── AssignmentStatement.java │ │ │ ├── BinaryOperatorExpression.java │ │ │ ├── CallExpression.java │ │ │ ├── Comment.java │ │ │ ├── Comprehension.java │ │ │ ├── ConditionalExpression.java │ │ │ ├── DefStatement.java │ │ │ ├── DictExpression.java │ │ │ ├── DotExpression.java │ │ │ ├── Expression.java │ │ │ ├── ExpressionStatement.java │ │ │ ├── FileLocations.java │ │ │ ├── FileOptions.java │ │ │ ├── FloatLiteral.java │ │ │ ├── FlowStatement.java │ │ │ ├── ForStatement.java │ │ │ ├── Identifier.java │ │ │ ├── IfStatement.java │ │ │ ├── IndexExpression.java │ │ │ ├── IntLiteral.java │ │ │ ├── LambdaExpression.java │ │ │ ├── Lexer.java │ │ │ ├── ListExpression.java │ │ │ ├── LoadStatement.java │ │ │ ├── Location.java │ │ │ ├── Node.java │ │ │ ├── NodePrinter.java │ │ │ ├── NodeVisitor.java │ │ │ ├── Parameter.java │ │ │ ├── Parser.java │ │ │ ├── ParserInput.java │ │ │ ├── Program.java │ │ │ ├── Resolver.java │ │ │ ├── ReturnStatement.java │ │ │ ├── SliceExpression.java │ │ │ ├── StarlarkFile.java │ │ │ ├── Statement.java │ │ │ ├── StringLiteral.java │ │ │ ├── SyntaxError.java │ │ │ ├── TokenKind.java │ │ │ └── UnaryOperatorExpression.java │ └── src-intellij-plugin │ │ └── com │ │ ├── google │ │ └── idea │ │ │ └── blaze │ │ │ ├── base │ │ │ ├── bazel │ │ │ │ ├── BazelBuildSystemProvider.java │ │ │ │ └── BuildSystemProvider.java │ │ │ ├── command │ │ │ │ ├── buildresult │ │ │ │ │ ├── BepArtifactData.java │ │ │ │ │ ├── BlazeArtifact.java │ │ │ │ │ ├── BuildEventStreamProvider.java │ │ │ │ │ ├── BuildResult.java │ │ │ │ │ ├── LocalFileOutputArtifact.java │ │ │ │ │ ├── OutputArtifact.java │ │ │ │ │ ├── OutputArtifactParser.java │ │ │ │ │ ├── OutputOrSourceArtifactParser.java │ │ │ │ │ ├── ParsedBepOutput.java │ │ │ │ │ └── SourceArtifact.java │ │ │ │ └── info │ │ │ │ │ └── BlazeInfo.java │ │ │ ├── dependencies │ │ │ │ ├── TargetInfo.java │ │ │ │ └── TestSize.java │ │ │ ├── ideinfo │ │ │ │ ├── ArtifactLocation.java │ │ │ │ ├── Dependency.java │ │ │ │ ├── JavaIdeInfo.java │ │ │ │ ├── JavaToolchainIdeInfo.java │ │ │ │ ├── LibraryArtifact.java │ │ │ │ ├── ProjectDataInterner.java │ │ │ │ ├── ProtoWrapper.java │ │ │ │ ├── Tags.java │ │ │ │ ├── TargetIdeInfo.java │ │ │ │ ├── TargetKey.java │ │ │ │ └── TestIdeInfo.java │ │ │ ├── model │ │ │ │ └── primitives │ │ │ │ │ ├── ExecutionRootPath.java │ │ │ │ │ ├── GenericBlazeRules.java │ │ │ │ │ ├── InvalidTargetException.java │ │ │ │ │ ├── Kind.java │ │ │ │ │ ├── Label.java │ │ │ │ │ ├── LanguageClass.java │ │ │ │ │ ├── PackagePathValidator.java │ │ │ │ │ ├── RuleType.java │ │ │ │ │ ├── TargetExpression.java │ │ │ │ │ ├── TargetName.java │ │ │ │ │ ├── WildcardTargetPattern.java │ │ │ │ │ ├── WorkspacePath.java │ │ │ │ │ └── WorkspaceRoot.java │ │ │ ├── sync │ │ │ │ └── workspace │ │ │ │ │ ├── ArtifactLocationDecoder.java │ │ │ │ │ ├── ArtifactLocationDecoderImpl.java │ │ │ │ │ ├── WorkspacePathResolver.java │ │ │ │ │ └── WorkspacePathResolverImpl.java │ │ │ └── util │ │ │ │ └── WorkspacePathUtil.java │ │ │ └── java │ │ │ ├── JavaBlazeRules.java │ │ │ └── sync │ │ │ ├── importer │ │ │ └── ExecutionPathHelper.java │ │ │ └── model │ │ │ └── BlazeJarLibrary.java │ │ └── intellij │ │ └── openapi │ │ └── util │ │ ├── io │ │ └── FileUtil.java │ │ └── text │ │ └── StringUtil.java ├── com.salesforce.bazel.logback │ ├── .classpath │ ├── .project │ ├── .settings │ │ ├── org.eclipse.core.resources.prefs │ │ ├── org.eclipse.core.runtime.prefs │ │ ├── org.eclipse.jdt.core.prefs │ │ ├── org.eclipse.jdt.ui.prefs │ │ └── org.eclipse.pde.core.prefs │ ├── META-INF │ │ ├── MANIFEST.MF │ │ └── services │ │ │ └── ch.qos.logback.classic.spi.Configurator │ ├── build.properties │ ├── defaultLogbackConfiguration │ │ └── logback.xml │ ├── p2.inf │ └── src │ │ └── com │ │ └── salesforce │ │ └── bazel │ │ └── logback │ │ ├── appender │ │ └── EclipseLogAppender.java │ │ └── configuration │ │ └── BazelLogbackConfigurator.java ├── com.salesforce.bazel.scipls │ ├── .classpath │ ├── .project │ ├── .settings │ │ ├── SCIP Bazel LS (port 9925).launch │ │ ├── org.eclipse.core.resources.prefs │ │ ├── org.eclipse.core.runtime.prefs │ │ ├── org.eclipse.jdt.core.prefs │ │ ├── org.eclipse.jdt.ui.prefs │ │ └── org.eclipse.pde.core.prefs │ ├── META-INF │ │ └── MANIFEST.MF │ ├── build.properties │ ├── plugin.xml │ └── src │ │ └── com │ │ └── salesforce │ │ └── bazel │ │ └── scipls │ │ ├── BazelScipLsPlugin.java │ │ ├── ScipBazelJavaLanguageServer.java │ │ └── app │ │ ├── NamedPipeInputStream.java │ │ ├── NamedPipeOutputStream.java │ │ ├── ProcessWatcher.java │ │ └── ServerApplication.java ├── com.salesforce.bazel.sdk │ ├── .classpath │ ├── .options │ ├── .project │ ├── .settings │ │ ├── Import InteliJ Aspects.launch │ │ ├── de.loskutov.anyedit.AnyEditTools.prefs │ │ ├── org.eclipse.core.resources.prefs │ │ ├── org.eclipse.core.runtime.prefs │ │ ├── org.eclipse.jdt.core.prefs │ │ ├── org.eclipse.jdt.ui.prefs │ │ ├── org.eclipse.pde.core.prefs │ │ ├── org.moreunit.core.prefs │ │ └── org.moreunit.prefs │ ├── META-INF │ │ └── MANIFEST.MF │ ├── README.md │ ├── aspects │ │ ├── README.md │ │ └── import │ │ │ ├── .bazelignore │ │ │ ├── .bazelversion │ │ │ ├── .gitignore │ │ │ ├── BUILD │ │ │ ├── MODULE.bazel │ │ │ ├── MODULE.bazel.lock │ │ │ └── import-and-build.sh │ ├── build.properties │ ├── plugin.properties │ └── src │ │ └── com │ │ └── salesforce │ │ └── bazel │ │ └── sdk │ │ ├── BazelJavaSdkPlugin.java │ │ ├── BazelVersion.java │ │ ├── aspects │ │ └── intellij │ │ │ ├── IntellijAspects.java │ │ │ └── LanguageOutputGroup.java │ │ ├── command │ │ ├── BazelBinary.java │ │ ├── BazelBinaryVersionDetector.java │ │ ├── BazelBuildCommand.java │ │ ├── BazelBuildWithIntelliJAspectsCommand.java │ │ ├── BazelCQueryCommand.java │ │ ├── BazelCQueryWithStarlarkExpressionCommand.java │ │ ├── BazelCommand.java │ │ ├── BazelCommandExecutor.java │ │ ├── BazelInfoCommand.java │ │ ├── BazelQueryCommand.java │ │ ├── BazelQueryForLabelsCommand.java │ │ ├── BazelQueryForPackagesCommand.java │ │ ├── BazelQueryForTargetProtoCommand.java │ │ ├── BazelRunCommand.java │ │ ├── BuildozerCommand.java │ │ ├── DefaultBazelCommandExecutor.java │ │ ├── ProcessStreamsProvider.java │ │ ├── VerboseProcessStreamsProvider.java │ │ ├── querylight │ │ │ ├── Attribute.java │ │ │ ├── BazelRuleAttribute.java │ │ │ ├── GeneratedFile.java │ │ │ ├── Rule.java │ │ │ └── Target.java │ │ └── shell │ │ │ ├── MacOsLoginShellFinder.java │ │ │ ├── ShellUtil.java │ │ │ └── UnixLoginShellFinder.java │ │ ├── init │ │ └── BazelJavaSDKInit.java │ │ ├── model │ │ ├── BazelLabel.java │ │ └── BazelLabelUtil.java │ │ ├── projectview │ │ ├── BazelIgnoreParser.java │ │ ├── ImportRoots.java │ │ ├── ProjectDirectoriesHelper.java │ │ └── TargetExpressionList.java │ │ └── util │ │ ├── DurationUtil.java │ │ └── SystemUtil.java └── testdata │ ├── .classpath │ ├── .project │ ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.core.runtime.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ └── org.eclipse.pde.core.prefs │ ├── META-INF │ └── MANIFEST.MF │ ├── README.md │ ├── build.properties │ ├── src │ └── testdata │ │ ├── SharedTestData.java │ │ └── utils │ │ ├── BazelWorkspaceExtension.java │ │ ├── LoggingProgressMonitor.java │ │ ├── LoggingProgressProviderExtension.java │ │ └── ProvisionWorkspaceExtension.java │ └── workspaces │ └── 001 │ ├── .bazelproject │ ├── .gitignore │ ├── WORKSPACE │ ├── module1 │ ├── BUILD │ └── java │ │ ├── resources │ │ └── hello.txt │ │ └── src │ │ └── hello │ │ └── Hello.java │ ├── module2 │ ├── BUILD │ └── java │ │ ├── src │ │ └── library │ │ │ └── Greeting.java │ │ └── test │ │ └── library │ │ └── GreetingTest.java │ ├── module3 │ ├── BUILD │ └── java │ │ └── src │ │ └── log │ │ └── Logger.java │ ├── not_visible │ └── this_should_not_be_seen_in_Eclipse.txt │ └── third_party │ └── maven │ ├── BUILD │ └── dependencies.bzl ├── docs ├── bef │ ├── README.md │ ├── bazel_eclipse_icon.png │ ├── bef_fullimage.png │ ├── history.md │ ├── import_wizard_1.png │ ├── import_wizard_2.png │ ├── import_workspace.md │ ├── install.md │ ├── sync_and_build.md │ └── using_the_feature.md ├── bjls │ └── README.md ├── common │ ├── classpath.md │ ├── projectviews.md │ └── sync.md ├── dev │ ├── BEF_Arch.png │ ├── architecture.md │ ├── release.md │ └── thebuild.md └── logos │ ├── README.md │ ├── bef_developers_full.jpg │ ├── bef_developers_full.png │ ├── bef_developers_small.png │ ├── bef_logo_full.jpg │ ├── bef_logo_full.png │ ├── bef_logo_marketplace.jpg │ ├── bef_logo_small.png │ ├── bjls_logo_full.jpg │ └── bjls_logo_small.jpeg ├── features ├── com.salesforce.bazel.eclipse.feature │ ├── .project │ ├── .settings │ │ ├── org.eclipse.core.resources.prefs │ │ └── org.eclipse.core.runtime.prefs │ ├── README.md │ ├── build.properties │ ├── feature.xml │ └── p2.inf └── com.salesforce.bazel.eclipse.jdtls.feature │ ├── .project │ ├── .settings │ ├── org.eclipse.core.resources.prefs │ └── org.eclipse.core.runtime.prefs │ ├── README.md │ ├── build.properties │ └── feature.xml ├── javaConfig.json ├── mvnw ├── mvnw.cmd ├── pom.xml ├── releng ├── mavenparent │ └── pom.xml ├── p2repository │ └── category.xml ├── products │ ├── jdt-bazel-ls │ │ └── jdt-bazel-language-server.product │ └── scip-bazel-ls │ │ └── scip-bazel-language-server.product └── target-platform │ ├── target-platform-dev.target │ ├── target-platform-dev.tpd │ ├── target-platform.target │ └── target-platform.tpd ├── tests ├── com.salesforce.bazel.eclipse.core.tests │ ├── .classpath │ ├── .project │ ├── .settings │ │ ├── com.salesforce.bazel.eclipse.core.tests - all headless tests.launch │ │ ├── com.salesforce.bazel.eclipse.ui.tests - all ui tests.launch │ │ ├── org.eclipse.core.resources.prefs │ │ ├── org.eclipse.core.runtime.prefs │ │ ├── org.eclipse.jdt.core.prefs │ │ ├── org.eclipse.jdt.ui.prefs │ │ └── org.eclipse.pde.core.prefs │ ├── META-INF │ │ └── MANIFEST.MF │ ├── build.properties │ └── src │ │ └── com │ │ └── salesforce │ │ └── bazel │ │ └── eclipse │ │ └── core │ │ ├── extensions │ │ ├── EclipseHeadlessBazelCommandExecutorTest.java │ │ └── TestCommand.java │ │ ├── model │ │ ├── BazelModelTest.java │ │ └── BazelWorkspaceTest.java │ │ ├── tests │ │ └── it │ │ │ ├── Workspace001Test_BasicModelAssumptions.java │ │ │ └── Workspace001Test_Provisioning.java │ │ └── util │ │ └── trace │ │ └── TraceGraphDumperTest.java ├── com.salesforce.bazel.eclipse.jdtls.tests │ ├── .classpath │ ├── .project │ ├── .settings │ │ ├── org.eclipse.core.resources.prefs │ │ ├── org.eclipse.core.runtime.prefs │ │ ├── org.eclipse.jdt.core.prefs │ │ ├── org.eclipse.jdt.ui.prefs │ │ └── org.eclipse.pde.core.prefs │ ├── META-INF │ │ └── MANIFEST.MF │ ├── build.properties │ ├── plugin.xml │ ├── projects │ │ ├── .gitignore │ │ ├── bazel-ls-demo-project │ │ │ ├── BUILD │ │ │ ├── WORKSPACE │ │ │ ├── module1 │ │ │ │ ├── BUILD │ │ │ │ └── java │ │ │ │ │ ├── resources │ │ │ │ │ └── hello.txt │ │ │ │ │ └── src │ │ │ │ │ └── hello │ │ │ │ │ └── Hello.java │ │ │ ├── module2 │ │ │ │ ├── BUILD │ │ │ │ └── java │ │ │ │ │ ├── src │ │ │ │ │ └── library │ │ │ │ │ │ └── Greeting.java │ │ │ │ │ └── test │ │ │ │ │ └── library │ │ │ │ │ └── GreetingTest.java │ │ │ ├── module3 │ │ │ │ ├── BUILD │ │ │ │ └── java │ │ │ │ │ └── src │ │ │ │ │ └── log │ │ │ │ │ └── Logger.java │ │ │ └── third_party │ │ │ │ └── maven │ │ │ │ ├── BUILD │ │ │ │ └── dependencies.bzl │ │ ├── build-with-class │ │ │ ├── WORKSPACE │ │ │ └── module1 │ │ │ │ └── java │ │ │ │ └── src │ │ │ │ └── example │ │ │ │ ├── BUILD │ │ │ │ ├── Greeting.java │ │ │ │ └── ProjectRunner.java │ │ ├── build-with-subpackage │ │ │ ├── WORKSPACE │ │ │ └── module │ │ │ │ ├── BUILD │ │ │ │ ├── java │ │ │ │ └── src │ │ │ │ │ └── example │ │ │ │ │ └── ProjectRunner.java │ │ │ │ └── submodule │ │ │ │ ├── BUILD │ │ │ │ └── java │ │ │ │ └── src │ │ │ │ └── greeting │ │ │ │ └── SayHi.java │ │ └── build-with-workspace │ │ │ ├── BUILD │ │ │ ├── WORKSPACE │ │ │ └── module1 │ │ │ ├── BUILD │ │ │ └── java │ │ │ └── src │ │ │ └── example │ │ │ ├── Greeting.java │ │ │ └── ProjectRunner.java │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── salesforce │ │ └── bazel │ │ └── eclipse │ │ └── jdtls │ │ └── B2eclipseTestPlugin.java ├── com.salesforce.bazel.eclipse.ui.tests │ ├── .classpath │ ├── .project │ ├── .settings │ │ ├── org.eclipse.core.resources.prefs │ │ ├── org.eclipse.jdt.core.prefs │ │ ├── org.eclipse.jdt.ui.prefs │ │ └── org.eclipse.pde.core.prefs │ ├── META-INF │ │ └── MANIFEST.MF │ ├── build.properties │ └── src │ │ └── com │ │ └── salesforce │ │ └── bazel │ │ └── eclipse │ │ └── ui │ │ └── execution │ │ ├── BazelInfoCommandWithConsoleExecutorTest.java │ │ ├── BazelQueryTestCommand.java │ │ ├── CapturingLiniesAndForwardingOutputStreamTest.java │ │ ├── EclipseConsoleBazelCommandExecutorTest.java │ │ └── TestCommand.java ├── com.salesforce.bazel.importedsource.tests │ ├── .classpath │ ├── .project │ ├── .settings │ │ ├── org.eclipse.core.resources.prefs │ │ ├── org.eclipse.jdt.core.prefs │ │ ├── org.eclipse.jdt.ui.prefs │ │ └── org.eclipse.pde.core.prefs │ ├── META-INF │ │ └── MANIFEST.MF │ ├── build.properties │ └── src │ │ └── com │ │ └── google │ │ └── idea │ │ └── blaze │ │ └── base │ │ ├── ideinfo │ │ └── JavaIdeInfoTest.java │ │ └── model │ │ └── primitives │ │ ├── ExecutionRootPathTest.java │ │ ├── LabelTest.java │ │ ├── PackagePathValidatorTest.java │ │ ├── TargetExpressionTest.java │ │ ├── TargetNameTest.java │ │ └── WorkspacePathTest.java └── com.salesforce.bazel.sdk.tests │ ├── .classpath │ ├── .project │ ├── .settings │ ├── org.eclipse.core.resources.prefs │ ├── org.eclipse.core.runtime.prefs │ ├── org.eclipse.jdt.core.prefs │ ├── org.eclipse.jdt.ui.prefs │ └── org.eclipse.pde.core.prefs │ ├── META-INF │ └── MANIFEST.MF │ ├── build.properties │ └── src │ └── com │ └── salesforce │ └── bazel │ └── sdk │ ├── command │ ├── DefaultBazelCommandExecutorTest.java │ ├── TestCommand.java │ └── shell │ │ ├── MacOsLoginShellFinderTest.java │ │ └── UnixLoginShellFinderTest.java │ ├── model │ └── BazelLabelTest.java │ └── util │ └── SystemUtilTest.java └── tools ├── bazel-eclipse-cleanup.xml.xml └── bazel-eclipse-formatter.xml /.github/bef-create-update-site.sh: -------------------------------------------------------------------------------- 1 | # Script to create the update site for official releases 2 | 3 | mkdir bef-staging 4 | cp releng/p2repository/target/*.zip bef-staging 5 | cp -R releng/p2repository/target/repository bef-staging/update-site 6 | cp .github/bef-update-site-index.html bef-staging/index.html 7 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | target-branch: "main" 8 | assignees: 9 | - "guw" 10 | commit-message: 11 | prefix: "Dependabot:" 12 | open-pull-requests-limit: 2 13 | -------------------------------------------------------------------------------- /.github/pages/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Bazel Eclipse Update Site 6 | 7 | 8 |

Bazel Eclipse Installation

9 |

10 | This is the installation site for Bazel Eclipse. 11 | You can read up on Bazel Eclipse in the documentation 12 |

13 |

14 | There is also an update site for installing Bazel Eclipse. 15 | Follow these instructions: 16 | 17 |

26 |

27 | 28 |

29 | Welcome to Bazel Eclipse! 30 |

31 | 32 | 33 | -------------------------------------------------------------------------------- /.github/workflows/link-checker.yml: -------------------------------------------------------------------------------- 1 | name: Check Links 2 | 3 | on: 4 | #pull_request: 5 | # branches: 6 | # - main 7 | # manually from the Actions tab 8 | workflow_dispatch: 9 | 10 | jobs: 11 | markdown-link-check: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v4 15 | - uses: gaurav-nelson/github-action-markdown-link-check@v1 16 | with: 17 | use-quiet-mode: 'yes' 18 | use-verbose-mode: 'yes' 19 | -------------------------------------------------------------------------------- /.github/workflows/test-results.yml: -------------------------------------------------------------------------------- 1 | name: Publish Test Results 2 | 3 | on: 4 | workflow_run: 5 | workflows: ["CI"] 6 | types: 7 | - completed 8 | 9 | permissions: {} 10 | 11 | jobs: 12 | test-results: 13 | name: Test Results 14 | runs-on: ubuntu-latest 15 | if: github.event.workflow_run.conclusion != 'skipped' 16 | 17 | permissions: 18 | checks: write 19 | pull-requests: write 20 | actions: read 21 | 22 | steps: 23 | - name: Download and Extract Artifacts 24 | uses: dawidd6/action-download-artifact@v9 25 | with: 26 | run_id: ${{ github.event.workflow_run.id }} 27 | name: (test-results.*|ci-event-file) 28 | name_is_regexp: true 29 | path: artifacts 30 | 31 | - name: Publish Test Results 32 | uses: EnricoMi/publish-unit-test-result-action@v2 33 | with: 34 | commit: ${{ github.event.workflow_run.head_sha }} 35 | event_file: artifacts/ci-event-file/event.json 36 | event_name: ${{ github.event.workflow_run.event }} 37 | files: "artifacts/**/*.xml" 38 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # compile output 2 | bin/ 3 | target/ 4 | 5 | 6 | # Log files 7 | *.log 8 | 9 | # Built Artifacts 10 | *.zip 11 | *.tar.gz 12 | *.rar 13 | *.class 14 | bin 15 | testbin 16 | dist 17 | 18 | # Eclipse 19 | eclipse.sh 20 | eclipse_ide.sh 21 | 22 | # OS 23 | .DS_Store 24 | 25 | # Eclipse cleaner script (//tools/eclipse) 26 | my_env.sh 27 | 28 | # temp. files 29 | *~ 30 | *.rej 31 | *.bak 32 | .DS_Store 33 | .Trashes 34 | *.swp 35 | *.lock 36 | pom.versionBackup 37 | pom.tycho 38 | .polyglot.* 39 | .META_INF_MANIFEST.MF 40 | .META-INF_MANIFEST.MF 41 | .tycho-* 42 | 43 | # other 44 | *.patch 45 | offline_project_mgmt.md 46 | -------------------------------------------------------------------------------- /.mvn/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | org.eclipse.tycho 5 | tycho-build 6 | ${tycho.version} 7 | 8 | 9 | -------------------------------------------------------------------------------- /.mvn/maven.config: -------------------------------------------------------------------------------- 1 | -Dtycho.version=4.0.12 2 | -Dtycho.p2.transport.min-cache-minutes=129600 -------------------------------------------------------------------------------- /.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | # Licensed to the Apache Software Foundation (ASF) under one 2 | # or more contributor license agreements. See the NOTICE file 3 | # distributed with this work for additional information 4 | # regarding copyright ownership. The ASF licenses this file 5 | # to you under the Apache License, Version 2.0 (the 6 | # "License"); you may not use this file except in compliance 7 | # with the License. You may obtain a copy of the License at 8 | # 9 | # https://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, 12 | # software distributed under the License is distributed on an 13 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 14 | # KIND, either express or implied. See the License for the 15 | # specific language governing permissions and limitations 16 | # under the License. 17 | 18 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip 19 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.3.2/maven-wrapper-3.3.2.jar 20 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | bazel-eclipse 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /.settings/org.eclipse.core.runtime.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | line.separator=\n 3 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "yaozheng.vscode-pde", 4 | "vscjava.vscode-java-pack", 5 | "esbenp.prettier-vscode" 6 | ] 7 | } 8 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "type": "java", 6 | "name": "Attach to JDT-LS (Standard)", 7 | "request": "attach", 8 | "hostName": "localhost", 9 | "port": 1044, 10 | "projectName": "com.salesforce.bazel.eclipse.jdtls" 11 | }, 12 | { 13 | "type": "java", 14 | "name": "Attach to JDT-LS (Syntax)", 15 | "request": "attach", 16 | "hostName": "localhost", 17 | "port": 1045, 18 | "projectName": "com.salesforce.bazel.eclipse.jdtls" 19 | } 20 | ] 21 | } 22 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "[java]": { 3 | "editor.defaultFormatter": "redhat.java" 4 | }, 5 | "java.format.settings.url": "tools/bazel-eclipse-formatter.xml", 6 | "editor.formatOnSave": true, 7 | "java.configuration.updateBuildConfiguration": "automatic" 8 | } 9 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "Package", 8 | "type": "shell", 9 | "command": "mvn clean -B package", 10 | "windows": { 11 | "command": "mvn clean -B package" 12 | }, 13 | "group": "build", 14 | "problemMatcher": [] 15 | }, 16 | { 17 | "label": "Verify", 18 | "type": "shell", 19 | "command": "mvn -B verify", 20 | "windows": { 21 | "command": "mvn -B verify" 22 | }, 23 | "group": "test", 24 | "problemMatcher": [] 25 | } 26 | ] 27 | } 28 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Comment line immediately above ownership line is reserved for related gus information. Please be careful while editing. 2 | #ECCN:Open Source 3 | -------------------------------------------------------------------------------- /NOTICE: -------------------------------------------------------------------------------- 1 | Bazel Eclipse Feature 2 | Copyright 2018 Salesforce. 3 | Copyright 2016 The Bazel Authors. 4 | Copyright (c) 2008-2018 Sonatype, Inc. and others. 5 | 6 | This product includes software developed at Salesforce (http://www.salesforce.com/). 7 | An early version of this software was developed by Google Inc. using the attribution 'The Bazel Authors'. 8 | 9 | This product includes software developed at 10 | The Eclipse Foundation (http://www.eclipse.org/). 11 | The relevant files contain an EPL header as well as SPDX-License-Identifier: EPL-2.0. 12 | 13 | The original Bazel Eclipse Feature code from Google is licensed Apache-2.0. 14 | The relevant files contain an SPDX-License-Identifier: Apache-2.0. 15 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | ## Security 2 | 3 | Please report any security issue to [security@salesforce.com](mailto:security@salesforce.com) 4 | as soon as it is discovered. This library limits its runtime dependencies in 5 | order to reduce the total cost of ownership as much as can be, but all consumers 6 | should remain vigilant and have their security stakeholders review all third-party 7 | products (3PP) like this one and their dependencies. -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/.options: -------------------------------------------------------------------------------- 1 | com.salesforce.bazel.eclipse.core/debugLog=true 2 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/.settings/org.eclipse.core.runtime.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | line.separator=\n 3 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | resolve.requirebundle=false 3 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/README.md: -------------------------------------------------------------------------------- 1 | ## Bazel Eclipse Feature: Core Plugin 2 | 3 | In the [architecture](../../docs/dev/architecture.md) of the Bazel Eclipse Feature, the implementation is spread across a few Eclipse plugins. 4 | 5 | - **plugin-core**: this plugin is the one that is integrated with Eclipse APIs, and contains classes such as the activator 6 | - **bazel-java-sdk**: handles model abstractions and command execution for Bazel 7 | 8 | This package contains the core plugin. 9 | 10 | ### Eclipse API Integration 11 | 12 | The core plugin (plugin-core) is the heart of the feature. 13 | It contains the integration with the actual Eclipse APIs. 14 | 15 | It provides these facilities: 16 | 17 | - Activator for the feature 18 | - Build hook that gets called when source code changes 19 | - Bazel Classpath container which provides the classpath to Eclipse for each project 20 | - Workspace import wizard 21 | 22 | and many more features. 23 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = META-INF/,\ 2 | plugin.xml,\ 3 | . 4 | jars.compile.order = . 5 | source.. = src/ 6 | src.includes = README.md 7 | output.. = bin/ 8 | additional.bundles = com.github.ben-manes.caffeine,\ 9 | com.google.gson,\ 10 | org.apache.commons.text,\ 11 | org.osgi.service.event,\ 12 | com.google.errorprone.annotations 13 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 6 | 7 | 8 | 9 | 10 | ${logFile} 11 | 12 | %d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/builder/BazelProjectBuilder.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.core.builder; 2 | 3 | import java.util.Map; 4 | 5 | import org.eclipse.core.resources.IProject; 6 | import org.eclipse.core.resources.IncrementalProjectBuilder; 7 | import org.eclipse.core.runtime.CoreException; 8 | import org.eclipse.core.runtime.IProgressMonitor; 9 | 10 | public class BazelProjectBuilder extends IncrementalProjectBuilder { 11 | 12 | @Override 13 | protected IProject[] build(int kind, Map args, IProgressMonitor monitor) throws CoreException { 14 | return new IProject[0]; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/classpath/BazelClasspathScope.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.core.classpath; 2 | 3 | /** 4 | * The different possible classpath scopes 5 | */ 6 | public enum BazelClasspathScope { 7 | 8 | /** 9 | * Dependency resolution scope constant indicating compile scope. 10 | */ 11 | COMPILE_CLASSPATH, 12 | 13 | /** 14 | * Maven dependency resolution scope constant indicating runtime scope. 15 | */ 16 | RUNTIME_CLASSPATH; 17 | 18 | public static final BazelClasspathScope DEFAULT_CLASSPATH = BazelClasspathScope.RUNTIME_CLASSPATH; 19 | } 20 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/events/BazelCoreEventConstants.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2024 Salesforce and others. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License 2.0 6 | * which accompanies this distribution, and is available at 7 | * https://www.eclipse.org/legal/epl-2.0/ 8 | * 9 | * SPDX-License-Identifier: EPL-2.0 10 | * 11 | * Contributors: 12 | * Salesforce - adapted from M2E, JDT or other Eclipse project 13 | */ 14 | package com.salesforce.bazel.eclipse.core.events; 15 | 16 | /** 17 | * Shared constants to be used with the OSGi EventAdmin specification. 18 | */ 19 | public interface BazelCoreEventConstants { 20 | 21 | String TOPIC_BASE = "com/salesforce/bazel/eclipse/core/events/"; 22 | String TOPIC_EVERYTHING = TOPIC_BASE + "*"; 23 | 24 | String TOPIC_SYNC_FINISHED = TOPIC_BASE + "sync-finished"; 25 | 26 | String EVENT_DATA_BAZEL_WORKSPACE_LOCATION = "bazel.workspace_location"; 27 | 28 | String EVENT_DATA_START_INSTANT = "start"; 29 | String EVENT_DATA_DURATION = "duration"; 30 | String EVENT_DATA_STATUS = "status"; 31 | 32 | String EVENT_DATA_COUNT_PROJECT = "count.projects"; 33 | String EVENT_DATA_COUNT_TARGETS = "count.targets"; 34 | 35 | String EVENT_DATA_TARGET_DISCOVERY_STRATEGY = "target.discovery_stratregy"; 36 | String EVENT_DATA_TARGET_PROVISIONING_STRATEGY = "target.provisioning_strategy"; 37 | 38 | String EVENT_DATA_TRACE = "trace"; 39 | } 40 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/extensions/PriorityAttributeComparator.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.core.extensions; 2 | 3 | import java.util.Comparator; 4 | 5 | import org.eclipse.core.runtime.IConfigurationElement; 6 | 7 | /** 8 | * A {@link Comparator} for Eclipse extension registry {@link IConfigurationElement elements} which uses an integer 9 | * attribute named {@value #ATTR_NAME_PRIORITY}. 10 | */ 11 | public final class PriorityAttributeComparator implements Comparator { 12 | 13 | public static final String ATTR_NAME_PRIORITY = "priority"; 14 | 15 | public static final PriorityAttributeComparator INSTANCE = new PriorityAttributeComparator(); 16 | 17 | @Override 18 | public int compare(IConfigurationElement o1, IConfigurationElement o2) { 19 | var p1 = safeParse(o1.getAttribute(ATTR_NAME_PRIORITY)); 20 | var p2 = safeParse(o2.getAttribute(ATTR_NAME_PRIORITY)); 21 | 22 | return p2 - p1; // higher priority is more important 23 | } 24 | 25 | private int safeParse(String priority) { 26 | try { 27 | return priority != null ? Integer.parseInt(priority) : 10; 28 | } catch (NumberFormatException e) { 29 | return 0; 30 | } 31 | } 32 | } -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/BazelBuildFileInfo.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2023 Salesforce and others. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License 2.0 6 | * which accompanies this distribution, and is available at 7 | * https://www.eclipse.org/legal/epl-2.0/ 8 | * 9 | * SPDX-License-Identifier: EPL-2.0 10 | * 11 | * Contributors: 12 | * Salesforce - initial implementation 13 | */ 14 | package com.salesforce.bazel.eclipse.core.model; 15 | 16 | import java.util.Collections; 17 | import java.util.List; 18 | 19 | import com.salesforce.bazel.eclipse.core.model.buildfile.FunctionCall; 20 | 21 | import net.starlark.java.syntax.CallExpression; 22 | import net.starlark.java.syntax.LoadStatement; 23 | 24 | /** 25 | * Element info for {@link BazelBuildFile} 26 | */ 27 | public final class BazelBuildFileInfo extends BazelFileInfo { 28 | 29 | private final FunctionCall packageCall; 30 | 31 | BazelBuildFileInfo(BazelBuildFile bazelBuildFile, List loadStatements, 32 | List macroCalls, CallExpression packageCall) { 33 | super(bazelBuildFile, loadStatements, macroCalls); 34 | this.packageCall = 35 | packageCall != null ? new FunctionCall(bazelBuildFile, packageCall, Collections.emptyMap()) : null; // not allowed to be rebound 36 | } 37 | 38 | public FunctionCall getPackageCall() { 39 | return packageCall; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/BazelElementInfo.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2023 Salesforce and others. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License 2.0 6 | * which accompanies this distribution, and is available at 7 | * https://www.eclipse.org/legal/epl-2.0/ 8 | * 9 | * SPDX-License-Identifier: EPL-2.0 10 | * 11 | * Contributors: 12 | * Salesforce - Partially adapted and heavily inspired from Eclipse JDT, M2E and PDE 13 | */ 14 | package com.salesforce.bazel.eclipse.core.model; 15 | 16 | import org.eclipse.core.resources.IWorkspaceRoot; 17 | import org.eclipse.core.resources.ResourcesPlugin; 18 | 19 | /** 20 | * The information representing a {@link BazelElement} after it has been read/queried from Bazel. 21 | *

22 | * Element infos are used by the model. SDK users should not access them directly. If they believe they have to please 23 | * open a discussion thread with the SDK team for lack of API in the {@link BazelElement} model. 24 | *

25 | */ 26 | public abstract sealed class BazelElementInfo 27 | permits BazelWorkspaceInfo, BazelPackageInfo, BazelTargetInfo, BazelModelInfo, BazelFileInfo { 28 | 29 | static IWorkspaceRoot getEclipseWorkspaceRoot() { 30 | return ResourcesPlugin.getWorkspace().getRoot(); 31 | } 32 | 33 | /** 34 | * @return the owning element handle of the element info 35 | */ 36 | public abstract BazelElement getOwner(); 37 | } 38 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/BazelModelInfo.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * 3 | */ 4 | package com.salesforce.bazel.eclipse.core.model; 5 | 6 | import static com.salesforce.bazel.eclipse.core.BazelCoreSharedContstants.BAZEL_NATURE_ID; 7 | 8 | import java.util.ArrayList; 9 | import java.util.List; 10 | 11 | import org.eclipse.core.resources.IProject; 12 | import org.eclipse.core.resources.ResourcesPlugin; 13 | import org.eclipse.core.runtime.CoreException; 14 | 15 | public final class BazelModelInfo extends BazelElementInfo { 16 | 17 | private final BazelModel bazelModel; 18 | 19 | public BazelModelInfo(BazelModel bazelModel) { 20 | this.bazelModel = bazelModel; 21 | } 22 | 23 | public List findWorkspaces() throws CoreException { 24 | var result = new ArrayList(); 25 | var projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); 26 | for (IProject project : projects) { 27 | if (project.isOpen() && project.hasNature(BAZEL_NATURE_ID)) { 28 | var bazelProject = bazelModel.getModelManager().getBazelProject(project); 29 | if (bazelProject.isWorkspaceProject()) { 30 | result.add(new BazelWorkspace(bazelProject.getLocation(), bazelModel)); 31 | } 32 | } 33 | } 34 | return result; 35 | } 36 | 37 | @Override 38 | public BazelModel getOwner() { 39 | return bazelModel; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/BazelModuleFileInfo.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2023 Salesforce and others. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License 2.0 6 | * which accompanies this distribution, and is available at 7 | * https://www.eclipse.org/legal/epl-2.0/ 8 | * 9 | * SPDX-License-Identifier: EPL-2.0 10 | * 11 | * Contributors: 12 | * Salesforce - initial implementation 13 | */ 14 | package com.salesforce.bazel.eclipse.core.model; 15 | 16 | import java.util.Collections; 17 | import java.util.List; 18 | 19 | import com.salesforce.bazel.eclipse.core.model.buildfile.FunctionCall; 20 | 21 | import net.starlark.java.syntax.CallExpression; 22 | import net.starlark.java.syntax.LoadStatement; 23 | 24 | /** 25 | * Element info for {@link BazelModuleFile} 26 | */ 27 | public final class BazelModuleFileInfo extends BazelFileInfo { 28 | 29 | private final FunctionCall moduleCall; 30 | 31 | BazelModuleFileInfo(BazelModuleFile bazelModuleFile, List loadStatements, 32 | List macroCalls, CallExpression moduleCall) { 33 | super(bazelModuleFile, loadStatements, macroCalls); 34 | this.moduleCall = 35 | moduleCall != null ? new FunctionCall(bazelModuleFile, moduleCall, Collections.emptyMap()) : null; // not allowed to be rebound 36 | } 37 | 38 | public FunctionCall getModuleCall() { 39 | return moduleCall; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/buildfile/GlobInfo.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.core.model.buildfile; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * glob information extracted from a macro call 7 | */ 8 | public record GlobInfo(List include, List exclude) { 9 | 10 | } 11 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/discovery/BazelBuildfileTargetDiscovery.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.core.model.discovery; 2 | 3 | import java.util.Collection; 4 | 5 | import org.eclipse.core.runtime.CoreException; 6 | import org.eclipse.core.runtime.IProgressMonitor; 7 | 8 | import com.google.idea.blaze.base.model.primitives.TargetExpression; 9 | import com.google.idea.blaze.base.model.primitives.WorkspacePath; 10 | import com.salesforce.bazel.eclipse.core.model.BazelWorkspace; 11 | 12 | /** 13 | * A simplification of {@link BazelQueryTargetDiscovery} which ignores targets and assumes all from selected packages. 14 | *

15 | * This is recommended with the {@link BuildfileDrivenProvisioningStrategy}. 16 | *

17 | */ 18 | public class BazelBuildfileTargetDiscovery extends BazelQueryTargetDiscovery implements TargetDiscoveryStrategy { 19 | 20 | public static final String STRATEGY_NAME = "buildfiles"; 21 | 22 | @Override 23 | public Collection discoverTargets(BazelWorkspace bazelWorkspace, 24 | Collection bazelPackages, IProgressMonitor progress) throws CoreException { 25 | return bazelPackages.stream().map(TargetExpression::allFromPackageNonRecursive).toList(); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/discovery/EclipsePreferencesHelper.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.core.model.discovery; 2 | 3 | import java.lang.reflect.InvocationTargetException; 4 | import java.util.Properties; 5 | 6 | import org.eclipse.core.internal.preferences.EclipsePreferences; 7 | import org.osgi.service.prefs.BackingStoreException; 8 | import org.osgi.service.prefs.Preferences; 9 | 10 | /** 11 | * A helper to make internal protected Eclipse code accessible 12 | */ 13 | @SuppressWarnings("restriction") 14 | class EclipsePreferencesHelper extends EclipsePreferences { 15 | 16 | public static void convertToPreferences(Properties table, Preferences targetPreferences) 17 | throws BackingStoreException { 18 | EclipsePreferences.convertFromProperties((EclipsePreferences) targetPreferences, table, true); 19 | makeDirty((EclipsePreferences) targetPreferences); 20 | } 21 | 22 | private static void makeDirty(EclipsePreferences targetPreferences) throws BackingStoreException { 23 | try { 24 | var makeDirty = EclipsePreferences.class.getDeclaredMethod("makeDirty"); 25 | makeDirty.setAccessible(true); 26 | makeDirty.invoke(targetPreferences); 27 | } catch (NoSuchMethodException | SecurityException | IllegalAccessException | IllegalArgumentException 28 | | InvocationTargetException e) { 29 | throw new BackingStoreException("Unable to mark modified preferences for needing save!", e); 30 | } 31 | 32 | } 33 | } -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/discovery/analyzers/JavaBinaryAnalyzer.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2023 Salesforce and others. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License 2.0 6 | * which accompanies this distribution, and is available at 7 | * https://www.eclipse.org/legal/epl-2.0/ 8 | * 9 | * SPDX-License-Identifier: EPL-2.0 10 | * 11 | * Contributors: 12 | * Salesforce - initial implementation 13 | */ 14 | package com.salesforce.bazel.eclipse.core.model.discovery.analyzers; 15 | 16 | /** 17 | * Default java_binary (same as java_library) 18 | */ 19 | public class JavaBinaryAnalyzer extends JavaLibraryAnalyzer { 20 | 21 | } 22 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/discovery/analyzers/JavaJunit5TestAnalyzer.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2023 Salesforce and others. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License 2.0 6 | * which accompanies this distribution, and is available at 7 | * https://www.eclipse.org/legal/epl-2.0/ 8 | * 9 | * SPDX-License-Identifier: EPL-2.0 10 | * 11 | * Contributors: 12 | * Salesforce - initial implementation 13 | */ 14 | package com.salesforce.bazel.eclipse.core.model.discovery.analyzers; 15 | 16 | /** 17 | * java_junit5_test 18 | * 19 | * @see https://github.com/bazel-contrib/rules_jvm#java_junit5_test 20 | */ 21 | public class JavaJunit5TestAnalyzer extends JavaTestAnalyzer { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/discovery/analyzers/JavaTestSuiteAnalyzer.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2023 Salesforce and others. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License 2.0 6 | * which accompanies this distribution, and is available at 7 | * https://www.eclipse.org/legal/epl-2.0/ 8 | * 9 | * SPDX-License-Identifier: EPL-2.0 10 | * 11 | * Contributors: 12 | * Salesforce - initial implementation 13 | */ 14 | package com.salesforce.bazel.eclipse.core.model.discovery.analyzers; 15 | 16 | /** 17 | * java_test_suite 18 | * 19 | * @see https://github.com/bazel-contrib/rules_jvm#java_test_suite 20 | */ 21 | public class JavaTestSuiteAnalyzer extends JavaTestAnalyzer { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/discovery/classpath/AccessRule.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.core.model.discovery.classpath; 2 | 3 | import org.eclipse.core.runtime.IPath; 4 | import org.eclipse.jdt.core.IAccessRule; 5 | 6 | /** 7 | * Modifiable version of {@link IAccessRule} 8 | */ 9 | public record AccessRule(IPath pattern, int kind) { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/discovery/projects/Entry.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.core.model.discovery.projects; 2 | 3 | /** 4 | * An entry in the {@link JavaProjectInfo}. 5 | *

6 | * Entries implement {@link #hashCode()} and {@link #equals(Object)} to allow identification of duplicate entries. 7 | *

8 | */ 9 | public interface Entry { 10 | 11 | } -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/discovery/projects/EntrySettings.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2024 Salesforce and others. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License 2.0 6 | * which accompanies this distribution, and is available at 7 | * https://www.eclipse.org/legal/epl-2.0/ 8 | * 9 | * SPDX-License-Identifier: EPL-2.0 10 | * 11 | * Contributors: 12 | * Salesforce - adapted from M2E, JDT or other Eclipse project 13 | */ 14 | package com.salesforce.bazel.eclipse.core.model.discovery.projects; 15 | 16 | /** 17 | * Additional information for an {@link Entry} 18 | */ 19 | public record EntrySettings(boolean nowarn) { 20 | /** 21 | * default settings 22 | */ 23 | public static final EntrySettings DEFAULT_SETTINGS = new EntrySettings(false); 24 | 25 | } 26 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/discovery/projects/LabelEntry.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.core.model.discovery.projects; 2 | 3 | import java.util.Objects; 4 | 5 | import com.salesforce.bazel.sdk.model.BazelLabel; 6 | 7 | /** 8 | * An entry pointing to another target, which may be generated output. 9 | */ 10 | public class LabelEntry implements Entry { 11 | 12 | private final BazelLabel label; 13 | 14 | public LabelEntry(BazelLabel label) { 15 | this.label = label; 16 | } 17 | 18 | @Override 19 | public boolean equals(Object obj) { 20 | if (this == obj) { 21 | return true; 22 | } 23 | if (obj == null) { 24 | return false; 25 | } 26 | if (getClass() != obj.getClass()) { 27 | return false; 28 | } 29 | var other = (LabelEntry) obj; 30 | return Objects.equals(label, other.label); 31 | } 32 | 33 | /** 34 | * @return the label 35 | */ 36 | public BazelLabel getLabel() { 37 | return label; 38 | } 39 | 40 | @Override 41 | public int hashCode() { 42 | return Objects.hash(label); 43 | } 44 | 45 | @Override 46 | public String toString() { 47 | return label.toString(); 48 | } 49 | 50 | } -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/discovery/projects/ResourceEntry.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.core.model.discovery.projects; 2 | 3 | import java.util.Objects; 4 | 5 | import org.eclipse.core.runtime.IPath; 6 | 7 | /** 8 | * A single file entry pointing to a single resource file. 9 | */ 10 | public class ResourceEntry implements Entry { 11 | 12 | private final IPath relativePath; 13 | private final IPath resourceStripPrefix; 14 | 15 | IPath detectedRootPath; 16 | 17 | public ResourceEntry(IPath relativePath, IPath resourceStripPrefix) { 18 | this.relativePath = relativePath; 19 | this.resourceStripPrefix = resourceStripPrefix; 20 | } 21 | 22 | @Override 23 | public boolean equals(Object obj) { 24 | if (this == obj) { 25 | return true; 26 | } 27 | if (obj == null) { 28 | return false; 29 | } 30 | if (getClass() != obj.getClass()) { 31 | return false; 32 | } 33 | var other = (ResourceEntry) obj; 34 | return Objects.equals(relativePath, other.relativePath); 35 | } 36 | 37 | public IPath getRelativePath() { 38 | return relativePath; 39 | } 40 | 41 | public IPath getResourceStripPrefix() { 42 | return resourceStripPrefix; 43 | } 44 | 45 | @Override 46 | public int hashCode() { 47 | return Objects.hash(relativePath); 48 | } 49 | 50 | @Override 51 | public String toString() { 52 | return "Resource[" + relativePath + "]"; 53 | } 54 | 55 | } -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.core/src/com/salesforce/bazel/eclipse/core/model/execution/TaskNameHelper.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.core.model.execution; 2 | 3 | import com.salesforce.bazel.sdk.command.BazelCommand; 4 | 5 | /** 6 | * Extracts task name for progress reporting with a workaround for 7 | * https://github.com/eclipse-platform/eclipse.platform.ui/issues/1112 8 | */ 9 | class TaskNameHelper { 10 | 11 | static final int TASK_LENGTH_LIMIT = 120; 12 | 13 | static String getSpanName(BazelCommand command) { 14 | return command.getPurpose(); 15 | } 16 | 17 | static String getTaskName(BazelCommand command) { 18 | var taskName = command.toString(); 19 | if (taskName.length() <= TASK_LENGTH_LIMIT) { 20 | return taskName; 21 | } 22 | 23 | // see https://github.com/eclipse-platform/eclipse.platform.ui/issues/1112 why we should limit the length on task name 24 | return taskName.substring(0, TASK_LENGTH_LIMIT - 3) + "..."; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.jdtls/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.jdtls/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.salesforce.bazel.eclipse.jdtls 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.pde.ds.core.builder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.jdt.core.javanature 31 | org.eclipse.pde.PluginNature 32 | 33 | 34 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.jdtls/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.jdtls/.settings/org.eclipse.core.runtime.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | line.separator=\n 3 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.jdtls/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | resolve.requirebundle=false 3 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.jdtls/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Eclipse-BundleShape: dir 3 | Bundle-ManifestVersion: 2 4 | Automatic-Module-Name: com.salesforce.bazel.eclipse.jdtls 5 | Bundle-Name: Bazel Java Language Server Plug-In 6 | Bundle-SymbolicName: com.salesforce.bazel.eclipse.jdtls;singleton:=true 7 | Bundle-Version: 2.0.0.qualifier 8 | Bundle-Activator: com.salesforce.bazel.eclipse.jdtls.BazelJdtLsPlugin 9 | Bundle-Vendor: Bazel Eclipse Feature 10 | Require-Bundle: org.eclipse.core.runtime, 11 | org.eclipse.jdt.core, 12 | org.eclipse.core.resources, 13 | org.eclipse.debug.core, 14 | org.eclipse.jdt.launching, 15 | com.google.gson, 16 | com.google.guava, 17 | org.eclipse.jdt.ls.core, 18 | org.apache.commons.lang3, 19 | com.salesforce.bazel.importedsource, 20 | com.salesforce.bazel.sdk, 21 | com.salesforce.bazel.eclipse.core, 22 | ch.qos.logback.classic, 23 | ch.qos.logback.core 24 | Export-Package: com.salesforce.bazel.eclipse.jdtls, 25 | com.salesforce.bazel.eclipse.jdtls.commands, 26 | com.salesforce.bazel.eclipse.jdtls.execution, 27 | com.salesforce.bazel.eclipse.jdtls.logback, 28 | com.salesforce.bazel.eclipse.jdtls.managers 29 | Import-Package: org.fusesource.jansi;version="2.4.0", 30 | org.osgi.service.event;version="1.4.1", 31 | org.slf4j;version="2.0.0" 32 | Bundle-RequiredExecutionEnvironment: JavaSE-21 33 | Bundle-ActivationPolicy: lazy 34 | Service-Component: OSGI-INF/com.salesforce.bazel.eclipse.jdtls.execution.BazelJdtLsSyncStatsOutputComponent.xml 35 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.jdtls/OSGI-INF/com.salesforce.bazel.eclipse.jdtls.execution.BazelJdtLsSyncStatsOutputComponent.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.jdtls/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = META-INF/,\ 2 | plugin.xml,\ 3 | .,\ 4 | OSGI-INF/,\ 5 | defaultLogbackConfiguration/ 6 | jars.compile.order = . 7 | source.. = src/main/java/ 8 | output.. = bin/ 9 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.jdtls/defaultLogbackConfiguration/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | ${com.salesforce.bazel.log.dir}/eclipse.log 5 | 6 | ${com.salesforce.bazel.log.dir}/eclipse-%i.log 7 | 1 8 | 6 9 | 10 | 11 | 10MB 12 | 13 | 14 | %date [%thread] %-5level %logger{35} - %msg%n 15 | 16 | 17 | 18 | 19 | 20 | INFO 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.jdtls/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 11 | 12 | 15 | 19 | 20 | 22 | 25 | 27 | 28 | 30 | 31 | 33 | 34 | 35 | 36 | 38 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.jdtls/src/main/java/com/salesforce/bazel/eclipse/jdtls/BazelJdtLsSharedContstants.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.jdtls; 2 | 3 | public interface BazelJdtLsSharedContstants { 4 | 5 | /** The plug-in identifier of the Bazel Core plug-in */ 6 | String PLUGIN_ID = "com.salesforce.bazel.eclipse.jdtls"; 7 | 8 | } 9 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/.options: -------------------------------------------------------------------------------- 1 | com.salesforce.bazel.eclipse.ui/debugLog=true 2 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.salesforce.bazel.eclipse.ui 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.pde.ds.core.builder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.pde.PluginNature 31 | org.eclipse.jdt.core.javanature 32 | 33 | 34 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | resolve.requirebundle=false 3 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/OSGI-INF/com.salesforce.bazel.eclipse.ui.execution.BazelUiSyncStatsOutputComponent.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/about.ini: -------------------------------------------------------------------------------- 1 | featureImage=bazel-feature-image.png 2 | aboutText=Bazel Eclipse Feature\n\ 3 | Copyright 2016 Salesforce, The Bazel Authors and others\n\ 4 | \n\ 5 | This product includes software developed at Salesforce (http://www.salesforce.com/).\n\ 6 | An early version of this software was developed by Google Inc. using the attribution 'The Bazel Authors'.\n\ 7 | \n\ 8 | This product includes software developed at\n\ 9 | The Eclipse Foundation (http://www.eclipse.org/).\n\ 10 | The relevant files contain an EPL header as well as SPDX-License-Identifier: EPL-2.0.\n\ 11 | \n\ 12 | The original Bazel Eclipse Feature code from Google is licensed Apache-2.0.\n\ 13 | The relevant files contain an SPDX-License-Identifier: Apache-2.0.\n\ 14 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/bazel-feature-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/bundles/com.salesforce.bazel.eclipse.ui/bazel-feature-image.png -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/bazel-feature-image@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/bundles/com.salesforce.bazel.eclipse.ui/bazel-feature-image@2x.png -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | .,\ 5 | plugin.xml,\ 6 | resources/,\ 7 | syntaxes/,\ 8 | bazel-feature-image@2x.png,\ 9 | bazel-feature-image.png,\ 10 | about.ini,\ 11 | OSGI-INF/ 12 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/logo/Bazel_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/bundles/com.salesforce.bazel.eclipse.ui/logo/Bazel_logo.png -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/logo/Bazel_logo.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/resources/bazelicon.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/bundles/com.salesforce.bazel.eclipse.ui/resources/bazelicon.gif -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/resources/failed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/bundles/com.salesforce.bazel.eclipse.ui/resources/failed.png -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/resources/failed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/bundles/com.salesforce.bazel.eclipse.ui/resources/failed@2x.png -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/resources/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/bundles/com.salesforce.bazel.eclipse.ui/resources/icon.ico -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/resources/import_bazel_workspace.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/bundles/com.salesforce.bazel.eclipse.ui/resources/import_bazel_workspace.gif -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/resources/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/bundles/com.salesforce.bazel.eclipse.ui/resources/logo.png -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/resources/logo@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/bundles/com.salesforce.bazel.eclipse.ui/resources/logo@2x.png -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/resources/views/variable_tab.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/bundles/com.salesforce.bazel.eclipse.ui/resources/views/variable_tab.png -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/resources/views/variable_tab@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/bundles/com.salesforce.bazel.eclipse.ui/resources/views/variable_tab@2x.png -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/src/com/salesforce/bazel/eclipse/ui/commands/BaseJobBasedHandler.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.ui.commands; 2 | 3 | import org.eclipse.core.commands.AbstractHandler; 4 | import org.eclipse.core.commands.ExecutionEvent; 5 | import org.eclipse.core.commands.ExecutionException; 6 | import org.eclipse.core.runtime.jobs.Job; 7 | 8 | public abstract class BaseJobBasedHandler extends AbstractHandler { 9 | 10 | protected abstract Job createJob(ExecutionEvent event) throws ExecutionException; 11 | 12 | @Override 13 | public Object execute(final ExecutionEvent event) throws ExecutionException { 14 | final var job = createJob(event); 15 | if (job == null) { 16 | // assume abort 17 | return null; 18 | } 19 | 20 | job.setUser(true); 21 | job.schedule(); 22 | return null; 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/src/com/salesforce/bazel/eclipse/ui/commands/DebugBazelExecutionHandler.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.ui.commands; 2 | 3 | import org.eclipse.core.commands.AbstractHandler; 4 | import org.eclipse.core.commands.ExecutionEvent; 5 | import org.eclipse.core.commands.ExecutionException; 6 | 7 | public class DebugBazelExecutionHandler extends AbstractHandler { 8 | 9 | @Override 10 | public Object execute(ExecutionEvent event) throws ExecutionException { 11 | new BazelDiagnosticsJob().schedule(); 12 | 13 | // nothing 14 | return null; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/src/com/salesforce/bazel/eclipse/ui/commands/SynchronizeAllWorkspacesHandler.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.ui.commands; 2 | 3 | import org.eclipse.core.commands.AbstractHandler; 4 | import org.eclipse.core.commands.ExecutionEvent; 5 | import org.eclipse.core.commands.ExecutionException; 6 | import org.eclipse.core.runtime.CoreException; 7 | 8 | import com.salesforce.bazel.eclipse.core.BazelCore; 9 | import com.salesforce.bazel.eclipse.core.model.BazelWorkspace; 10 | import com.salesforce.bazel.eclipse.core.model.SynchronizeProjectViewJob; 11 | 12 | public class SynchronizeAllWorkspacesHandler extends AbstractHandler { 13 | 14 | @Override 15 | public Object execute(ExecutionEvent event) throws ExecutionException { 16 | try { 17 | var bazelWorkspaces = BazelCore.getModel().getBazelWorkspaces(); 18 | for (BazelWorkspace bazelWorkspace : bazelWorkspaces) { 19 | var job = new SynchronizeProjectViewJob(bazelWorkspace); 20 | job.setUser(true); 21 | job.schedule(); 22 | } 23 | } catch (CoreException e) { 24 | throw new ExecutionException("Unknown Error scheduling refresh jobs", e); 25 | } 26 | 27 | // nothing 28 | return null; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/src/com/salesforce/bazel/eclipse/ui/commands/SynchronizeProjectsHandler.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.ui.commands; 2 | 3 | import org.eclipse.core.commands.ExecutionEvent; 4 | import org.eclipse.core.resources.IProject; 5 | import org.eclipse.core.runtime.CoreException; 6 | import org.eclipse.core.runtime.jobs.Job; 7 | 8 | import com.salesforce.bazel.eclipse.core.BazelCore; 9 | import com.salesforce.bazel.eclipse.core.model.SynchronizeProjectViewJob; 10 | 11 | public class SynchronizeProjectsHandler extends BaseBazelProjectHandler { 12 | 13 | @Override 14 | protected Job createJob(IProject project, ExecutionEvent event) throws CoreException { 15 | var bazelProject = BazelCore.create(project); 16 | var bazelWorkspace = bazelProject.getBazelWorkspace(); 17 | 18 | return new SynchronizeProjectViewJob(bazelWorkspace); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/src/com/salesforce/bazel/eclipse/ui/commands/UpdateClasspathsHandler.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.ui.commands; 2 | 3 | import java.util.List; 4 | 5 | import org.eclipse.core.commands.ExecutionEvent; 6 | import org.eclipse.core.resources.IProject; 7 | import org.eclipse.core.runtime.CoreException; 8 | import org.eclipse.core.runtime.jobs.Job; 9 | 10 | import com.salesforce.bazel.eclipse.core.BazelCorePlugin; 11 | import com.salesforce.bazel.eclipse.core.classpath.InitializeOrRefreshClasspathJob; 12 | 13 | public class UpdateClasspathsHandler extends BaseBazelProjectsHandler { 14 | 15 | @Override 16 | protected Job createJob(List projects, ExecutionEvent event) throws CoreException { 17 | return new InitializeOrRefreshClasspathJob( 18 | projects, 19 | BazelCorePlugin.getInstance().getBazelModelManager().getClasspathManager(), 20 | true /* force */); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/src/com/salesforce/bazel/eclipse/ui/launchconfiguration/BazelRunLaunchConfigurationTabGroup.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2023 Salesforce and others. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License 2.0 6 | * which accompanies this distribution, and is available at 7 | * https://www.eclipse.org/legal/epl-2.0/ 8 | * 9 | * SPDX-License-Identifier: EPL-2.0 10 | * 11 | * Contributors: 12 | * Salesforce - adapted from M2E, JDT or other Eclipse project 13 | */ 14 | package com.salesforce.bazel.eclipse.ui.launchconfiguration; 15 | 16 | import org.eclipse.debug.ui.AbstractLaunchConfigurationTabGroup; 17 | import org.eclipse.debug.ui.CommonTab; 18 | import org.eclipse.debug.ui.EnvironmentTab; 19 | import org.eclipse.debug.ui.ILaunchConfigurationDialog; 20 | import org.eclipse.debug.ui.ILaunchConfigurationTab; 21 | import org.eclipse.debug.ui.sourcelookup.SourceLookupTab; 22 | 23 | public class BazelRunLaunchConfigurationTabGroup extends AbstractLaunchConfigurationTabGroup { 24 | 25 | @Override 26 | public void createTabs(ILaunchConfigurationDialog dialog, String mode) { 27 | ILaunchConfigurationTab[] tabs = { new BazelTargetTab(), new BazelArgumentsTab(), new SourceLookupTab(), 28 | new EnvironmentTab(), new CommonTab() }; 29 | setTabs(tabs); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/src/com/salesforce/bazel/eclipse/ui/utils/BazelProjectUtilitis.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.ui.utils; 2 | 3 | import java.util.ArrayList; 4 | import java.util.List; 5 | 6 | import org.eclipse.core.resources.IProject; 7 | import org.eclipse.ui.IWorkbenchWindow; 8 | import org.eclipse.ui.internal.ide.actions.BuildUtilities; 9 | import org.slf4j.Logger; 10 | import org.slf4j.LoggerFactory; 11 | 12 | import com.salesforce.bazel.eclipse.core.model.BazelProject; 13 | 14 | @SuppressWarnings("restriction") 15 | public class BazelProjectUtilitis { 16 | 17 | public static Logger LOG = LoggerFactory.getLogger(BazelProjectUtilitis.class); 18 | 19 | /** 20 | * @param window 21 | * the workbench window 22 | * @return a list of selected Bazel projects 23 | */ 24 | public static List findSelectedProjects(final IWorkbenchWindow window) { 25 | final List result = new ArrayList<>(); 26 | final var projects = BuildUtilities.findSelectedProjects(window); 27 | for (final IProject project : projects) { 28 | if (BazelProject.isBazelProject(project)) { 29 | result.add(project); 30 | } 31 | } 32 | return result; 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/src/com/salesforce/bazel/eclipse/ui/utils/JavaSearchUtil.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.ui.utils; 2 | 3 | import java.util.LinkedHashSet; 4 | import java.util.Set; 5 | 6 | import org.eclipse.core.runtime.CoreException; 7 | import org.eclipse.jdt.core.IJavaElement; 8 | import org.eclipse.jdt.core.IJavaProject; 9 | import org.eclipse.jdt.core.JavaCore; 10 | import org.eclipse.jdt.core.search.IJavaSearchScope; 11 | import org.eclipse.jdt.core.search.SearchEngine; 12 | 13 | import com.salesforce.bazel.eclipse.core.model.BazelProject; 14 | 15 | public class JavaSearchUtil { 16 | 17 | public static IJavaSearchScope createScopeIncludingAllWorkspaceProjectsButSelected( 18 | BazelProject selectedBazelProject) throws CoreException { 19 | var bazelProjects = selectedBazelProject.getBazelWorkspace().getBazelProjects(); 20 | Set javaProjects = new LinkedHashSet<>(bazelProjects.size()); 21 | 22 | for (BazelProject bazelProject : bazelProjects) { 23 | var javaProject = JavaCore.create(bazelProject.getProject()); 24 | if (javaProject.exists()) { 25 | javaProjects.add(javaProject); 26 | } 27 | } 28 | 29 | javaProjects.remove(JavaCore.create(selectedBazelProject.getProject())); // no need to search in current project itself 30 | 31 | return SearchEngine.createJavaSearchScope(javaProjects.toArray(new IJavaElement[javaProjects.size()])); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/syntaxes/bazel.configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments": { 3 | "lineComment": "#" 4 | }, 5 | "brackets": [ 6 | ["{", "}"], 7 | ["[", "]"], 8 | ["(", ")"] 9 | ], 10 | "autoClosingPairs": [ 11 | ["{", "}"], 12 | ["[", "]"], 13 | ["(", ")"], 14 | { 15 | "open": "\"", 16 | "close": "\"", 17 | "notIn": ["string", "comment"] 18 | }, 19 | { 20 | "open": "'", 21 | "close": "'", 22 | "notIn": ["string", "comment"] 23 | } 24 | ], 25 | "surroundingPairs": [ 26 | ["{", "}"], 27 | ["[", "]"], 28 | ["(", ")"], 29 | ["\"", "\""], 30 | ["'", "'"] 31 | ] 32 | } -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/syntaxes/bazel.tmLanguage.license: -------------------------------------------------------------------------------- 1 | bazel.tmLanguage.json is derived from MagicPython.tmLanguage.json, 2 | which can be found at https://github.com/MagicStack/MagicPython. 3 | 4 | --- 5 | 6 | The MIT License 7 | 8 | Copyright (c) 2015 MagicStack Inc. http://magic.io 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in 18 | all copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 26 | THE SOFTWARE. -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/syntaxes/bazelproject.configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments": { 3 | "lineComment": "#" 4 | } 5 | } -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/syntaxes/bazelproject.tmLanguage.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json", 3 | "name": "bazelproject", 4 | "patterns": [ 5 | { 6 | "include": "#keywords" 7 | }, 8 | { 9 | "include": "#comments" 10 | } 11 | ], 12 | "repository": { 13 | "keywords": { 14 | "patterns": [{ 15 | "name": "keyword.control.bazelproject", 16 | "match": "\\b(directories|targets|derive_targets_from_directories|import|workspace_type|additional_languages|java_language_level|test_sources|shard_sync|target_shard_size|exclude_library|build_flags|sync_flags|test_flags|import_run_configurations|bazel_binary|android_sdk_platform|android_min_sdk|generated_android_resource_directories|gazelle_target|ts_config_rules)\\b" 17 | }] 18 | }, 19 | "comments": { 20 | "name": "comment.line.number-sign.bazelproject", 21 | "begin": "#", 22 | "end": "\n" 23 | } 24 | }, 25 | "scopeName": "source.bazelproject" 26 | } -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/syntaxes/bazelrc.configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments": { 3 | "lineComment": "#" 4 | }, 5 | "autoClosingPairs": [ 6 | { 7 | "open": "\"", 8 | "close": "\"", 9 | "notIn": ["string", "comment"] 10 | }, 11 | { 12 | "open": "'", 13 | "close": "'", 14 | "notIn": ["string", "comment"] 15 | } 16 | ], 17 | "surroundingPairs": [ 18 | ["\"", "\""], 19 | ["'", "'"] 20 | ] 21 | } -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/syntaxes/starlark.configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "comments": { 3 | "lineComment": "#" 4 | }, 5 | "brackets": [ 6 | ["{", "}"], 7 | ["[", "]"], 8 | ["(", ")"] 9 | ], 10 | "autoClosingPairs": [ 11 | ["{", "}"], 12 | ["[", "]"], 13 | ["(", ")"], 14 | { 15 | "open": "\"", 16 | "close": "\"", 17 | "notIn": ["string", "comment"] 18 | }, 19 | { 20 | "open": "'", 21 | "close": "'", 22 | "notIn": ["string", "comment"] 23 | } 24 | ], 25 | "surroundingPairs": [ 26 | ["{", "}"], 27 | ["[", "]"], 28 | ["(", ")"], 29 | ["\"", "\""], 30 | ["'", "'"] 31 | ] 32 | } -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.eclipse.ui/syntaxes/starlark.tmLanguage.license: -------------------------------------------------------------------------------- 1 | starlark.tmLanguage.json is derived from MagicPython.tmLanguage.json, 2 | which can be found at https://github.com/MagicStack/MagicPython. 3 | 4 | --- 5 | 6 | The MIT License 7 | 8 | Copyright (c) 2015 MagicStack Inc. http://magic.io 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in 18 | all copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 26 | THE SOFTWARE. -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/.factorypath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/.gitignore: -------------------------------------------------------------------------------- 1 | /.apt_generated/ 2 | /src-apt-generated/ 3 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.salesforce.bazel.importedsource 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/.settings/org.eclipse.jdt.apt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.jdt.apt.aptEnabled=true 3 | org.eclipse.jdt.apt.genSrcDir=src-apt-generated 4 | org.eclipse.jdt.apt.genTestSrcDir=.apt_generated_tests 5 | org.eclipse.jdt.apt.reconcileEnabled=true 6 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | pluginProject.extensions=false 3 | resolve.requirebundle=false 4 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/README.md: -------------------------------------------------------------------------------- 1 | # Imported Source 2 | 3 | This project contains source code imported from Bazel and Bazel Intellij Plug-in. 4 | Both projects don't publish re-usable libraries. 5 | Therefore, we import the things we need manually. 6 | 7 | Where necessary, the code has been modified to prevent importing unneeded dependencies 8 | 9 | ## Important Settings 10 | 11 | This project does not follow the BEF project settings. 12 | Because the code is imported we do not want it to be processed (eg., formatted). 13 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/build.properties: -------------------------------------------------------------------------------- 1 | source.. = proto/src-proto-bazel/,\ 2 | proto/src-proto-intellij/,\ 3 | proto/src-proto-buildozer/,\ 4 | src-bazel/,\ 5 | src-intellij-plugin/ 6 | output.. = bin/ 7 | bin.includes = META-INF/,\ 8 | . 9 | additional.bundles = com.google.guava,\ 10 | org.jsr-305,\ 11 | com.google.errorprone.annotations,\ 12 | wrapped.com.google.auto.value.auto-value-annotations,\ 13 | wrapped.com.google.auto.value.auto-value 14 | 15 | # as long as 'wrapped.com.google.auto.value.auto-value' is there on classpath Tycho produced the correct output (we don't need to include it in source) 16 | src.excludes = src-apt-generated/ 17 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/proto/README.md: -------------------------------------------------------------------------------- 1 | # Proto File 2 | 3 | This directory contains `.proto` files used in the Java SDK as well as the Eclipse plug-ins. 4 | When they change in their original repository, the need to be updated here. 5 | 6 | For convenience the generated Java code is checked into source control. 7 | Generators have been provided for Eclipse plugged into the *Run > External Tools* menu as shortcuts. 8 | 9 | * `intellij/intellij_ide_info.proto` [13287a2](https://github.com/bazelbuild/intellij/commits/37813e607ad26716c4d1ccf4bc3e7163b2188658/proto/intellij_ide_info.proto) 10 | * `intellij/common.proto` [46582ba](https://github.com/bazelbuild/intellij/commits/37813e607ad26716c4d1ccf4bc3e7163b2188658/proto/common.proto) 11 | * `bazel/build_event_stream.proto` and dependencies [be7458a](https://github.com/bazelbuild/bazel/blob/be7458ad7c96b590e9fdec4c3022b60bf8aa9d05/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto) 12 | * `buildozer/api.proto` [386244e](https://github.com/bazelbuild/buildtools/blob/386244e73fc446db36abd5bc9f291be7c79e2abd/api_proto/api.proto) 13 | 14 | ## Full Vendoring 15 | 16 | Note, for a easier build experience all dependencies have been included here. 17 | This requires updating `import` statements in the `proto` files when versioning them here. 18 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/proto/bazel/java_compilation.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2015 The Bazel Authors. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | // 15 | // Java library manifest, for use by IDEs. 16 | 17 | syntax = "proto2"; 18 | 19 | package blaze.buildjar; 20 | 21 | option java_package = "com.google.devtools.build.buildjar.proto"; 22 | 23 | // Information about a single compilation unit (.java file) 24 | message CompilationUnit { 25 | // The path to the compilation unit 26 | optional string path = 1; 27 | 28 | // The package of the source file 29 | optional string pkg = 2; 30 | 31 | // Whether the source was generated by an annotation processor 32 | optional bool generated_by_annotation_processor = 3; 33 | 34 | // The list of top-level types in the compilation unit 35 | repeated string top_level = 4; 36 | } 37 | 38 | // Top-level message found in .manifest artifacts 39 | message Manifest { 40 | repeated CompilationUnit compilation_unit = 1; 41 | } -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/proto/buildozer/api.proto: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2016 Google Inc. All Rights Reserved. 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, 9 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | See the License for the specific language governing permissions and 11 | limitations under the License. 12 | */ 13 | syntax = "proto3"; 14 | 15 | package devtools.buildozer; 16 | 17 | option go_package = "api_proto"; 18 | 19 | // https://github.com/bazelbuild/buildtools/pull/1193 20 | option java_package = "com.google.devtools.buildozer"; 21 | option java_outer_classname = "BuildozerProtos"; 22 | 23 | message Output { 24 | repeated Record records = 1; 25 | message Record { 26 | repeated Field fields = 1; 27 | message Field { 28 | oneof value { 29 | string text = 1; 30 | int32 number = 2; 31 | ERROR error = 3; 32 | RepeatedString list = 5; 33 | } 34 | // Used internally by Buildozer to decide whether a field should be quoted 35 | // when printing. This does not affect the contents of 'value'. 36 | bool quote_when_printing = 7; 37 | 38 | enum ERROR { 39 | UNKNOWN = 0; 40 | MISSING = 1; 41 | } 42 | } 43 | } 44 | } 45 | 46 | message RepeatedString { 47 | repeated string strings = 1; 48 | } -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/proto/intellij/common.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2018 The Bazel Authors. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | syntax = "proto3"; 16 | 17 | package blaze; 18 | 19 | // option java_api_version = 2; 20 | 21 | option java_package = "com.google.devtools.intellij.aspect"; 22 | 23 | message ArtifactLocation { 24 | string relative_path = 2; 25 | bool is_source = 3; 26 | 27 | // path from the execution root to the actual root: 28 | // exec_root + root_execution_path_fragment + relative_path = absolute_path 29 | string root_execution_path_fragment = 4; 30 | // whether this artifact comes from an external repository (bazel only) 31 | bool is_external = 5; 32 | } -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/proto/protoc bazel.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/proto/protoc buildozer.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/proto/protoc intellij_ide_info.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/src-bazel/net/starlark/java/annot/README.md: -------------------------------------------------------------------------------- 1 | # Starlark interface framework 2 | 3 | The classes in this package define annotations and interfaces used to enable 4 | Starlark access to data types and methods implemented in Java. 5 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/src-bazel/net/starlark/java/eval/JNI.java: -------------------------------------------------------------------------------- 1 | // Copyright 2020 The Bazel Authors. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package net.starlark.java.eval; 16 | 17 | final class JNI { 18 | private JNI() {} // uninstantiable 19 | 20 | static void load() { 21 | try { 22 | System.loadLibrary("cpu_profiler"); 23 | } catch (UnsatisfiedLinkError ex) { 24 | // Ignore, deferring the error until a C function is called, if ever. 25 | // Without this hack //src/test/shell/bazel:bazel_bootstrap_distfile_test 26 | // fails with an utterly uninformative error. 27 | // TODO(adonovan): remove try/catch once that test is fixed. 28 | } 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/src-bazel/net/starlark/java/eval/NoneType.java: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Bazel Authors. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package net.starlark.java.eval; 16 | 17 | import javax.annotation.concurrent.Immutable; 18 | import net.starlark.java.annot.StarlarkBuiltin; 19 | 20 | /** The type of the Starlark None value. */ 21 | @StarlarkBuiltin( 22 | name = "NoneType", 23 | documented = false, 24 | doc = "The type of the Starlark None value.") 25 | @Immutable 26 | public final class NoneType implements StarlarkValue { 27 | 28 | static final NoneType NONE = new NoneType(); 29 | 30 | private NoneType() {} 31 | 32 | @Override 33 | public String toString() { 34 | return "None"; 35 | } 36 | 37 | @Override 38 | public boolean isImmutable() { 39 | return true; 40 | } 41 | 42 | @Override 43 | public boolean truth() { 44 | return false; 45 | } 46 | 47 | @Override 48 | public void repr(Printer printer) { 49 | printer.append("None"); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/src-bazel/net/starlark/java/eval/StarlarkIterable.java: -------------------------------------------------------------------------------- 1 | // Copyright 2019 The Bazel Authors. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package net.starlark.java.eval; 16 | 17 | /** 18 | * A StarlarkIterable value may be iterated by Starlark language constructs such as {@code for} 19 | * loops, list and dict comprehensions, and {@code f(*args)}. 20 | * 21 | *

Functionally this interface is equivalent to {@code java.lang.Iterable}, but it additionally 22 | * affirms that the iterability of a Java class should be exposed to Starlark programs. 23 | */ 24 | public interface StarlarkIterable extends StarlarkValue, Iterable {} 25 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/src-bazel/net/starlark/java/eval/StarlarkMembershipTestable.java: -------------------------------------------------------------------------------- 1 | // Copyright 2024 The Bazel Authors. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package net.starlark.java.eval; 16 | 17 | /** 18 | * A Starlark value that support membership tests ({@code key in object} and {@code key not in 19 | * object}). 20 | */ 21 | public interface StarlarkMembershipTestable extends StarlarkValue { 22 | /** Returns whether the key is in the object. */ 23 | boolean containsKey(StarlarkSemantics semantics, Object key) throws EvalException; 24 | } 25 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/src-bazel/net/starlark/java/syntax/Comment.java: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Bazel Authors. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | package net.starlark.java.syntax; 15 | 16 | /** Syntax node for comments. */ 17 | public final class Comment extends Node { 18 | 19 | private final int offset; 20 | private final String text; 21 | 22 | Comment(FileLocations locs, int offset, String text) { 23 | super(locs); 24 | this.offset = offset; 25 | this.text = text; 26 | } 27 | 28 | /** Returns the text of the comment, including the leading '#' but not the trailing newline. */ 29 | public String getText() { 30 | return text; 31 | } 32 | 33 | @Override 34 | public int getStartOffset() { 35 | return offset; 36 | } 37 | 38 | @Override 39 | public int getEndOffset() { 40 | return offset + text.length(); 41 | } 42 | 43 | @Override 44 | public void accept(NodeVisitor visitor) { 45 | visitor.visit(this); 46 | } 47 | 48 | @Override 49 | public String toString() { 50 | return text; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/src-bazel/net/starlark/java/syntax/ExpressionStatement.java: -------------------------------------------------------------------------------- 1 | // Copyright 2014 The Bazel Authors. All rights reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | package net.starlark.java.syntax; 16 | 17 | /** Syntax node for a statement consisting of an expression evaluated for effect. */ 18 | public final class ExpressionStatement extends Statement { 19 | 20 | private final Expression expression; 21 | 22 | ExpressionStatement(FileLocations locs, Expression expression) { 23 | super(locs, Kind.EXPRESSION); 24 | this.expression = expression; 25 | } 26 | 27 | public Expression getExpression() { 28 | return expression; 29 | } 30 | 31 | @Override 32 | public void accept(NodeVisitor visitor) { 33 | visitor.visit(this); 34 | } 35 | 36 | @Override 37 | public int getStartOffset() { 38 | return expression.getStartOffset(); 39 | } 40 | 41 | @Override 42 | public int getEndOffset() { 43 | return expression.getEndOffset(); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/src-intellij-plugin/com/google/idea/blaze/base/bazel/BazelBuildSystemProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 The Bazel Authors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package com.google.idea.blaze.base.bazel; 14 | 15 | import com.google.common.collect.ImmutableList; 16 | import com.google.idea.blaze.base.model.primitives.WorkspaceRoot; 17 | 18 | /** Provides the bazel build system name string. */ 19 | public class BazelBuildSystemProvider implements BuildSystemProvider { 20 | 21 | public static final BazelBuildSystemProvider BAZEL = new BazelBuildSystemProvider(); 22 | 23 | @Override 24 | public ImmutableList buildArtifactDirectories(WorkspaceRoot root) { 25 | var rootDirName = root.directory().getFileName().toString(); 26 | return ImmutableList.of("bazel-bin", "bazel-genfiles", "bazel-out", "bazel-testlogs", "bazel-" + rootDirName); 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/src-intellij-plugin/com/google/idea/blaze/base/bazel/BuildSystemProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 The Bazel Authors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package com.google.idea.blaze.base.bazel; 14 | 15 | import com.google.common.collect.ImmutableList; 16 | import com.google.idea.blaze.base.model.primitives.WorkspaceRoot; 17 | 18 | /** 19 | * Extension points specify the build systems supported by this plugin.
20 | * The order of the extension points establishes a priority (highest priority first), for situations where we don't have 21 | * an existing project to use for context (e.g. the 'import project' action). 22 | * 23 | *

24 | * Note, the Eclipse plug-in and language server only supports Bazel. Therefore, this interface is a stripped down 25 | * version of the IJ one with only the things needed. 26 | *

27 | */ 28 | public interface BuildSystemProvider { 29 | 30 | /** Directories containing artifacts produced during the build process. */ 31 | ImmutableList buildArtifactDirectories(WorkspaceRoot root); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/src-intellij-plugin/com/google/idea/blaze/base/command/buildresult/OutputArtifact.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2019 The Bazel Authors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package com.google.idea.blaze.base.command.buildresult; 14 | 15 | /** A blaze output artifact, generated during some build action. */ 16 | public interface OutputArtifact extends BlazeArtifact { 17 | 18 | /** The path component related to the build configuration. */ 19 | String getConfigurationMnemonic(); 20 | 21 | /** The blaze-out-relative path. */ 22 | String getRelativePath(); 23 | } -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/src-intellij-plugin/com/google/idea/blaze/base/ideinfo/Tags.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2016 The Bazel Authors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * you may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at 7 | * 8 | * http://www.apache.org/licenses/LICENSE-2.0 9 | * 10 | * Unless required by applicable law or agreed to in writing, software 11 | * distributed under the License is distributed on an "AS IS" BASIS, 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | * See the License for the specific language governing permissions and 14 | * limitations under the License. 15 | */ 16 | package com.google.idea.blaze.base.ideinfo; 17 | 18 | /** Tag constants used by our rules. */ 19 | public final class Tags { 20 | /** Forces import of the target output. */ 21 | public static final String TARGET_TAG_IMPORT_TARGET_OUTPUT = "intellij-import-target-output"; 22 | 23 | public static final String TARGET_TAG_IMPORT_AS_LIBRARY_LEGACY = "aswb-import-as-library"; 24 | 25 | /** 26 | * Signals to the import process that the output of this rule will be provided by the IntelliJ 27 | * SDK. 28 | */ 29 | public static final String TARGET_TAG_PROVIDED_BY_SDK = "intellij-provided-by-sdk"; 30 | 31 | /** Ignores the target. */ 32 | public static final String TARGET_TAG_EXCLUDE_TARGET = "intellij-exclude-target"; 33 | } 34 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/src-intellij-plugin/com/google/idea/blaze/base/model/primitives/InvalidTargetException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 The Bazel Authors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package com.google.idea.blaze.base.model.primitives; 14 | 15 | /** A checked exception thrown when a {@link TargetExpression} cannot be parsed. */ 16 | public class InvalidTargetException extends Exception { 17 | 18 | private static final long serialVersionUID = 1608607306078549547L; 19 | 20 | public InvalidTargetException(String message) { 21 | super(message); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/src-intellij-plugin/com/google/idea/blaze/base/model/primitives/RuleType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2017 The Bazel Authors. All rights reserved. 3 | * 4 | * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with 5 | * the License. You may obtain a copy of the License at 6 | * 7 | * http://www.apache.org/licenses/LICENSE-2.0 8 | * 9 | * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on 10 | * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the 11 | * specific language governing permissions and limitations under the License. 12 | */ 13 | package com.google.idea.blaze.base.model.primitives; 14 | 15 | /** The general type of a rule (e.g. test, binary, etc.). */ 16 | public enum RuleType { 17 | TEST, BINARY, LIBRARY, UNKNOWN, 18 | } -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/src-intellij-plugin/com/intellij/openapi/util/io/FileUtil.java: -------------------------------------------------------------------------------- 1 | package com.intellij.openapi.util.io; 2 | 3 | import static org.eclipse.core.runtime.IPath.SEPARATOR; 4 | import static org.eclipse.core.runtime.IPath.forPosix; 5 | 6 | import java.io.File; 7 | 8 | /** 9 | * This is not a copy but re-implemented to avoid changing too much of Bazel IJ plug-in code. 10 | */ 11 | public class FileUtil { 12 | 13 | private static final boolean notPosix = File.separatorChar != SEPARATOR; 14 | 15 | /** 16 | * Indicates if the given path is within the ancestor. 17 | *

18 | * Note, comparison will be done entirely based on Posix 19 | *

20 | * @param ancestor 21 | * @param path 22 | * @param strict 23 | * @return 24 | */ 25 | public static boolean isAncestor(String ancestor, String path, boolean strict) { 26 | // ignore strict 27 | if(notPosix) { 28 | ancestor = ancestor.replace(File.separatorChar, SEPARATOR); 29 | path = path.replace(File.separatorChar, SEPARATOR); 30 | } 31 | return forPosix(ancestor).isPrefixOf(forPosix(path)); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.importedsource/src-intellij-plugin/com/intellij/openapi/util/text/StringUtil.java: -------------------------------------------------------------------------------- 1 | // Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found 2 | // in the LICENSE file. 3 | package com.intellij.openapi.util.text; 4 | 5 | /** 6 | * Minimalistic version of the very long official one. 7 | */ 8 | public class StringUtil { 9 | 10 | public static String trimEnd(String s, String suffix) { 11 | if (s.endsWith(suffix)) { 12 | return s.substring(0, s.length() - suffix.length()); 13 | } 14 | return s; 15 | } 16 | 17 | public static String trimStart(String s, String prefix) { 18 | if (s.startsWith(prefix)) { 19 | return s.substring(prefix.length()); 20 | } 21 | return s; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.logback/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.logback/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.salesforce.bazel.logback 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.logback/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.logback/.settings/org.eclipse.core.runtime.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | line.separator=\n 3 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.logback/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | resolve.requirebundle=false 3 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.logback/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Logback Configuration for Bazel Eclipse Feature 4 | Bundle-SymbolicName: com.salesforce.bazel.logback 5 | Bundle-Version: 1.0.0.qualifier 6 | Bundle-Vendor: Bazel Eclipse Feature 7 | Fragment-Host: ch.qos.logback.classic;bundle-version="1.4.11" 8 | Automatic-Module-Name: com.salesforce.bazel.logback 9 | Bundle-RequiredExecutionEnvironment: JavaSE-21 10 | Require-Bundle: org.eclipse.core.runtime 11 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.logback/META-INF/services/ch.qos.logback.classic.spi.Configurator: -------------------------------------------------------------------------------- 1 | com.salesforce.bazel.logback.configuration.BazelLogbackConfigurator -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.logback/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | .,\ 5 | defaultLogbackConfiguration/,\ 6 | p2.inf 7 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.scipls/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.scipls/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.salesforce.bazel.scipls 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.scipls/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.scipls/.settings/org.eclipse.core.runtime.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | line.separator=\n 3 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.scipls/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | pluginProject.extensions=true 3 | resolve.requirebundle=false 4 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.scipls/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: SCIP based Language Server for Java and Bazel 4 | Bundle-SymbolicName: com.salesforce.bazel.scipls;singleton:=true 5 | Bundle-Version: 1.0.0.qualifier 6 | Bundle-Activator: com.salesforce.bazel.scipls.BazelScipLsPlugin 7 | Bundle-Vendor: Bazel Eclipse Feature 8 | Bundle-RequiredExecutionEnvironment: JavaSE-21 9 | Automatic-Module-Name: com.salesforce.bazel.eclipse.scipls 10 | Import-Package: org.osgi.framework;version="1.3.0", 11 | org.slf4j;version="2.0.0" 12 | Require-Bundle: org.eclipse.core.runtime;bundle-version="3.31.100", 13 | org.eclipse.lsp4j;bundle-version="0.23.1", 14 | org.eclipse.lsp4j.jsonrpc;bundle-version="0.23.1", 15 | com.salesforce.bazel.sdk;bundle-version="2.0.0", 16 | com.salesforce.bazel.importedsource;bundle-version="2.0.0" 17 | Bundle-ActivationPolicy: lazy 18 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.scipls/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | .,\ 5 | plugin.xml 6 | additional.bundles = com.google.guava,\ 7 | com.google.guava.failureaccess,\ 8 | wrapped.com.sourcegraph.semanticdb-java,\ 9 | wrapped.com.sourcegraph.scip-java-proto,\ 10 | wrapped.com.sourcegraph.scip-java_2.13,\ 11 | wrapped.com.sourcegraph.scip-semanticdb 12 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.scipls/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 12 | 14 | 15 | 16 | 17 | 20 | 23 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.scipls/src/com/salesforce/bazel/scipls/BazelScipLsPlugin.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * 3 | */ 4 | package com.salesforce.bazel.scipls; 5 | 6 | import static java.util.Objects.requireNonNull; 7 | 8 | import org.eclipse.core.runtime.Plugin; 9 | import org.osgi.framework.BundleContext; 10 | 11 | /** 12 | * Plug-in (OSGi bundle) activator for SCIP bases Java LS. 13 | */ 14 | public class BazelScipLsPlugin extends Plugin { 15 | 16 | private static BazelScipLsPlugin plugin; 17 | 18 | public static BazelScipLsPlugin getInstance() { 19 | return requireNonNull(plugin, "not initialized"); 20 | } 21 | 22 | @Override 23 | public void start(BundleContext bundleContext) throws Exception { 24 | super.start(bundleContext); 25 | plugin = this; 26 | } 27 | 28 | @Override 29 | public void stop(BundleContext context) throws Exception { 30 | plugin = null; 31 | super.stop(context); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/.options: -------------------------------------------------------------------------------- 1 | com.salesforce.bazel.sdk/debugLog=true 2 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.salesforce.bazel.sdk 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.xtext.ui.shared.xtextBuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.jdt.core.javabuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.ManifestBuilder 20 | 21 | 22 | 23 | 24 | org.eclipse.pde.SchemaBuilder 25 | 26 | 27 | 28 | 29 | 30 | org.eclipse.jdt.core.javanature 31 | org.eclipse.pde.PluginNature 32 | org.eclipse.xtext.ui.shared.xtextNature 33 | 34 | 35 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/.settings/Import InteliJ Aspects.launch: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/.settings/de.loskutov.anyedit.AnyEditTools.prefs: -------------------------------------------------------------------------------- 1 | activeContentFilterList=*.makefile,makefile,*.Makefile,Makefile,Makefile.*,*.mk,MANIFEST.MF,.project,*.yml 2 | addNewLine=true 3 | convertActionOnSaave=AnyEdit.CnvrtSpacesToTabs 4 | eclipse.preferences.version=1 5 | fixLineDelimiters=false 6 | ignoreBlankLinesWhenTrimming=false 7 | inActiveContentFilterList= 8 | javaTabWidthForJava=true 9 | org.eclipse.jdt.ui.editor.tab.width=4 10 | projectPropsEnabled=true 11 | removeTrailingSpaces=true 12 | replaceAllSpaces=false 13 | replaceAllTabs=false 14 | saveAndAddLine=false 15 | saveAndConvert=false 16 | saveAndFixLineDelimiters=false 17 | saveAndTrim=true 18 | useModulo4Tabs=false 19 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/.settings/org.eclipse.core.runtime.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | line.separator=\n 3 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | resolve.requirebundle=false 3 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/.settings/org.moreunit.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.moreunit.core.anyLanguage.active=true 3 | org.moreunit.core.anyLanguage.srcFolderPathTemplate=${srcProject} 4 | org.moreunit.core.anyLanguage.testFileNameTemplate=${srcFile}(Test|Spec) 5 | org.moreunit.core.anyLanguage.testFolderPathTemplate=${srcProject}.tests 6 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/.settings/org.moreunit.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.moreunit.preferences.version=2 3 | org.moreunit.test_type=junit5 4 | org.moreunit.unitsourcefolder=com.salesforce.bazel.sdk\:src\:com.salesforce.bazel.sdk.tests\:src 5 | org.moreunit.useprojectsettings=true 6 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/README.md: -------------------------------------------------------------------------------- 1 | # Bazel Java SDK and IntelliJ Helpers 2 | 3 | This directory contains the Bazel Java SDK, which is a general purpose Java library for building tools on top of Bazel in the Java programming language. 4 | It implements a number of Bazel helpers and tools, including: 5 | 6 | - Bazel commands and and executors to run Bazel processes and process outputs 7 | - Protobuf `proto` files and generated source 8 | - IntelliJ Aspects for extracting IDE information from Bazel and related Java code 9 | - Bazel primitives (also extracted from IntelliJ Bazel plug-in) 10 | 11 | The SDK will is a helpful library. 12 | It's not intended to be an abstraction for writing IDE agnostic models/code. 13 | At some point we should discuss with the Bazel IntelliJ folks if a common library can be extracted from their plug-in to be reused by BEF as well. 14 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/aspects/README.md: -------------------------------------------------------------------------------- 1 | ## IntelliJ Aspects 2 | 3 | The file contained in this directory is used at runtime within the Bazel Java SDK. 4 | It injects a [Bazel Aspect](https://docs.bazel.build/versions/master/skylark/aspects.html) into each Bazel build. 5 | 6 | It is developed by the Bazel IntelliJ plugin team, and we copy it into Bazel SDK from time to time. 7 | 8 | ### Updating from IntelliJ 9 | 10 | The update is a bit automated. 11 | 12 | 1. Grab the Git SHA you want to update to from [here](https://github.com/bazelbuild/intellij/commits/master/aspect) 13 | 2. Update `import/import-and-build.sh` with the SHA. 14 | 3. Run `import/import-and-build.sh` (` cd import && ./import-and-build.sh`) 15 | 4. Update [IntelliJAspects.java](../src/main/java/com/salesforce/bazel/sdk/aspects/intellij/IntellijAspects.java) to point to the new `aspects-.zip` file 16 | 17 | ### Notes 18 | 19 | Depending on the changes upstream you have to do quite some work to get it back going. 20 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/aspects/import/.bazelignore: -------------------------------------------------------------------------------- 1 | intellij/ -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/aspects/import/.bazelversion: -------------------------------------------------------------------------------- 1 | 8.1.1 2 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/aspects/import/.gitignore: -------------------------------------------------------------------------------- 1 | # external repo and outputs 2 | intellij* 3 | aspect_*.jar 4 | 5 | # bazel symlinks 6 | bazel-* 7 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/aspects/import/MODULE.bazel: -------------------------------------------------------------------------------- 1 | module( 2 | name = "intellij_aspects_import", 3 | bazel_compatibility = [">=8.1.0"], 4 | ) 5 | 6 | bazel_dep(name = "aspect_bazel_lib", version = "2.14.0") 7 | bazel_dep(name = "bazel_skylib", version = "1.7.1") 8 | bazel_dep(name = "rules_pkg", version = "1.1.0") -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/aspects/import/import-and-build.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | # use proper tar 5 | if [ "$(uname)" == "Darwin" ]; then 6 | tar="gtar" 7 | else 8 | tar="tar" 9 | fi 10 | echo "Using '$tar' on $(uname)!" 11 | 12 | if ! command -v $tar &> /dev/null; then 13 | echo "$tar could not be found" 14 | echo "On macOS: brew install gnu-tar" 15 | echo "Also, check PATH environment: $PATH" 16 | exit 1 17 | fi 18 | 19 | # download & extract 20 | # 21 | # Note, wehn updating: 22 | # 1. replace the hash with the one you want to update to 23 | # 2. check WORKSPACE for any repo that needs updates 24 | # 25 | git_sha="1e99c447ee9af21d984df10ca085dadd37feba9b" 26 | git_sha_short=${git_sha::6} 27 | 28 | # abort if file already exists 29 | if test -f "../aspects-${git_sha_short}.zip"; then 30 | echo "aspects-${git_sha_short}.zip already there; delete it force re-import" 31 | exit 0 32 | fi 33 | 34 | # clean-up old left overs 35 | rm -rf bazel-* 36 | rm -rf intellij* 37 | rm -f aspect_*.jar 38 | 39 | # ensure directory exists 40 | mkdir -p intellij 41 | 42 | # download repo 43 | curl -L https://github.com/bazelbuild/intellij/archive/${git_sha}.tar.gz | ${tar} --strip-components 1 -C intellij -xz 44 | 45 | # build the aspects 46 | pushd intellij > /dev/null 47 | bazel build //aspect:all 48 | popd > /dev/null 49 | 50 | # generate tarball 51 | cp intellij/bazel-bin/aspect/aspect_lib.jar . 52 | cp intellij/bazel-bin/aspect/aspect_template_lib.jar . 53 | bazel build :aspects 54 | 55 | # copy to location 56 | cp -vf bazel-bin/aspects.zip ../aspects-${git_sha_short}.zip 57 | 58 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = .,\ 4 | META-INF/,\ 5 | plugin.properties,\ 6 | aspects/aspects-*.zip 7 | additional.bundles = com.salesforce.bazel.importedsource,\ 8 | com.google.guava,\ 9 | com.google.guava.failureaccess 10 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/plugin.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/bundles/com.salesforce.bazel.sdk/plugin.properties -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/BazelJavaSdkPlugin.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.sdk; 2 | 3 | import static java.util.Objects.requireNonNull; 4 | 5 | import org.eclipse.core.runtime.Plugin; 6 | import org.osgi.framework.BundleContext; 7 | 8 | public class BazelJavaSdkPlugin extends Plugin { 9 | 10 | private static String bundleVersion; 11 | 12 | public static String getBundleVersion() { 13 | return requireNonNull(bundleVersion, 14 | "Bundle version not initialized. If this is not running inside OSGi please implement support for an alternate way. Otherwise please ensure the SDK bundle is started properly."); 15 | } 16 | 17 | @Override 18 | public void start(BundleContext context) throws Exception { 19 | super.start(context); 20 | bundleVersion = context.getBundle().getVersion().toString(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/command/BazelBinary.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.sdk.command; 2 | 3 | import static java.util.Objects.requireNonNull; 4 | 5 | import java.nio.file.Path; 6 | 7 | import com.salesforce.bazel.sdk.BazelVersion; 8 | 9 | /** 10 | * Record of a Bazel binary to use. 11 | */ 12 | public record BazelBinary(Path executable, BazelVersion bazelVersion) { 13 | 14 | public BazelBinary(Path executable, BazelVersion bazelVersion) { 15 | this.executable = requireNonNull(executable, "executable must not be null"); 16 | this.bazelVersion = requireNonNull(bazelVersion, "bazelVersion must not be null"); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/command/BazelCQueryCommand.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.sdk.command; 2 | 3 | import java.nio.file.Path; 4 | 5 | /** 6 | * bazel cquery 7 | *

8 | * Uses --query_file to avoid escaping issues with the query. 9 | *

10 | * 11 | * @param 12 | * the query output result 13 | */ 14 | public abstract class BazelCQueryCommand extends BazelQueryCommand { 15 | 16 | public BazelCQueryCommand(Path workspaceRoot, String query, boolean keepGoing, String purpose) { 17 | super(QueryCommand.cquery, workspaceRoot, query, keepGoing, purpose); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/command/BazelQueryForLabelsCommand.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.sdk.command; 2 | 3 | import static java.nio.file.Files.createTempFile; 4 | import static java.nio.file.Files.readAllLines; 5 | 6 | import java.io.IOException; 7 | import java.nio.file.Path; 8 | import java.util.Collection; 9 | import java.util.List; 10 | 11 | import com.salesforce.bazel.sdk.BazelVersion; 12 | 13 | /** 14 | * bazel query --output label 15 | */ 16 | public class BazelQueryForLabelsCommand extends BazelQueryCommand> { 17 | 18 | public BazelQueryForLabelsCommand(Path workspaceRoot, String query, boolean keepGoing, String purpose) { 19 | super(workspaceRoot, query, keepGoing, purpose); 20 | setCommandArgs("--output", "label"); 21 | } 22 | 23 | @Override 24 | protected Collection doGenerateResult() throws IOException { 25 | return readAllLines(getStdOutFile()); 26 | } 27 | 28 | @Override 29 | public List prepareCommandLine(BazelVersion bazelVersion) throws IOException { 30 | // redirect output to file for parsing 31 | var stdoutFile = createTempFile("bazel_query_stdout_", ".bin"); 32 | setRedirectStdOutToFile(stdoutFile); 33 | 34 | // prepare regular query command line 35 | return super.prepareCommandLine(bazelVersion); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/command/BazelQueryForPackagesCommand.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.sdk.command; 2 | 3 | import static java.nio.file.Files.createTempFile; 4 | import static java.nio.file.Files.readAllLines; 5 | 6 | import java.io.IOException; 7 | import java.nio.file.Path; 8 | import java.util.Collection; 9 | import java.util.List; 10 | 11 | import com.salesforce.bazel.sdk.BazelVersion; 12 | 13 | /** 14 | * bazel query --output package 15 | */ 16 | public class BazelQueryForPackagesCommand extends BazelQueryCommand> { 17 | 18 | public BazelQueryForPackagesCommand(Path workspaceRoot, String query, boolean keepGoing, String purpose) { 19 | super(workspaceRoot, query, keepGoing, purpose); 20 | setCommandArgs("--output", "package"); 21 | } 22 | 23 | @Override 24 | protected Collection doGenerateResult() throws IOException { 25 | return readAllLines(getStdOutFile()); 26 | } 27 | 28 | @Override 29 | public List prepareCommandLine(BazelVersion bazelVersion) throws IOException { 30 | // redirect output to file for parsing 31 | var stdoutFile = createTempFile("bazel_query_stdout_", ".bin"); 32 | setRedirectStdOutToFile(stdoutFile); 33 | 34 | // prepare regular query command line 35 | return super.prepareCommandLine(bazelVersion); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/command/querylight/Attribute.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2024 Salesforce and others. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License 2.0 6 | * which accompanies this distribution, and is available at 7 | * https://www.eclipse.org/legal/epl-2.0/ 8 | * 9 | * SPDX-License-Identifier: EPL-2.0 10 | * 11 | * Contributors: 12 | * Salesforce - adapted from M2E, JDT or other Eclipse project 13 | */ 14 | package com.salesforce.bazel.sdk.command.querylight; 15 | 16 | import java.util.List; 17 | 18 | import com.google.devtools.build.lib.query2.proto.proto2api.Build; 19 | import com.google.devtools.build.lib.query2.proto.proto2api.Build.Attribute.Discriminator; 20 | 21 | /** 22 | * Internal representation of a Bazel Attribute. Used to capture only required data to reduce memory footprint 23 | */ 24 | public record Attribute(String stringValue, List stringListValue, boolean booleanValue, Discriminator type) { 25 | 26 | Attribute(Build.Attribute from) { 27 | this(from.getStringValue(), from.getStringListValueList(), from.getBooleanValue(), from.getType()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/command/querylight/BazelRuleAttribute.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2024 Salesforce and others. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License 2.0 6 | * which accompanies this distribution, and is available at 7 | * https://www.eclipse.org/legal/epl-2.0/ 8 | * 9 | * SPDX-License-Identifier: EPL-2.0 10 | * 11 | * Contributors: 12 | * Salesforce - adapted from M2E, JDT or other Eclipse project 13 | */ 14 | package com.salesforce.bazel.sdk.command.querylight; 15 | 16 | import java.util.Arrays; 17 | import java.util.Set; 18 | import java.util.stream.Collectors; 19 | 20 | /** 21 | * Rule attribute names we depend on during sync 22 | */ 23 | public enum BazelRuleAttribute { 24 | 25 | SRCS("srcs"), 26 | EXPORTS("exports"), 27 | TEST_ONLY("testonly"), 28 | JAVAC_OPTS("javacopts"), 29 | RESOURCES("resources"), 30 | RESOURCES_STRIP_PREFIX("resource_strip_prefix"), 31 | STRIP_PREFIX("strip_prefix"), 32 | PLUGINS("plugins"), 33 | JARS("jars"), 34 | SRC_JAR("srcjar"), 35 | TAGS("tags"), 36 | NAME("name"), 37 | VISIBILITY("visibility"), 38 | PATH("path"), 39 | DEPS("deps"); 40 | 41 | public static final Set KNOWN_ATTRIBUTES = 42 | Arrays.stream(BazelRuleAttribute.values()).map(attr -> attr.key).collect(Collectors.toSet()); 43 | 44 | public final String key; 45 | 46 | BazelRuleAttribute(String key) { 47 | this.key = key; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/command/querylight/GeneratedFile.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2024 Salesforce and others. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License 2.0 6 | * which accompanies this distribution, and is available at 7 | * https://www.eclipse.org/legal/epl-2.0/ 8 | * 9 | * SPDX-License-Identifier: EPL-2.0 10 | * 11 | * Contributors: 12 | * Salesforce - adapted from M2E, JDT or other Eclipse project 13 | */ 14 | package com.salesforce.bazel.sdk.command.querylight; 15 | 16 | import com.google.devtools.build.lib.query2.proto.proto2api.Build; 17 | 18 | /** 19 | * Internal representation of a Bazel GeneratedFile. Used to capture only required data to reduce memory footprint 20 | */ 21 | public record GeneratedFile(String name, String generatingRule) { 22 | 23 | GeneratedFile(Build.GeneratedFile file) { 24 | this(file.getName(), file.getGeneratingRule()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/command/querylight/Target.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2024 Salesforce and others. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License 2.0 6 | * which accompanies this distribution, and is available at 7 | * https://www.eclipse.org/legal/epl-2.0/ 8 | * 9 | * SPDX-License-Identifier: EPL-2.0 10 | * 11 | * Contributors: 12 | * Salesforce - adapted from M2E, JDT or other Eclipse project 13 | */ 14 | package com.salesforce.bazel.sdk.command.querylight; 15 | 16 | import com.google.devtools.build.lib.query2.proto.proto2api.Build; 17 | 18 | /** 19 | * Internal representation of a Bazel target. Used to capture only required data to reduce memory footprint 20 | */ 21 | public record Target(Rule rule, GeneratedFile generatedFile) { 22 | public Target(Build.Target from) { 23 | this(new Rule(from.getRule()), from.hasGeneratedFile() ? new GeneratedFile(from.getGeneratedFile()) : null); 24 | } 25 | 26 | public boolean hasRule() { 27 | return rule != null; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/util/DurationUtil.java: -------------------------------------------------------------------------------- 1 | /*- 2 | * Copyright (c) 2024 Salesforce and others. 3 | * 4 | * All rights reserved. This program and the accompanying materials 5 | * are made available under the terms of the Eclipse Public License 2.0 6 | * which accompanies this distribution, and is available at 7 | * https://www.eclipse.org/legal/epl-2.0/ 8 | * 9 | * SPDX-License-Identifier: EPL-2.0 10 | * 11 | * Contributors: 12 | * Salesforce - adapted from M2E, JDT or other Eclipse project 13 | */ 14 | package com.salesforce.bazel.sdk.util; 15 | 16 | import java.time.Duration; 17 | import java.time.temporal.ChronoUnit; 18 | 19 | /** 20 | * Utility for {@link Duration} 21 | */ 22 | public class DurationUtil { 23 | 24 | public static String humanReadableFormat(Duration duration) { 25 | return duration.truncatedTo(ChronoUnit.MILLIS) 26 | .toString() 27 | .substring(2) 28 | .replaceAll("(\\d[HMS])(?!$)", "$1 ") 29 | .toLowerCase(); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /bundles/com.salesforce.bazel.sdk/src/com/salesforce/bazel/sdk/util/SystemUtil.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.sdk.util; 2 | 3 | /** 4 | * A utility for system level items. 5 | */ 6 | public class SystemUtil { 7 | 8 | private static final SystemUtil instance = new SystemUtil(); 9 | 10 | public static final SystemUtil getInstance() { 11 | return instance; 12 | } 13 | 14 | public String getOs() { 15 | return System.getProperty("os.name").toLowerCase(); 16 | } 17 | 18 | public boolean isMac() { 19 | return getOs().indexOf("mac") >= 0; 20 | } 21 | 22 | public boolean isUnix() { 23 | var os = getOs(); 24 | return (os.indexOf("nix") >= 0) || (os.indexOf("nux") >= 0) || (os.indexOf("aix") > 0); 25 | } 26 | 27 | public boolean isWindows() { 28 | return getOs().indexOf("win") >= 0; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /bundles/testdata/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /bundles/testdata/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | testdata 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /bundles/testdata/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /bundles/testdata/.settings/org.eclipse.core.runtime.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | line.separator=\n 3 | -------------------------------------------------------------------------------- /bundles/testdata/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | resolve.requirebundle=false 3 | -------------------------------------------------------------------------------- /bundles/testdata/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Bazel Eclipe Test Data Plug-in (only for testing, never deploy!!!) 4 | Bundle-SymbolicName: testdata 5 | Bundle-Version: 1.0.0.qualifier 6 | Bundle-Vendor: Bazel Eclipse Feature 7 | Automatic-Module-Name: testdata 8 | Bundle-RequiredExecutionEnvironment: JavaSE-21 9 | Eclipse-BundleShape: dir 10 | Export-Package: testdata;x-friends:="com.salesforce.bazel.eclipse.core.tests,com.salesforce.bazel.eclipse.jdtls.tests,com.salesforce.bazel.eclipse.ui.tests", 11 | testdata.utils 12 | Import-Package: org.hamcrest;version="2.2.0", 13 | org.hamcrest.collection;version="2.2.0", 14 | org.junit.jupiter.api;version="5.9.2", 15 | org.junit.jupiter.api.extension;version="5.9.2", 16 | org.junit.jupiter.api.io;version="5.9.2", 17 | org.slf4j;version="1.7.30" 18 | Require-Bundle: org.eclipse.core.runtime;bundle-version="3.26.100", 19 | org.eclipse.core.resources;bundle-version="3.18.200", 20 | com.salesforce.bazel.sdk;bundle-version="2.0.0", 21 | com.salesforce.bazel.eclipse.core;bundle-version="2.0.0" 22 | -------------------------------------------------------------------------------- /bundles/testdata/README.md: -------------------------------------------------------------------------------- 1 | # Test Data 2 | 3 | Special bundle to be used by tests. 4 | The bundle contains test workspaces and API to provision them. 5 | It's intended to be used by tests. 6 | -------------------------------------------------------------------------------- /bundles/testdata/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | .,\ 5 | workspaces/ 6 | additional.bundles = junit-jupiter-api,\ 7 | org.hamcrest 8 | -------------------------------------------------------------------------------- /bundles/testdata/src/testdata/SharedTestData.java: -------------------------------------------------------------------------------- 1 | package testdata; 2 | 3 | import org.eclipse.core.runtime.IPath; 4 | import org.eclipse.core.runtime.Path; 5 | 6 | /** 7 | * Convenience access to shared test data 8 | */ 9 | public interface SharedTestData { 10 | 11 | String WORKSPACE_001 = "/workspaces/001"; 12 | 13 | IPath BAZELPROJECT_FILE = new Path(".bazelproject"); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /bundles/testdata/workspaces/001/.bazelproject: -------------------------------------------------------------------------------- 1 | # The project view file (.bazelproject) is used to import targets into the IDE. 2 | # 3 | # See: https://ij.bazel.build/docs/project-views.html 4 | # 5 | # This files provides a default experience for developers working with the project 6 | 7 | 8 | directories: 9 | . 10 | module1 11 | module2 12 | module3 13 | -not_visible 14 | 15 | derive_targets_from_directories: true 16 | 17 | java_language_level: 11 18 | -------------------------------------------------------------------------------- /bundles/testdata/workspaces/001/.gitignore: -------------------------------------------------------------------------------- 1 | # Eclipse metadata 2 | .classpath 3 | .project 4 | .settings/ 5 | .eclipse/ 6 | 7 | # Bazel folder 8 | /bazel-* 9 | 10 | # ignore the Bazel version file 11 | .bazelversion 12 | -------------------------------------------------------------------------------- /bundles/testdata/workspaces/001/WORKSPACE: -------------------------------------------------------------------------------- 1 | workspace(name = "testdata_workspaces_001") 2 | 3 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 4 | 5 | # bazel-skylib 0.8.0 released 2019.03.20 (https://github.com/bazelbuild/bazel-skylib/releases/tag/0.8.0) 6 | skylib_version = "0.8.0" 7 | http_archive( 8 | name = "bazel_skylib", 9 | type = "tar.gz", 10 | url = "https://github.com/bazelbuild/bazel-skylib/releases/download/{}/bazel-skylib.{}.tar.gz".format (skylib_version, skylib_version), 11 | sha256 = "2ef429f5d7ce7111263289644d233707dba35e39696377ebab8b0bc701f7818e", 12 | ) 13 | 14 | # check minimum Bazel version 15 | load("@bazel_skylib//lib:versions.bzl", "versions") 16 | versions.check(minimum_bazel_version= "5.0.0") 17 | 18 | http_archive( 19 | name = "salesforce_rules_mybuilder", 20 | url = "https://github.com/salesforce/bazel-java-builder-template/archive/c443e2391ff547c01f5ca3f14a1e84d85c13d16d.zip", 21 | strip_prefix = "bazel-java-builder-template-c443e2391ff547c01f5ca3f14a1e84d85c13d16d", 22 | sha256 = "8e0aac87c235744884161e69346d6a6d3d729ef8072e33a9883fbb27735d01d8", 23 | ) 24 | 25 | load("@salesforce_rules_mybuilder//mybuilder:repositories.bzl", "rules_mybuilder_dependencies", "rules_mybuilder_toolchains") 26 | rules_mybuilder_dependencies() 27 | rules_mybuilder_toolchains() 28 | 29 | # Maven dependencies 30 | load("//third_party/maven:dependencies.bzl", "maven_dependencies") 31 | maven_dependencies() 32 | -------------------------------------------------------------------------------- /bundles/testdata/workspaces/001/module1/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_java//java:defs.bzl", "java_binary") 2 | load("@salesforce_rules_mybuilder//mybuilder:defs.bzl", "mybuilder_gen_java_library") 3 | 4 | filegroup( 5 | name = "mybuilder_input", 6 | srcs = glob( 7 | [ 8 | "java/resources/**/*.txt", 9 | ], 10 | ), 11 | ) 12 | 13 | filegroup( 14 | name = "module1_sources", 15 | srcs = glob( 16 | [ 17 | "java/src/**/*.java", 18 | ], 19 | ), 20 | ) 21 | 22 | mybuilder_gen_java_library( 23 | name = "mybuilder_sources", 24 | srcs = [":mybuilder_input"], 25 | ) 26 | 27 | 28 | java_binary( 29 | name = "module1", 30 | srcs = [ 31 | "module1_sources", 32 | ], 33 | resources = [":mybuilder_input"], 34 | deps = [ 35 | "//module2", 36 | "//module3", 37 | "@com_google_guava//jar", 38 | "mybuilder_sources", 39 | ], 40 | main_class = "hello.Hello", 41 | ) 42 | -------------------------------------------------------------------------------- /bundles/testdata/workspaces/001/module1/java/resources/hello.txt: -------------------------------------------------------------------------------- 1 | Hi there! -------------------------------------------------------------------------------- /bundles/testdata/workspaces/001/module1/java/src/hello/Hello.java: -------------------------------------------------------------------------------- 1 | package hello; 2 | 3 | import library.Greeting; 4 | 5 | import log.Logger; 6 | 7 | import java.util.List; 8 | 9 | import com.google.common.collect.Lists; 10 | import com.google.common.collect.Iterables; 11 | 12 | 13 | 14 | public class Hello { 15 | 16 | 17 | public static void main(String[] args) { 18 | Logger.logDebug("Hello.main"); 19 | 20 | Greeting greeter = new Greeting(); 21 | System.out.println(new mybuilder_sources.MybuilderSources()); 22 | 23 | List modules = Lists.newArrayList("module1", "module2"); 24 | 25 | Iterable result = Iterables.transform(modules, greeter::greet); 26 | 27 | result.forEach(System.out::println); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /bundles/testdata/workspaces/001/module2/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_java//java:defs.bzl", "java_library") 2 | 3 | java_library ( 4 | name = "module2", 5 | srcs = glob(["java/src/**/*.java"]), 6 | visibility = ["//module1:__pkg__"], 7 | deps = [ 8 | "//module3", 9 | "@org_apache_commons_commons_lang3" 10 | ] 11 | ) 12 | 13 | java_test( 14 | name = "module2-test", 15 | srcs = ["java/test/library/GreetingTest.java"], 16 | test_class = "library.GreetingTest", 17 | deps = [ 18 | "module2", 19 | "@junit//jar", 20 | ], 21 | ) 22 | -------------------------------------------------------------------------------- /bundles/testdata/workspaces/001/module2/java/src/library/Greeting.java: -------------------------------------------------------------------------------- 1 | package library; 2 | 3 | import log.Logger; 4 | 5 | public class Greeting { 6 | 7 | public String greet(String name) { 8 | Logger.logDebug("Greeting.greet"); 9 | return "Hello ".concat(name); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /bundles/testdata/workspaces/001/module2/java/test/library/GreetingTest.java: -------------------------------------------------------------------------------- 1 | package library; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | public class GreetingTest { 7 | @Test 8 | public void testGreet() { 9 | Assert.assertEquals("Hello JUnit", new Greeting().greet("JUnit")); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /bundles/testdata/workspaces/001/module3/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_java//java:defs.bzl", "java_library") 2 | 3 | java_library ( 4 | name = "module3", 5 | srcs = glob(["java/src/**/*.java"]), 6 | visibility = ["//module1:__pkg__", "//module2:__pkg__"] 7 | ) 8 | -------------------------------------------------------------------------------- /bundles/testdata/workspaces/001/module3/java/src/log/Logger.java: -------------------------------------------------------------------------------- 1 | package log; 2 | 3 | import java.time.Instant; 4 | 5 | public final class Logger { 6 | 7 | private Logger() { 8 | throw new RuntimeException(); 9 | } 10 | 11 | public static void logDebug(String message) { 12 | String output = String.format("[DEBUG] %s", message); 13 | System.out.println(output); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /bundles/testdata/workspaces/001/not_visible/this_should_not_be_seen_in_Eclipse.txt: -------------------------------------------------------------------------------- 1 | The project view is configured to exclude this folder. -------------------------------------------------------------------------------- /bundles/testdata/workspaces/001/third_party/maven/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/bundles/testdata/workspaces/001/third_party/maven/BUILD -------------------------------------------------------------------------------- /bundles/testdata/workspaces/001/third_party/maven/dependencies.bzl: -------------------------------------------------------------------------------- 1 | load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external") 2 | 3 | def maven_dependencies( 4 | maven_servers = ["https://repo1.maven.org/maven2/"]): 5 | 6 | jvm_maven_import_external( 7 | name = "com_google_guava", 8 | artifact = "com.google.guava:guava:28.2-jre", 9 | artifact_sha256 = "fc3aa363ad87223d1fbea584eee015a862150f6d34c71f24dc74088a635f08ef", 10 | fetch_sources = True, 11 | licenses = ["notice"], 12 | server_urls = maven_servers, 13 | ) 14 | 15 | jvm_maven_import_external( 16 | name = "junit", 17 | artifact = "junit:junit:4.13", 18 | artifact_sha256 = "4b8532f63bdc0e0661507f947eb324a954d1dbac631ad19c8aa9a00feed1d863", 19 | fetch_sources = True, 20 | licenses = ["notice"], 21 | server_urls = maven_servers, 22 | ) 23 | 24 | jvm_maven_import_external( 25 | name = "org_apache_commons_commons_lang3", 26 | artifact = "org.apache.commons:commons-lang3:jar:3.12.0", 27 | artifact_sha256 = "d919d904486c037f8d193412da0c92e22a9fa24230b9d67a57855c5c31c7e94e", 28 | fetch_sources = True, 29 | licenses = ["notice"], 30 | server_urls = maven_servers, 31 | ) -------------------------------------------------------------------------------- /docs/bef/README.md: -------------------------------------------------------------------------------- 1 | ## Bazel Eclipse Feature ![BEF Logo](../logos/bef_logo_small.png) 2 | 3 | ## Using the Bazel Eclipse Feature 4 | 5 | ### Supported Environments 6 | 7 | BEF is supported on Linux and Macos. 8 | Windows is not guaranteed. 9 | Please contribute PRs (bug fixes) for Windows. 10 | 11 | 12 | ### Installation and User's Guides 13 | 14 | For detailed manual installation and setup instructions, and the User's Guide, see these pages: 15 | 16 | - [Installing Eclipse and the Bazel Eclipse Feature](install.md) 17 | - [Bazel Eclipse Feature User's Guide](using_the_feature.md) 18 | 19 | ![BEF Screen Shot](bef_fullimage.png) 20 | 21 | 22 | ## History and Credit 23 | 24 | Full history and credit is explained in the [history and credit document](history.md). 25 | 26 | 27 | ## Developing BEF 28 | 29 | For developers that want to contribute to BEF: 30 | - [Contribution Guide](../../CONTRIBUTING.md) 31 | 32 | -------------------------------------------------------------------------------- /docs/bef/bazel_eclipse_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/docs/bef/bazel_eclipse_icon.png -------------------------------------------------------------------------------- /docs/bef/bef_fullimage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/docs/bef/bef_fullimage.png -------------------------------------------------------------------------------- /docs/bef/import_wizard_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/docs/bef/import_wizard_1.png -------------------------------------------------------------------------------- /docs/bef/import_wizard_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/docs/bef/import_wizard_2.png -------------------------------------------------------------------------------- /docs/bef/using_the_feature.md: -------------------------------------------------------------------------------- 1 | ## Bazel Eclipse Feature Users Guide ![BEF Logo](../logos/bef_logo_small.png) 2 | 3 | This page provides links to documentation on how to use the Bazel Eclipse Feature. 4 | All of them assume you have already [installed your toolchain](install.md). 5 | 6 | **Using the Bazel Eclipse Feature:** 7 | 8 | - [Import your Bazel workspace into the IDE](import_workspace.md) 9 | - [Sync and Building your project](sync_and_build.md) 10 | - [Understanding the Java Classpath with the Bazel Eclipse Feature](../common/classpath.md) 11 | 12 | **Modifying the Bazel Eclipse Feature** 13 | 14 | Once you are comfortable with using the feature, you may want to contribute to it. 15 | If so, please see our [Contribution Guide](../../CONTRIBUTING.md) for instructions. 16 | 17 | 18 | **Issues** 19 | 20 | If you have any problems using BEF, please review these pages: 21 | 22 | - [BEF Issues on GitHub](https://github.com/salesforce/bazel-eclipse/issues) 23 | 24 | If you don't see your issue listed, please file a new Issue on GitHub and we will try to help. 25 | -------------------------------------------------------------------------------- /docs/bjls/README.md: -------------------------------------------------------------------------------- 1 | # Bazel Java Language Server 2 | 3 | This is the home of the Language Server project docs. 4 | 5 | There is a BazelCon presentation you can watch that covers the ideas. 6 | Start at the 12 minute mark to see the Language Server portion of the talk: 7 | - [Eclipse and VS Code IDE Support for Java packages in Bazel](https://www.youtube.com/watch?v=oLnfv2-aGwk) 8 | 9 | 10 | ## Architecture & Features 11 | 12 | The Bazel Java Language Server (BJLS) is a plug-in for Eclipse, which extends the [Eclipse Java Language Server](https://github.com/eclipse/eclipse.jdt.ls) with project import and classpath resolution capabilities for Bazel workspaces. 13 | 14 | For more details about the supported Java features please see: 15 | - [Eclipse Java Language Server](https://github.com/redhat-developer/vscode-java) 16 | - [Language support for Java for Visual Studio Code](https://github.com/eclipse/eclipse.jdt.ls) 17 | 18 | ## VS Code Support 19 | 20 | You **cannot** *install* the BJLS into VS Code. 21 | You have to install an extension for your editor/IDE bundling it. 22 | 23 | We are working on integrating it directly into [Language support for Java for Visual Studio Code](https://github.com/eclipse/eclipse.jdt.ls). 24 | Until then please use [Bazel support for Java for Visual Studio Code](https://github.com/salesforce/bazel-vscode-java). 25 | -------------------------------------------------------------------------------- /docs/dev/BEF_Arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/docs/dev/BEF_Arch.png -------------------------------------------------------------------------------- /docs/dev/release.md: -------------------------------------------------------------------------------- 1 | ## Releasing Bazel Eclipse 2 | 3 | This document is for maintainers. 4 | This is the set of steps for releasing a new version of BEF. 5 | 6 | Currently a CD workflow exists which publishes the latest repository automatically. 7 | 8 | TODO: add workflow when a tag is pushed to publish a GitHub release as well as update site 9 | -------------------------------------------------------------------------------- /docs/logos/README.md: -------------------------------------------------------------------------------- 1 | ## BEF Logos 2 | 3 | These logos were created by VJ Abraham, and reflect the identity of BEF as the merger of 4 | the Eclipse IDE and Bazel. 5 | He used a combination of the color schemes from both projects, and design elements of each logo. 6 | 7 | Thank you VJ! 8 | -------------------------------------------------------------------------------- /docs/logos/bef_developers_full.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/docs/logos/bef_developers_full.jpg -------------------------------------------------------------------------------- /docs/logos/bef_developers_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/docs/logos/bef_developers_full.png -------------------------------------------------------------------------------- /docs/logos/bef_developers_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/docs/logos/bef_developers_small.png -------------------------------------------------------------------------------- /docs/logos/bef_logo_full.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/docs/logos/bef_logo_full.jpg -------------------------------------------------------------------------------- /docs/logos/bef_logo_full.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/docs/logos/bef_logo_full.png -------------------------------------------------------------------------------- /docs/logos/bef_logo_marketplace.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/docs/logos/bef_logo_marketplace.jpg -------------------------------------------------------------------------------- /docs/logos/bef_logo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/docs/logos/bef_logo_small.png -------------------------------------------------------------------------------- /docs/logos/bjls_logo_full.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/docs/logos/bjls_logo_full.jpg -------------------------------------------------------------------------------- /docs/logos/bjls_logo_small.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/docs/logos/bjls_logo_small.jpeg -------------------------------------------------------------------------------- /features/com.salesforce.bazel.eclipse.feature/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.salesforce.bazel.eclipse.feature 4 | 5 | 6 | bazel-java-sdk 7 | plugin-deps 8 | plugin-testdeps 9 | 10 | 11 | 12 | org.eclipse.pde.FeatureBuilder 13 | 14 | 15 | 16 | 17 | org.eclipse.pde.UpdateSiteBuilder 18 | 19 | 20 | 21 | 22 | 23 | org.eclipse.pde.FeatureNature 24 | org.eclipse.pde.UpdateSiteNature 25 | 26 | 27 | -------------------------------------------------------------------------------- /features/com.salesforce.bazel.eclipse.feature/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /features/com.salesforce.bazel.eclipse.feature/.settings/org.eclipse.core.runtime.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | line.separator=\n 3 | -------------------------------------------------------------------------------- /features/com.salesforce.bazel.eclipse.feature/README.md: -------------------------------------------------------------------------------- 1 | ## Bazel Eclipse Feature 2 | 3 | This is the logical container of all the plugins related to the Bazel integration with Eclipse. 4 | In Eclipse, such a container is known as a *feature*. 5 | See the [architecture document](../../docs/dev/architecture.md) for more information about features. 6 | 7 | ### Static Files 8 | 9 | This packages contains a number of static files that are used by the Eclipse SDK to manage the feature. 10 | 11 | - [feature.xml](feature.xml) 12 | - [build.properties](build.properties) 13 | 14 | As you develop the Bazel Eclipse Feature, you may need to update these files. 15 | Make sure to commit them back to the Git repo. 16 | -------------------------------------------------------------------------------- /features/com.salesforce.bazel.eclipse.feature/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = feature.xml,\ 2 | build.properties,\ 3 | p2.inf 4 | src.includes = feature.xml,\ 5 | build.properties,\ 6 | .project 7 | -------------------------------------------------------------------------------- /features/com.salesforce.bazel.eclipse.feature/p2.inf: -------------------------------------------------------------------------------- 1 | #The purpose of the following advices is to configure ch.qos.logback.classic as auto-started with start-level 2 when installing this feature 2 | #Create a requirement on the fragment we are creating 3 | requires.0.namespace=org.eclipse.equinox.p2.iu 4 | requires.0.name=configure.logback.classic 5 | requires.0.range=[$version$,$version$] 6 | requires.0.greedy=true 7 | 8 | #Create a IU fragment named configure.logback.classic 9 | units.0.id=configure.logback.classic 10 | units.0.version=$version$ 11 | units.0.provides.0.namespace=org.eclipse.equinox.p2.iu 12 | units.0.provides.0.name=configure.logback.classic 13 | units.0.provides.0.version=$version$ 14 | units.0.instructions.install=org.eclipse.equinox.p2.touchpoint.eclipse.installBundle(bundle:${artifact}); 15 | units.0.instructions.uninstall=org.eclipse.equinox.p2.touchpoint.eclipse.uninstallBundle(bundle:${artifact}); 16 | units.0.instructions.configure= \ 17 | org.eclipse.equinox.p2.touchpoint.eclipse.setStartLevel(startLevel:2); \ 18 | org.eclipse.equinox.p2.touchpoint.eclipse.markStarted(started:true); 19 | units.0.instructions.unconfigure= \ 20 | org.eclipse.equinox.p2.touchpoint.eclipse.setStartLevel(startLevel:-1); \ 21 | org.eclipse.equinox.p2.touchpoint.eclipse.markStarted(started:false); 22 | units.0.hostRequirements.0.namespace=osgi.bundle 23 | units.0.hostRequirements.0.name=ch.qos.logback.classic 24 | units.0.hostRequirements.0.range=[1.3,2) 25 | units.0.hostRequirements.0.greedy=false 26 | -------------------------------------------------------------------------------- /features/com.salesforce.bazel.eclipse.jdtls.feature/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.salesforce.bazel.eclipse.jdtls.feature 4 | 5 | 6 | bazel-java-sdk 7 | plugin-deps 8 | plugin-testdeps 9 | 10 | 11 | 12 | org.eclipse.pde.FeatureBuilder 13 | 14 | 15 | 16 | 17 | org.eclipse.pde.UpdateSiteBuilder 18 | 19 | 20 | 21 | 22 | 23 | org.eclipse.pde.FeatureNature 24 | org.eclipse.pde.UpdateSiteNature 25 | 26 | 27 | -------------------------------------------------------------------------------- /features/com.salesforce.bazel.eclipse.jdtls.feature/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /features/com.salesforce.bazel.eclipse.jdtls.feature/.settings/org.eclipse.core.runtime.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | line.separator=\n 3 | -------------------------------------------------------------------------------- /features/com.salesforce.bazel.eclipse.jdtls.feature/README.md: -------------------------------------------------------------------------------- 1 | ## Bazel JDT LS Eclipse Feature 2 | 3 | This is the logical container of all the plugins related to the Bazel integration with Eclipse. 4 | In Eclipse, such a container is known as a *feature*. 5 | See the [architecture document](../../docs/dev/architecture.md) for more information about features. 6 | 7 | ### Static Files 8 | 9 | This packages contains a number of static files that are used by the Eclipse SDK to manage the feature. 10 | 11 | - [feature.xml](feature.xml) 12 | - [build.properties](build.properties) 13 | 14 | As you develop the Bazel Eclipse Feature, you may need to update these files. 15 | Make sure to commit them back to the Git repo. 16 | -------------------------------------------------------------------------------- /features/com.salesforce.bazel.eclipse.jdtls.feature/build.properties: -------------------------------------------------------------------------------- 1 | bin.includes = feature.xml,\ 2 | build.properties 3 | src.includes = feature.xml,\ 4 | build.properties,\ 5 | .project 6 | -------------------------------------------------------------------------------- /javaConfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "projects": [ 3 | "bundles/com.salesforce.bazel.eclipse.core", 4 | "bundles/com.salesforce.bazel.eclipse.jdtls", 5 | "bundles/com.salesforce.bazel.eclipse.ui", 6 | "bundles/com.salesforce.bazel.importedsource", 7 | "bundles/com.salesforce.bazel.logback", 8 | "bundles/com.salesforce.bazel.sdk" 9 | ], 10 | 11 | "targetPlatform": "releng/target-platform/target-platform-dev.target" 12 | } 13 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 4.0.0 6 | 7 | 8 | com.salesforce.bazel.eclipse.feature.releng 9 | bazel-eclipse-feature-maven-parent 10 | 14 | 2.0.0-SNAPSHOT 15 | releng/mavenparent 16 | 17 | 18 | bazel-eclipse-plugins 19 | pom 20 | 21 | 22 | bundles 23 | tests 24 | features 25 | 26 | releng 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /releng/p2repository/category.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | Bazel Eclipse Feature provides support for the Bazel build system in Eclipse. https://github.com/salesforce/bazel-eclipse 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.core.tests/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.core.tests/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.salesforce.bazel.eclipse.core.tests 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.core.tests/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.core.tests/.settings/org.eclipse.core.runtime.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | line.separator=\n 3 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.core.tests/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | resolve.requirebundle=false 3 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.core.tests/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Bazel Eclipse Feature Core Plug-In Tests 4 | Bundle-SymbolicName: com.salesforce.bazel.eclipse.core.tests 5 | Bundle-Version: 2.0.0.qualifier 6 | Bundle-Vendor: Bazel Eclipse Feature 7 | Fragment-Host: com.salesforce.bazel.eclipse.core;bundle-version="2.0.0" 8 | Automatic-Module-Name: com.salesforce.bazel.eclipse.core.tests 9 | Bundle-RequiredExecutionEnvironment: JavaSE-21 10 | Import-Package: org.hamcrest;version="2.2.0", 11 | org.hamcrest.collection;version="2.2.0", 12 | org.junit.jupiter.api;version="5.9.2", 13 | org.junit.jupiter.api.extension;version="5.9.2", 14 | org.junit.jupiter.api.io;version="5.9.2" 15 | Require-Bundle: testdata;bundle-version="1.0.0", 16 | com.salesforce.bazel.sdk 17 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.core.tests/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | . 5 | additional.bundles = org.mockito.mockito-core,\ 6 | junit-jupiter-api,\ 7 | junit-jupiter-params,\ 8 | org.hamcrest 9 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.core.tests/src/com/salesforce/bazel/eclipse/core/extensions/TestCommand.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.core.extensions; 2 | 3 | import static org.junit.jupiter.api.Assertions.fail; 4 | 5 | import java.io.IOException; 6 | import java.nio.file.Path; 7 | 8 | import com.salesforce.bazel.sdk.command.BazelCommand; 9 | 10 | /** 11 | * A command to be used by testing an executor. 12 | */ 13 | class TestCommand extends BazelCommand { 14 | public TestCommand() { 15 | this(Path.of(System.getProperty("user.home"))); 16 | } 17 | 18 | public TestCommand(Path workingDirectory, String... commandArgs) { 19 | super("dummy", workingDirectory, "test command"); 20 | setCommandArgs(commandArgs); 21 | } 22 | 23 | @Override 24 | protected Integer doGenerateResult() throws IOException { 25 | fail("This should never be called!"); 26 | return null; 27 | } 28 | 29 | @Override 30 | public Integer generateResult(int exitCode) throws IOException { 31 | return exitCode; 32 | } 33 | 34 | @Override 35 | public void setRedirectStdOutToFile(Path stdOutFile) { 36 | super.setRedirectStdOutToFile(stdOutFile); 37 | } 38 | } -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.core.tests/src/com/salesforce/bazel/eclipse/core/model/BazelModelTest.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.core.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotSame; 5 | 6 | import org.junit.jupiter.api.Test; 7 | 8 | public class BazelModelTest { 9 | 10 | @Test 11 | void equals_and_hashCode() throws Exception { 12 | var m1 = new BazelModel(null); 13 | var m2 = new BazelModel(null); 14 | 15 | assertEquals(m1, m2); 16 | assertEquals(m2, m1); 17 | 18 | assertEquals(m1.hashCode(), m2.hashCode()); 19 | assertEquals(m2.hashCode(), m1.hashCode()); 20 | 21 | assertEquals(m1.hashCode(), BazelModel.class.hashCode()); 22 | 23 | assertNotSame(m1, m2); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.core.tests/src/com/salesforce/bazel/eclipse/core/model/BazelWorkspaceTest.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.core.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertEquals; 4 | import static org.junit.jupiter.api.Assertions.assertNotEquals; 5 | import static org.junit.jupiter.api.Assertions.assertNotSame; 6 | 7 | import org.eclipse.core.runtime.Path; 8 | import org.junit.jupiter.api.Test; 9 | 10 | public class BazelWorkspaceTest { 11 | 12 | @Test 13 | void equals_and_hashCode() throws Exception { 14 | var m = new BazelModel(null); 15 | 16 | var r1 = new Path("/root1"); 17 | var r2 = new Path("/root2"); 18 | 19 | var w_r1 = new BazelWorkspace(r1, m); 20 | var w_r2 = new BazelWorkspace(r2, m); 21 | 22 | assertEquals(w_r1, new BazelWorkspace(r1, m)); 23 | assertEquals(w_r2, new BazelWorkspace(r2, m)); 24 | 25 | assertEquals(w_r1.hashCode(), new BazelWorkspace(r1, m).hashCode()); 26 | assertEquals(w_r2.hashCode(), new BazelWorkspace(r2, m).hashCode()); 27 | 28 | assertNotSame(w_r1, new BazelWorkspace(r1, m)); 29 | assertNotSame(w_r2, new BazelWorkspace(r2, m)); 30 | 31 | assertNotEquals(w_r1, w_r2); 32 | assertNotEquals(w_r1.hashCode(), w_r2.hashCode()); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.salesforce.bazel.eclipse.jdtls.tests 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/.settings/org.eclipse.core.runtime.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | line.separator=\n 3 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | resolve.requirebundle=false 3 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Automatic-Module-Name: com.salesforce.bazel.eclipse.jdtls.tests 4 | Bundle-Name: Bazel Java Lanaguage Server Plug-In Tests 5 | Bundle-SymbolicName: com.salesforce.bazel.eclipse.jdtls.tests;singleton:=true 6 | Bundle-Version: 2.0.0.qualifier 7 | Fragment-Host: com.salesforce.bazel.eclipse.jdtls;bundle-version="2.0.0" 8 | Bundle-Vendor: Bazel Eclipse Feature 9 | Bundle-RequiredExecutionEnvironment: JavaSE-21 10 | Import-Package: org.hamcrest;version="2.2.0", 11 | org.hamcrest.collection;version="2.2.0", 12 | org.junit.jupiter.api;version="5.9.2", 13 | org.junit.jupiter.api.extension;version="5.9.2", 14 | org.junit.jupiter.api.io;version="5.9.2" 15 | Require-Bundle: testdata;bundle-version="1.0.0" 16 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/main/java/ 2 | output.. = target/classes/ 3 | bin.includes = .,\ 4 | META-INF/,\ 5 | plugin.xml 6 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/plugin.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/.gitignore: -------------------------------------------------------------------------------- 1 | # Bazel build result 2 | **/bazel-* 3 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/bazel-ls-demo-project/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/bazel-ls-demo-project/BUILD -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/bazel-ls-demo-project/WORKSPACE: -------------------------------------------------------------------------------- 1 | workspace(name = "bazel_ls_demo_project") 2 | 3 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") 4 | 5 | # bazel-skylib 0.8.0 released 2019.03.20 (https://github.com/bazelbuild/bazel-skylib/releases/tag/0.8.0) 6 | skylib_version = "0.8.0" 7 | http_archive( 8 | name = "bazel_skylib", 9 | type = "tar.gz", 10 | url = "https://github.com/bazelbuild/bazel-skylib/releases/download/{}/bazel-skylib.{}.tar.gz".format (skylib_version, skylib_version), 11 | sha256 = "2ef429f5d7ce7111263289644d233707dba35e39696377ebab8b0bc701f7818e", 12 | ) 13 | 14 | # check minimum Bazel version 15 | load("@bazel_skylib//lib:versions.bzl", "versions") 16 | versions.check(minimum_bazel_version= "2.0.0") 17 | 18 | http_archive( 19 | name = "salesforce_rules_mybuilder", 20 | url = "https://github.com/salesforce/bazel-java-builder-template/archive/6d7cc260d50225432758d88bea9d7dd332f89352.zip", 21 | strip_prefix = "bazel-java-builder-template-6d7cc260d50225432758d88bea9d7dd332f89352" 22 | ) 23 | 24 | load("@salesforce_rules_mybuilder//mybuilder:repositories.bzl", "rules_mybuilder_dependencies", "rules_mybuilder_toolchains") 25 | rules_mybuilder_dependencies() 26 | rules_mybuilder_toolchains() 27 | 28 | # Maven dependencies 29 | load("//third_party/maven:dependencies.bzl", "maven_dependencies") 30 | maven_dependencies() 31 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/bazel-ls-demo-project/module1/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_java//java:defs.bzl", "java_binary") 2 | load("@salesforce_rules_mybuilder//mybuilder:defs.bzl", "mybuilder_gen_java_library") 3 | 4 | filegroup( 5 | name = "mybuilder_input", 6 | srcs = glob( 7 | [ 8 | "java/resources/**/*.txt", 9 | ], 10 | ), 11 | ) 12 | 13 | filegroup( 14 | name = "module1_sources", 15 | srcs = glob( 16 | [ 17 | "java/src/**/*.java", 18 | ], 19 | ), 20 | ) 21 | 22 | mybuilder_gen_java_library( 23 | name = "mybuilder_sources", 24 | srcs = [":mybuilder_input"], 25 | ) 26 | 27 | 28 | java_binary( 29 | name = "module1", 30 | srcs = [ 31 | "module1_sources", 32 | ], 33 | resources = [":mybuilder_input"], 34 | deps = [ 35 | "//module2", 36 | "//module3", 37 | "@com_google_guava//jar", 38 | "mybuilder_sources", 39 | ], 40 | main_class = "hello.Hello", 41 | ) 42 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/bazel-ls-demo-project/module1/java/resources/hello.txt: -------------------------------------------------------------------------------- 1 | Hi there! -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/bazel-ls-demo-project/module1/java/src/hello/Hello.java: -------------------------------------------------------------------------------- 1 | package hello; 2 | 3 | import library.Greeting; 4 | 5 | import log.Logger; 6 | 7 | import java.util.List; 8 | 9 | import com.google.common.collect.Lists; 10 | import com.google.common.collect.Iterables; 11 | 12 | 13 | 14 | public class Hello { 15 | 16 | 17 | public static void main(String[] args) { 18 | Logger.logDebug("Hello.main"); 19 | 20 | Greeting greeter = new Greeting(); 21 | System.out.println(new mybuilder_sources.MybuilderSources()); 22 | 23 | List modules = Lists.newArrayList("module1", "module2"); 24 | 25 | Iterable result = Iterables.transform(modules, greeter::greet); 26 | 27 | result.forEach(System.out::println); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/bazel-ls-demo-project/module2/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_java//java:defs.bzl", "java_library") 2 | 3 | java_library ( 4 | name = "module2", 5 | srcs = glob(["java/src/**/*.java"]), 6 | visibility = ["//module1:__pkg__"], 7 | deps = ["//module3"] 8 | ) 9 | 10 | java_test( 11 | name = "module2-test", 12 | srcs = ["java/test/library/GreetingTest.java"], 13 | test_class = "library.GreetingTest", 14 | deps = [ 15 | "module2", 16 | "@junit//jar", 17 | ], 18 | ) 19 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/bazel-ls-demo-project/module2/java/src/library/Greeting.java: -------------------------------------------------------------------------------- 1 | package library; 2 | 3 | import log.Logger; 4 | 5 | public class Greeting { 6 | 7 | public String greet(String name) { 8 | Logger.logDebug("Greeting.greet"); 9 | return "Hello ".concat(name); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/bazel-ls-demo-project/module2/java/test/library/GreetingTest.java: -------------------------------------------------------------------------------- 1 | package library; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | public class GreetingTest { 7 | @Test 8 | public void testGreet() { 9 | Assert.assertEquals("Hello JUnit", new Greeting().greet("JUnit")); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/bazel-ls-demo-project/module3/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_java//java:defs.bzl", "java_library") 2 | 3 | java_library ( 4 | name = "module3", 5 | srcs = glob(["java/src/**/*.java"]), 6 | visibility = ["//module1:__pkg__", "//module2:__pkg__"] 7 | ) 8 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/bazel-ls-demo-project/module3/java/src/log/Logger.java: -------------------------------------------------------------------------------- 1 | package log; 2 | 3 | import java.time.Instant; 4 | 5 | public final class Logger { 6 | 7 | private Logger() { 8 | throw new RuntimeException(); 9 | } 10 | 11 | public static void logDebug(String message) { 12 | String output = String.format("[DEBUG] %s", message); 13 | System.out.println(output); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/bazel-ls-demo-project/third_party/maven/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/bazel-ls-demo-project/third_party/maven/BUILD -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/bazel-ls-demo-project/third_party/maven/dependencies.bzl: -------------------------------------------------------------------------------- 1 | load("@bazel_tools//tools/build_defs/repo:jvm.bzl", "jvm_maven_import_external") 2 | 3 | def maven_dependencies( 4 | maven_servers = ["https://repo1.maven.org/maven2/"]): 5 | 6 | jvm_maven_import_external( 7 | name = "com_google_guava", 8 | artifact = "com.google.guava:guava:28.2-jre", 9 | artifact_sha256 = "fc3aa363ad87223d1fbea584eee015a862150f6d34c71f24dc74088a635f08ef", 10 | licenses = ["notice"], 11 | server_urls = maven_servers, 12 | ) 13 | 14 | jvm_maven_import_external( 15 | name = "junit", 16 | artifact = "junit:junit:4.13", 17 | artifact_sha256 = "4b8532f63bdc0e0661507f947eb324a954d1dbac631ad19c8aa9a00feed1d863", 18 | licenses = ["notice"], 19 | server_urls = maven_servers, 20 | ) 21 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/build-with-class/WORKSPACE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/build-with-class/WORKSPACE -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/build-with-class/module1/java/src/example/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_java//java:defs.bzl", "java_binary") 2 | 3 | java_binary( 4 | name = "ProjectRunner", 5 | srcs = glob(["*.java"]), 6 | main_class = "com.example.ProjectRunner", 7 | deps = [":greeter"], 8 | ) 9 | 10 | java_library( 11 | name = "greeter", 12 | srcs = ["Greeting.java"], 13 | ) 14 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/build-with-class/module1/java/src/example/Greeting.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | public class Greeting { 4 | public static void sayHi() { 5 | System.out.println("Hi!"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/build-with-class/module1/java/src/example/ProjectRunner.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | public class ProjectRunner { 4 | public static void main(String args[]) { 5 | Greeting.sayHi(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/build-with-subpackage/WORKSPACE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/build-with-subpackage/WORKSPACE -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/build-with-subpackage/module/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_java//java:defs.bzl", "java_binary") 2 | 3 | java_binary( 4 | name = "ProjectRunner", 5 | srcs = glob(["java/src/example/ProjectRunner.java"]), 6 | main_class = "example.ProjectRunner", 7 | deps = ["//module/submodule:greeter"], 8 | ) 9 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/build-with-subpackage/module/java/src/example/ProjectRunner.java: -------------------------------------------------------------------------------- 1 | package example; 2 | 3 | import greeting.SayHi; 4 | 5 | public class ProjectRunner { 6 | public static void main(String args[]) { 7 | SayHi.sayHi(); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/build-with-subpackage/module/submodule/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_java//java:defs.bzl", "java_library") 2 | 3 | java_library( 4 | name = "greeter", 5 | srcs = glob(["java/src/greeting/SayHi.java"]), 6 | visibility = ["//visibility:public"], 7 | ) 8 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/build-with-subpackage/module/submodule/java/src/greeting/SayHi.java: -------------------------------------------------------------------------------- 1 | package greeting; 2 | 3 | public class SayHi { 4 | public static void sayHi() { 5 | System.out.println("Hi!"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/build-with-workspace/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/build-with-workspace/BUILD -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/build-with-workspace/WORKSPACE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/salesforce/bazel-eclipse/8e717d176a9e228537f9f867ef808bab4a7fb485/tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/build-with-workspace/WORKSPACE -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/build-with-workspace/module1/BUILD: -------------------------------------------------------------------------------- 1 | load("@rules_java//java:defs.bzl", "java_binary") 2 | 3 | java_binary( 4 | name = "ProjectRunner", 5 | srcs = glob(["src/main/java/com/example/ProjectRunner.java"]), 6 | main_class = "com.example.ProjectRunner", 7 | deps = [":greeter"], 8 | ) 9 | 10 | java_library( 11 | name = "greeter", 12 | srcs = ["src/main/java/com/example/Greeting.java"], 13 | ) 14 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/build-with-workspace/module1/java/src/example/Greeting.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | public class Greeting { 4 | public static void sayHi() { 5 | System.out.println("Hi!"); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.jdtls.tests/projects/build-with-workspace/module1/java/src/example/ProjectRunner.java: -------------------------------------------------------------------------------- 1 | package com.example; 2 | 3 | public class ProjectRunner { 4 | public static void main(String args[]) { 5 | Greeting.sayHi(); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.ui.tests/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.ui.tests/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.salesforce.bazel.eclipse.ui.tests 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.ui.tests/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.ui.tests/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | resolve.requirebundle=false 3 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.ui.tests/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Bazel Eclipse Feature UI Plug-In Tests 4 | Bundle-SymbolicName: com.salesforce.bazel.eclipse.ui.tests;singleton:=true 5 | Bundle-Version: 2.0.0.qualifier 6 | Bundle-Vendor: Bazel Eclipse Feature 7 | Automatic-Module-Name: com.salesforce.bazel.eclipse.ui.tests 8 | Fragment-Host: com.salesforce.bazel.eclipse.ui;bundle-version="2.0.0.qualifier" 9 | Bundle-RequiredExecutionEnvironment: JavaSE-21 10 | Import-Package: net.bytebuddy.agent;version="1.14.0", 11 | org.hamcrest;version="2.2.0", 12 | org.hamcrest.collection;version="2.2.0", 13 | org.junit.jupiter.api;version="5.9.2", 14 | org.junit.jupiter.api.extension;version="5.9.2", 15 | org.junit.jupiter.api.function;version="5.9.2", 16 | org.junit.jupiter.api.io;version="5.9.2", 17 | org.junit.jupiter.params;version="5.9.2", 18 | org.junit.jupiter.params.provider;version="5.9.2", 19 | org.mockito;version="5.1.1" 20 | Require-Bundle: testdata;bundle-version="1.0.0" 21 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.ui.tests/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | . 5 | additional.bundles = org.mockito.mockito-core,\ 6 | junit-jupiter-params,\ 7 | org.hamcrest 8 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.ui.tests/src/com/salesforce/bazel/eclipse/ui/execution/BazelQueryTestCommand.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.ui.execution; 2 | 3 | import static java.nio.file.Files.createTempFile; 4 | import static java.nio.file.Files.readAllLines; 5 | 6 | import java.io.IOException; 7 | import java.nio.charset.Charset; 8 | import java.nio.file.Path; 9 | import java.util.Collection; 10 | import java.util.List; 11 | 12 | import com.salesforce.bazel.sdk.BazelVersion; 13 | import com.salesforce.bazel.sdk.command.BazelQueryCommand; 14 | 15 | /** 16 | * bazel query --output streamed_proto --order_output=no 17 | */ 18 | public class BazelQueryTestCommand extends BazelQueryCommand> { 19 | 20 | public BazelQueryTestCommand(Path workspaceRoot, String query, boolean keepGoing) { 21 | super(workspaceRoot, query, keepGoing, "query test command"); 22 | } 23 | 24 | @Override 25 | protected Collection doGenerateResult() throws IOException { 26 | return readAllLines(getStdOutFile(), Charset.defaultCharset()); 27 | } 28 | 29 | @Override 30 | public List prepareCommandLine(BazelVersion bazelVersion) throws IOException { 31 | // redirect output to file for parsing 32 | var stdoutFile = createTempFile("bazel_test_query_stdout_", ".bin"); 33 | setRedirectStdOutToFile(stdoutFile); 34 | 35 | // prepare regular query command line 36 | return super.prepareCommandLine(bazelVersion); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.eclipse.ui.tests/src/com/salesforce/bazel/eclipse/ui/execution/TestCommand.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.eclipse.ui.execution; 2 | 3 | import static org.junit.jupiter.api.Assertions.fail; 4 | 5 | import java.io.IOException; 6 | import java.nio.file.Path; 7 | 8 | import com.salesforce.bazel.sdk.command.BazelCommand; 9 | 10 | /** 11 | * A command to be used by testing an executor. 12 | */ 13 | class TestCommand extends BazelCommand { 14 | public TestCommand() { 15 | this(Path.of(System.getProperty("user.home"))); 16 | } 17 | 18 | public TestCommand(Path workingDirectory, String... commandArgs) { 19 | super("dummy", workingDirectory, "test command"); 20 | setCommandArgs(commandArgs); 21 | } 22 | 23 | @Override 24 | protected Integer doGenerateResult() throws IOException { 25 | fail("This should never be called!"); 26 | return null; 27 | } 28 | 29 | @Override 30 | public Integer generateResult(int exitCode) throws IOException { 31 | return exitCode; 32 | } 33 | 34 | @Override 35 | public void setRedirectStdOutToFile(Path stdOutFile) { 36 | super.setRedirectStdOutToFile(stdOutFile); 37 | } 38 | } -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.importedsource.tests/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.importedsource.tests/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.salesforce.bazel.importedsource.tests 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.importedsource.tests/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.importedsource.tests/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | pluginProject.extensions=false 3 | resolve.requirebundle=false 4 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.importedsource.tests/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Tests for Imported Sources 4 | Bundle-SymbolicName: com.salesforce.bazel.importedsource.tests 5 | Bundle-Version: 2.0.0.qualifier 6 | Bundle-Vendor: Bazel Eclipse Feature 7 | Fragment-Host: com.salesforce.bazel.importedsource;bundle-version="2.0.0.qualifier" 8 | Import-Package: com.google.common.truth;version="[1.4.0,2.0.0)", 9 | org.junit.jupiter.api;version="[5.11.0,6.0.0)", 10 | org.junit.jupiter.api.condition;version="[5.11.0,6.0.0)" 11 | Automatic-Module-Name: com.salesforce.bazel.java.sdk.tests 12 | Bundle-RequiredExecutionEnvironment: JavaSE-17 13 | Bundle-ClassPath: . 14 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.importedsource.tests/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | . 5 | additional.bundles = org.mockito.mockito-core,\ 6 | junit-jupiter-api,\ 7 | org.hamcrest,\ 8 | net.bytebuddy.byte-buddy,\ 9 | wrapped.com.google.truth.truth 10 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.sdk.tests/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.sdk.tests/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | com.salesforce.bazel.sdk.tests 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.pde.ManifestBuilder 15 | 16 | 17 | 18 | 19 | org.eclipse.pde.SchemaBuilder 20 | 21 | 22 | 23 | 24 | 25 | org.eclipse.pde.PluginNature 26 | org.eclipse.jdt.core.javanature 27 | 28 | 29 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.sdk.tests/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding/=UTF-8 3 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.sdk.tests/.settings/org.eclipse.core.runtime.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | line.separator=\n 3 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.sdk.tests/.settings/org.eclipse.pde.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | resolve.requirebundle=false 3 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.sdk.tests/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Bundle-ManifestVersion: 2 3 | Bundle-Name: Bazel Java SDK and IntelliJ Helper Tests 4 | Bundle-SymbolicName: com.salesforce.bazel.sdk.tests 5 | Bundle-Version: 2.0.0.qualifier 6 | Bundle-Vendor: Bazel Eclipse Feature 7 | Fragment-Host: com.salesforce.bazel.sdk;bundle-version="2.0.0.qualifier" 8 | Import-Package: org.junit.jupiter.api;version="[5.11.0,6.0.0)", 9 | org.junit.jupiter.api.condition;version="[5.11.0,6.0.0)", 10 | org.junit.jupiter.api.function;version="[5.11.0,6.0.0)", 11 | org.junit.jupiter.api.io;version="[5.11.0,6.0.0)" 12 | Automatic-Module-Name: com.salesforce.bazel.java.sdk.tests 13 | Bundle-RequiredExecutionEnvironment: JavaSE-21 14 | Bundle-ClassPath: . 15 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.sdk.tests/build.properties: -------------------------------------------------------------------------------- 1 | source.. = src/ 2 | output.. = bin/ 3 | bin.includes = META-INF/,\ 4 | . 5 | additional.bundles = org.mockito.mockito-core,\ 6 | junit-jupiter-api,\ 7 | org.hamcrest,\ 8 | net.bytebuddy.byte-buddy 9 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.sdk.tests/src/com/salesforce/bazel/sdk/command/TestCommand.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.sdk.command; 2 | 3 | import static org.junit.jupiter.api.Assertions.fail; 4 | 5 | import java.io.IOException; 6 | import java.nio.file.Path; 7 | 8 | /** 9 | * A command to be used by testing an executor. 10 | */ 11 | class TestCommand extends BazelCommand { 12 | public TestCommand() { 13 | this(Path.of(System.getProperty("user.home"))); 14 | } 15 | 16 | public TestCommand(Path workingDirectory, String... commandArgs) { 17 | super("dummy", workingDirectory, "testing"); 18 | setCommandArgs(commandArgs); 19 | } 20 | 21 | @Override 22 | protected Integer doGenerateResult() throws IOException { 23 | fail("This should never be called!"); 24 | return null; 25 | } 26 | 27 | @Override 28 | public Integer generateResult(int exitCode) throws IOException { 29 | return exitCode; 30 | } 31 | } -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.sdk.tests/src/com/salesforce/bazel/sdk/command/shell/MacOsLoginShellFinderTest.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.sdk.command.shell; 2 | 3 | import static java.lang.String.format; 4 | import static java.nio.file.Files.isExecutable; 5 | import static org.junit.jupiter.api.Assertions.assertNotNull; 6 | import static org.junit.jupiter.api.Assertions.assertThrows; 7 | import static org.junit.jupiter.api.Assertions.assertTrue; 8 | 9 | import java.io.IOException; 10 | 11 | import org.junit.jupiter.api.Test; 12 | import org.junit.jupiter.api.condition.EnabledOnOs; 13 | import org.junit.jupiter.api.condition.OS; 14 | 15 | @EnabledOnOs(OS.MAC) 16 | public class MacOsLoginShellFinderTest { 17 | 18 | @Test 19 | void detectLoginShell() throws Exception { 20 | var detectLoginShell = new MacOsLoginShellFinder().detectLoginShell(); 21 | assertNotNull(detectLoginShell); 22 | assertTrue(isExecutable(detectLoginShell), () -> format("not executable: '%s'", detectLoginShell)); 23 | } 24 | 25 | @Test 26 | void detectLoginShell_unknonw_users() throws Exception { 27 | assertThrows(IOException.class, () -> { 28 | new MacOsLoginShellFinder().detectLoginShell("foo-bar-" + System.nanoTime()); 29 | }); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.sdk.tests/src/com/salesforce/bazel/sdk/command/shell/UnixLoginShellFinderTest.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.sdk.command.shell; 2 | 3 | import static java.lang.String.format; 4 | import static java.nio.file.Files.isExecutable; 5 | import static org.junit.jupiter.api.Assertions.assertNotNull; 6 | import static org.junit.jupiter.api.Assertions.assertThrows; 7 | import static org.junit.jupiter.api.Assertions.assertTrue; 8 | 9 | import java.io.IOException; 10 | 11 | import org.junit.jupiter.api.Test; 12 | import org.junit.jupiter.api.condition.EnabledOnOs; 13 | import org.junit.jupiter.api.condition.OS; 14 | 15 | @EnabledOnOs(OS.LINUX) 16 | public class UnixLoginShellFinderTest { 17 | 18 | @Test 19 | void detectLoginShell() throws Exception { 20 | var detectLoginShell = new UnixLoginShellFinder().detectLoginShell(); 21 | assertNotNull(detectLoginShell); 22 | assertTrue(isExecutable(detectLoginShell), () -> format("not executable: '%s'", detectLoginShell)); 23 | } 24 | 25 | @Test 26 | void detectLoginShell_unknonw_users() throws Exception { 27 | assertThrows(IOException.class, () -> { 28 | new UnixLoginShellFinder().detectLoginShell("foo-bar-" + System.nanoTime()); 29 | }); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.sdk.tests/src/com/salesforce/bazel/sdk/model/BazelLabelTest.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.sdk.model; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertTrue; 4 | 5 | import org.junit.jupiter.api.Test; 6 | 7 | public class BazelLabelTest { 8 | 9 | @Test 10 | void isConcrete_positive_test() { 11 | assertTrue(new BazelLabel("//src/main/java/com/google/devtools/build/lib/runtime/mobileinstall:mobileinstall") 12 | .isConcrete()); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /tests/com.salesforce.bazel.sdk.tests/src/com/salesforce/bazel/sdk/util/SystemUtilTest.java: -------------------------------------------------------------------------------- 1 | package com.salesforce.bazel.sdk.util; 2 | 3 | import static org.junit.jupiter.api.Assertions.assertFalse; 4 | import static org.junit.jupiter.api.Assertions.assertTrue; 5 | 6 | import org.junit.jupiter.api.Test; 7 | import org.junit.jupiter.api.condition.DisabledOnOs; 8 | import org.junit.jupiter.api.condition.EnabledOnOs; 9 | import org.junit.jupiter.api.condition.OS; 10 | 11 | public class SystemUtilTest { 12 | 13 | @Test 14 | @DisabledOnOs(OS.MAC) 15 | void isMac_returns_false_on_none_Mac() throws Exception { 16 | assertFalse(new SystemUtil().isMac()); 17 | } 18 | 19 | @Test 20 | @EnabledOnOs(OS.MAC) 21 | void isMac_returns_true_on_Mac() throws Exception { 22 | assertTrue(new SystemUtil().isMac()); 23 | } 24 | 25 | @Test 26 | @DisabledOnOs(OS.LINUX) 27 | void isUnix_returns_false_on_none_Linux() throws Exception { 28 | assertFalse(new SystemUtil().isUnix()); 29 | } 30 | 31 | @Test 32 | @EnabledOnOs(OS.LINUX) 33 | void isUnix_returns_true_on_Linux() throws Exception { 34 | assertTrue(new SystemUtil().isUnix()); 35 | } 36 | 37 | @Test 38 | @DisabledOnOs(OS.WINDOWS) 39 | void isWindows_returns_false_on_none_Windows() throws Exception { 40 | assertFalse(new SystemUtil().isWindows()); 41 | } 42 | 43 | @Test 44 | @EnabledOnOs(OS.WINDOWS) 45 | void isWindows_returns_true_on_Windows() throws Exception { 46 | assertTrue(new SystemUtil().isWindows()); 47 | } 48 | } 49 | --------------------------------------------------------------------------------