1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Bug 540373: Normalize newlines with .gitattributes

There is also a new script to verify completeness of .gitattributes:
releng/scripts/verify_gitattributes.sh

Change-Id: I2ce270852ab54b66b6c474a6ec94203fe5bba78b
This commit is contained in:
Jonah Graham 2018-11-20 21:20:39 +00:00
parent 3cf0297769
commit 48d2271a58
609 changed files with 72673 additions and 72509 deletions

142
.gitattributes vendored Normal file
View file

@ -0,0 +1,142 @@
* text=auto
# Generic files
AUTHORS text
ChangeLog text
COPYING text
NEWS text
README text
*.txt text
*.zip binary
# C-like Sources
*.asm text
*.c text
*.cc text
*.cpp text
*.h text
*.s text
*.S text
# C-like configuration/scripts
*.ac text
*.am text
*.bat text
*.build text
*.incl text
makefile text
Makefile text
*.mk text
*.sh text
# Qt
*.pro text
*.qml text
*.qrc text
# Visual Studio
*.dsp text eol=crlf
*.dsw text eol=crlf
*.filters text eol=crlf
*.sln text eol=crlf
*.vcxproj text eol=crlf
# C output files
# (These should not normally be checked in, exceptions for pre-compiled libraries and tests)
*.o binary
*.d text
*.dll binary
*.a binary
*.exe binary
*.out binary
*.app binary
*.jnilib binary
*.so binary
# Web/Javascript/Node
*.css text
*.htm text
*.html text
*.js text
*.json text
.npmignore text
package-list text
*.xml text
*.xsd text
*.xsl text
# Images
*.gif binary
*.icns binary
*.ico binary
*.jpg binary
*.jpeg binary
*.png binary
*.PNG binary
*.xpm binary
# Java/Eclipse
*.java text
*.properties text
.api_filters text
.classpath text
*.exsd text
*.g text
*.inf text
*.ini text
*.launch text
*.mappings text
*.MF text
.options text
*.options text
*.prefs text
*.product text
.project text
*.setup text
*.target text
# Java output files
# (These should not normally be checked in, exceptions for pre-compiled libraries and tests)
*.class binary
*.jar binary
# Files used in tests
*.awts text
be32 binary
be32lib binary
be64 binary
be64lib binary
exe binary
exebig_g binary
exe_g binary
*.expected text
*.F90 text
*.init text
launchConfigTestGdbinit text
le32 binary
le32lib binary
le64 binary
le64lib binary
*.main text
output-1 text
*.pda text
*.rts text
test_commands text
# Other special files
cdtOptions text
.contentsettings text
*.csv text
*.dia binary
*.dictionary text
.eclipseproduct text
.euml2 text
.gitattributes text
.gitignore text
*.patch text
*.src text
*.tmLanguage text
*.top text
*.ucd text
.umlproject text
*.upc text

View file

@ -1,100 +1,100 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=disabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=disabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=warning org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=warning org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=disabled org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.compiler.source=1.8

View file

@ -1,101 +1,101 @@
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled org.eclipse.jdt.core.compiler.annotation.inheritNullAnnotations=disabled
org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
org.eclipse.jdt.core.compiler.problem.deadCode=warning org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=warning
org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=warning
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning org.eclipse.jdt.core.compiler.problem.nonnullParameterAnnotationDropped=warning
org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
org.eclipse.jdt.core.compiler.problem.nullReference=warning org.eclipse.jdt.core.compiler.problem.nullReference=warning
org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore
org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled org.eclipse.jdt.core.compiler.problem.syntacticNullAnalysisForFields=disabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=disabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=disabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=disabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedExceptionParameter=ignore
org.eclipse.jdt.core.compiler.problem.unusedImport=warning org.eclipse.jdt.core.compiler.problem.unusedImport=warning
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore
org.eclipse.jdt.core.compiler.problem.unusedParameter=warning org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=disabled org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.compiler.source=1.8

View file

@ -1,36 +1,36 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2017 QNX Software Systems and others. * Copyright (c) 2017 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.build.gcc.core; package org.eclipse.cdt.build.gcc.core;
import java.nio.file.Path; import java.nio.file.Path;
import org.eclipse.cdt.core.build.IToolChainProvider; import org.eclipse.cdt.core.build.IToolChainProvider;
import org.eclipse.cdt.core.envvar.IEnvironmentVariable; import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
/** /**
* The Clang toolchain. There's little different from the GCC toolchain other * The Clang toolchain. There's little different from the GCC toolchain other
* than the toolchain type and name. * than the toolchain type and name.
* *
* @author dschaefer * @author dschaefer
* *
*/ */
public class ClangToolChain extends GCCToolChain { public class ClangToolChain extends GCCToolChain {
public static final String TYPE_ID = "org.eclipse.cdt.build.clang"; //$NON-NLS-1$ public static final String TYPE_ID = "org.eclipse.cdt.build.clang"; //$NON-NLS-1$
public ClangToolChain(IToolChainProvider provider, Path pathToToolChain, String arch, public ClangToolChain(IToolChainProvider provider, Path pathToToolChain, String arch,
IEnvironmentVariable[] envVars) { IEnvironmentVariable[] envVars) {
super(provider, pathToToolChain, arch, envVars); super(provider, pathToToolChain, arch, envVars);
} }
@Override @Override
public String getTypeId() { public String getTypeId() {
return TYPE_ID; return TYPE_ID;
} }
} }

View file

@ -1,126 +1,126 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2016 QNX Software Systems and others. All rights reserved. This program and the * Copyright (c) 2016 QNX Software Systems and others. All rights reserved. This program and the
* accompanying materials are made available under the terms of the Eclipse Public License v1.0 * accompanying materials are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.build.gcc.core.internal; package org.eclipse.cdt.build.gcc.core.internal;
import java.io.File; import java.io.File;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
import java.nio.file.Paths; import java.nio.file.Paths;
import org.eclipse.cdt.build.gcc.core.GCCToolChain; import org.eclipse.cdt.build.gcc.core.GCCToolChain;
import org.eclipse.cdt.core.build.IToolChain; import org.eclipse.cdt.core.build.IToolChain;
import org.eclipse.cdt.core.build.IToolChainManager; import org.eclipse.cdt.core.build.IToolChainManager;
import org.eclipse.cdt.core.build.IToolChainProvider; import org.eclipse.cdt.core.build.IToolChainProvider;
import org.eclipse.cdt.core.envvar.EnvironmentVariable; import org.eclipse.cdt.core.envvar.EnvironmentVariable;
import org.eclipse.cdt.core.envvar.IEnvironmentVariable; import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
import org.eclipse.cdt.utils.WindowsRegistry; import org.eclipse.cdt.utils.WindowsRegistry;
import org.eclipse.core.runtime.Platform; import org.eclipse.core.runtime.Platform;
public class Msys2ToolChainProvider implements IToolChainProvider { public class Msys2ToolChainProvider implements IToolChainProvider {
private static final String ID = "org.eclipse.cdt.build.gcc.core.msys2Provider"; //$NON-NLS-1$ private static final String ID = "org.eclipse.cdt.build.gcc.core.msys2Provider"; //$NON-NLS-1$
@Override @Override
public String getId() { public String getId() {
return ID; return ID;
} }
@Override @Override
public void init(IToolChainManager manager) { public void init(IToolChainManager manager) {
if (Platform.getOS().equals(Platform.OS_WIN32)) { if (Platform.getOS().equals(Platform.OS_WIN32)) {
WindowsRegistry registry = WindowsRegistry.getRegistry(); WindowsRegistry registry = WindowsRegistry.getRegistry();
String uninstallKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall"; //$NON-NLS-1$ String uninstallKey = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall"; //$NON-NLS-1$
String subkey; String subkey;
boolean on64bit = Platform.getOSArch().equals(Platform.ARCH_X86_64); boolean on64bit = Platform.getOSArch().equals(Platform.ARCH_X86_64);
String key32bit = null; String key32bit = null;
for (int i = 0; (subkey = registry.getCurrentUserKeyName(uninstallKey, i)) != null; i++) { for (int i = 0; (subkey = registry.getCurrentUserKeyName(uninstallKey, i)) != null; i++) {
String compKey = uninstallKey + '\\' + subkey; String compKey = uninstallKey + '\\' + subkey;
String displayName = registry.getCurrentUserValue(compKey, "DisplayName"); //$NON-NLS-1$ String displayName = registry.getCurrentUserValue(compKey, "DisplayName"); //$NON-NLS-1$
if (on64bit) { if (on64bit) {
if ("MSYS2 64bit".equals(displayName)) { //$NON-NLS-1$ if ("MSYS2 64bit".equals(displayName)) { //$NON-NLS-1$
if (addToolChain64(manager, registry, compKey)) { if (addToolChain64(manager, registry, compKey)) {
key32bit = null; key32bit = null;
break; break;
} }
} else if ("MSYS2 32bit".equals(displayName)) { //$NON-NLS-1$ } else if ("MSYS2 32bit".equals(displayName)) { //$NON-NLS-1$
key32bit = compKey; key32bit = compKey;
} }
} else { } else {
if ("MSYS2 32bit".equals(displayName)) { //$NON-NLS-1$ if ("MSYS2 32bit".equals(displayName)) { //$NON-NLS-1$
if (addToolChain32(manager, registry, compKey)) { if (addToolChain32(manager, registry, compKey)) {
break; break;
} }
} }
} }
} }
if (on64bit && key32bit != null) { if (on64bit && key32bit != null) {
addToolChain64(manager, registry, key32bit); addToolChain64(manager, registry, key32bit);
} }
} }
} }
private boolean addToolChain64(IToolChainManager manager, WindowsRegistry registry, String key) { private boolean addToolChain64(IToolChainManager manager, WindowsRegistry registry, String key) {
String installLocation = registry.getCurrentUserValue(key, "InstallLocation"); //$NON-NLS-1$ String installLocation = registry.getCurrentUserValue(key, "InstallLocation"); //$NON-NLS-1$
Path msysPath = Paths.get(installLocation); Path msysPath = Paths.get(installLocation);
Path gccPath = msysPath.resolve("mingw64\\bin\\gcc.exe"); //$NON-NLS-1$ Path gccPath = msysPath.resolve("mingw64\\bin\\gcc.exe"); //$NON-NLS-1$
if (Files.exists(gccPath)) { if (Files.exists(gccPath)) {
StringBuilder pathVar = new StringBuilder(); StringBuilder pathVar = new StringBuilder();
pathVar.append(msysPath); pathVar.append(msysPath);
pathVar.append("\\mingw64\\bin"); //$NON-NLS-1$ pathVar.append("\\mingw64\\bin"); //$NON-NLS-1$
pathVar.append(File.pathSeparatorChar); pathVar.append(File.pathSeparatorChar);
pathVar.append(msysPath); pathVar.append(msysPath);
pathVar.append("\\usr\\local\\bin"); //$NON-NLS-1$ pathVar.append("\\usr\\local\\bin"); //$NON-NLS-1$
pathVar.append(File.pathSeparatorChar); pathVar.append(File.pathSeparatorChar);
pathVar.append(msysPath); pathVar.append(msysPath);
pathVar.append("\\usr\\bin"); //$NON-NLS-1$ pathVar.append("\\usr\\bin"); //$NON-NLS-1$
pathVar.append(File.pathSeparatorChar); pathVar.append(File.pathSeparatorChar);
pathVar.append(msysPath); pathVar.append(msysPath);
pathVar.append("\\bin"); //$NON-NLS-1$ pathVar.append("\\bin"); //$NON-NLS-1$
IEnvironmentVariable[] vars = new IEnvironmentVariable[] { IEnvironmentVariable[] vars = new IEnvironmentVariable[] {
new EnvironmentVariable("PATH", pathVar.toString(), IEnvironmentVariable.ENVVAR_PREPEND, //$NON-NLS-1$ new EnvironmentVariable("PATH", pathVar.toString(), IEnvironmentVariable.ENVVAR_PREPEND, //$NON-NLS-1$
File.pathSeparator) File.pathSeparator)
}; };
GCCToolChain toolChain = new GCCToolChain(this, gccPath, Platform.ARCH_X86_64, vars); GCCToolChain toolChain = new GCCToolChain(this, gccPath, Platform.ARCH_X86_64, vars);
toolChain.setProperty(IToolChain.ATTR_PACKAGE, "msys2"); //$NON-NLS-1$ toolChain.setProperty(IToolChain.ATTR_PACKAGE, "msys2"); //$NON-NLS-1$
manager.addToolChain(toolChain); manager.addToolChain(toolChain);
return true; return true;
} else { } else {
return addToolChain32(manager, registry, key); return addToolChain32(manager, registry, key);
} }
} }
private boolean addToolChain32(IToolChainManager manager, WindowsRegistry registry, String key) { private boolean addToolChain32(IToolChainManager manager, WindowsRegistry registry, String key) {
String installLocation = registry.getCurrentUserValue(key, "InstallLocation"); //$NON-NLS-1$ String installLocation = registry.getCurrentUserValue(key, "InstallLocation"); //$NON-NLS-1$
Path msysPath = Paths.get(installLocation); Path msysPath = Paths.get(installLocation);
Path gccPath = msysPath.resolve("mingw32\\bin\\gcc.exe"); //$NON-NLS-1$ Path gccPath = msysPath.resolve("mingw32\\bin\\gcc.exe"); //$NON-NLS-1$
if (Files.exists(gccPath)) { if (Files.exists(gccPath)) {
StringBuilder pathVar = new StringBuilder(); StringBuilder pathVar = new StringBuilder();
pathVar.append(msysPath); pathVar.append(msysPath);
pathVar.append("\\mingw32\\bin"); //$NON-NLS-1$ pathVar.append("\\mingw32\\bin"); //$NON-NLS-1$
pathVar.append(File.pathSeparatorChar); pathVar.append(File.pathSeparatorChar);
pathVar.append(msysPath); pathVar.append(msysPath);
pathVar.append("\\usr\\local\\bin"); //$NON-NLS-1$ pathVar.append("\\usr\\local\\bin"); //$NON-NLS-1$
pathVar.append(File.pathSeparatorChar); pathVar.append(File.pathSeparatorChar);
pathVar.append(msysPath); pathVar.append(msysPath);
pathVar.append("\\usr\\bin"); //$NON-NLS-1$ pathVar.append("\\usr\\bin"); //$NON-NLS-1$
pathVar.append(File.pathSeparatorChar); pathVar.append(File.pathSeparatorChar);
pathVar.append(msysPath); pathVar.append(msysPath);
pathVar.append("\\bin"); //$NON-NLS-1$ pathVar.append("\\bin"); //$NON-NLS-1$
IEnvironmentVariable[] vars = new IEnvironmentVariable[] { IEnvironmentVariable[] vars = new IEnvironmentVariable[] {
new EnvironmentVariable("PATH", pathVar.toString(), IEnvironmentVariable.ENVVAR_PREPEND, //$NON-NLS-1$ new EnvironmentVariable("PATH", pathVar.toString(), IEnvironmentVariable.ENVVAR_PREPEND, //$NON-NLS-1$
File.pathSeparator) }; File.pathSeparator) };
GCCToolChain toolChain = new GCCToolChain(this, gccPath, Platform.ARCH_X86, vars); GCCToolChain toolChain = new GCCToolChain(this, gccPath, Platform.ARCH_X86, vars);
toolChain.setProperty(IToolChain.ATTR_PACKAGE, "msys2"); //$NON-NLS-1$ toolChain.setProperty(IToolChain.ATTR_PACKAGE, "msys2"); //$NON-NLS-1$
manager.addToolChain(toolChain); manager.addToolChain(toolChain);
return true; return true;
} else { } else {
return false; return false;
} }
} }
} }

View file

@ -1,56 +1,56 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2017 QNX Software Systems and others. * Copyright (c) 2017 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.build.gcc.ui.internal; package org.eclipse.cdt.build.gcc.ui.internal;
import org.eclipse.osgi.util.NLS; import org.eclipse.osgi.util.NLS;
public class Messages extends NLS { public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.cdt.build.gcc.ui.internal.messages"; //$NON-NLS-1$ private static final String BUNDLE_NAME = "org.eclipse.cdt.build.gcc.ui.internal.messages"; //$NON-NLS-1$
public static String GCCToolChainSettingsPage_Arch; public static String GCCToolChainSettingsPage_Arch;
public static String GCCToolChainSettingsPage_Browse; public static String GCCToolChainSettingsPage_Browse;
public static String GCCToolChainSettingsPage_ClangTitle; public static String GCCToolChainSettingsPage_ClangTitle;
public static String GCCToolChainSettingsPage_Compiler; public static String GCCToolChainSettingsPage_Compiler;
public static String GCCToolChainSettingsPage_Description; public static String GCCToolChainSettingsPage_Description;
public static String GCCToolChainSettingsPage_OS; public static String GCCToolChainSettingsPage_OS;
public static String GCCToolChainSettingsPage_Title; public static String GCCToolChainSettingsPage_Title;
public static String NewClangToolChainWizard_Title; public static String NewClangToolChainWizard_Title;
public static String NewEnvVarDialog_Append; public static String NewEnvVarDialog_Append;
public static String NewEnvVarDialog_Delimiter; public static String NewEnvVarDialog_Delimiter;
public static String NewEnvVarDialog_Edit; public static String NewEnvVarDialog_Edit;
public static String NewEnvVarDialog_Name; public static String NewEnvVarDialog_Name;
public static String NewEnvVarDialog_New; public static String NewEnvVarDialog_New;
public static String NewEnvVarDialog_Operation; public static String NewEnvVarDialog_Operation;
public static String NewEnvVarDialog_Prepend; public static String NewEnvVarDialog_Prepend;
public static String NewEnvVarDialog_Replace; public static String NewEnvVarDialog_Replace;
public static String NewEnvVarDialog_Select; public static String NewEnvVarDialog_Select;
public static String NewEnvVarDialog_Unset; public static String NewEnvVarDialog_Unset;
public static String NewEnvVarDialog_Value; public static String NewEnvVarDialog_Value;
public static String NewGCCToolChainWizard_Add; public static String NewGCCToolChainWizard_Add;
public static String NewGCCToolChainWizard_New; public static String NewGCCToolChainWizard_New;
public static String ToolChainEnvironmentPage_Add; public static String ToolChainEnvironmentPage_Add;
public static String ToolChainEnvironmentPage_Append; public static String ToolChainEnvironmentPage_Append;
public static String ToolChainEnvironmentPage_Description; public static String ToolChainEnvironmentPage_Description;
public static String ToolChainEnvironmentPage_Edit; public static String ToolChainEnvironmentPage_Edit;
public static String ToolChainEnvironmentPage_Name; public static String ToolChainEnvironmentPage_Name;
public static String ToolChainEnvironmentPage_Operation; public static String ToolChainEnvironmentPage_Operation;
public static String ToolChainEnvironmentPage_Prepend; public static String ToolChainEnvironmentPage_Prepend;
public static String ToolChainEnvironmentPage_Remove; public static String ToolChainEnvironmentPage_Remove;
public static String ToolChainEnvironmentPage_RemoveMessage; public static String ToolChainEnvironmentPage_RemoveMessage;
public static String ToolChainEnvironmentPage_RemoveTitle; public static String ToolChainEnvironmentPage_RemoveTitle;
public static String ToolChainEnvironmentPage_Replace; public static String ToolChainEnvironmentPage_Replace;
public static String ToolChainEnvironmentPage_Title; public static String ToolChainEnvironmentPage_Title;
public static String ToolChainEnvironmentPage_Unset; public static String ToolChainEnvironmentPage_Unset;
public static String ToolChainEnvironmentPage_Value; public static String ToolChainEnvironmentPage_Value;
static { static {
// initialize resource bundle // initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class); NLS.initializeMessages(BUNDLE_NAME, Messages.class);
} }
private Messages() { private Messages() {
} }
} }

View file

@ -1,75 +1,75 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2017 QNX Software Systems and others. * Copyright (c) 2017 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.build.gcc.ui.internal; package org.eclipse.cdt.build.gcc.ui.internal;
import java.nio.file.Path; import java.nio.file.Path;
import org.eclipse.cdt.build.gcc.core.ClangToolChain; import org.eclipse.cdt.build.gcc.core.ClangToolChain;
import org.eclipse.cdt.build.gcc.core.GCCToolChain; import org.eclipse.cdt.build.gcc.core.GCCToolChain;
import org.eclipse.cdt.build.gcc.core.GCCUserToolChainProvider; import org.eclipse.cdt.build.gcc.core.GCCUserToolChainProvider;
import org.eclipse.cdt.core.build.IToolChain; import org.eclipse.cdt.core.build.IToolChain;
import org.eclipse.cdt.core.build.IToolChainManager; import org.eclipse.cdt.core.build.IToolChainManager;
import org.eclipse.cdt.core.build.IUserToolChainProvider; import org.eclipse.cdt.core.build.IUserToolChainProvider;
import org.eclipse.cdt.core.envvar.IEnvironmentVariable; import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
import org.eclipse.cdt.ui.build.ToolChainWizard; import org.eclipse.cdt.ui.build.ToolChainWizard;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status; import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job; import org.eclipse.core.runtime.jobs.Job;
public class NewClangToolChainWizard extends ToolChainWizard { public class NewClangToolChainWizard extends ToolChainWizard {
private GCCToolChainSettingsPage settingsPage; private GCCToolChainSettingsPage settingsPage;
private ToolChainEnvironmentPage envPage; private ToolChainEnvironmentPage envPage;
@Override @Override
public boolean performFinish() { public boolean performFinish() {
Path path = settingsPage.getPath(); Path path = settingsPage.getPath();
String os = settingsPage.getOS(); String os = settingsPage.getOS();
String arch = settingsPage.getArch(); String arch = settingsPage.getArch();
IEnvironmentVariable[] envvars = envPage.getEnvVars(); IEnvironmentVariable[] envvars = envPage.getEnvVars();
new Job(Messages.NewGCCToolChainWizard_Add) { new Job(Messages.NewGCCToolChainWizard_Add) {
@Override @Override
protected IStatus run(IProgressMonitor monitor) { protected IStatus run(IProgressMonitor monitor) {
try { try {
IToolChainManager manager = Activator.getService(IToolChainManager.class); IToolChainManager manager = Activator.getService(IToolChainManager.class);
IUserToolChainProvider provider = (IUserToolChainProvider) manager IUserToolChainProvider provider = (IUserToolChainProvider) manager
.getProvider(GCCUserToolChainProvider.PROVIDER_ID); .getProvider(GCCUserToolChainProvider.PROVIDER_ID);
if (toolChain != null) { if (toolChain != null) {
provider.removeToolChain(toolChain); provider.removeToolChain(toolChain);
} }
ClangToolChain gcc = new ClangToolChain(provider, path, arch, envvars); ClangToolChain gcc = new ClangToolChain(provider, path, arch, envvars);
gcc.setProperty(IToolChain.ATTR_OS, os); gcc.setProperty(IToolChain.ATTR_OS, os);
provider.addToolChain(gcc); provider.addToolChain(gcc);
return Status.OK_STATUS; return Status.OK_STATUS;
} catch (CoreException e) { } catch (CoreException e) {
return e.getStatus(); return e.getStatus();
} }
} }
}.schedule(); }.schedule();
return true; return true;
} }
@Override @Override
public void addPages() { public void addPages() {
super.addPages(); super.addPages();
settingsPage = new GCCToolChainSettingsPage((GCCToolChain) toolChain, true); settingsPage = new GCCToolChainSettingsPage((GCCToolChain) toolChain, true);
addPage(settingsPage); addPage(settingsPage);
envPage = new ToolChainEnvironmentPage(toolChain); envPage = new ToolChainEnvironmentPage(toolChain);
addPage(envPage); addPage(envPage);
setWindowTitle(Messages.NewClangToolChainWizard_Title); setWindowTitle(Messages.NewClangToolChainWizard_Title);
} }
} }

View file

@ -1,42 +1,42 @@
################################################################################ ################################################################################
# Copyright (c) 2017 QNX Software Systems and others. # Copyright (c) 2017 QNX Software Systems and others.
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0 # are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at # which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html # http://www.eclipse.org/legal/epl-v10.html
################################################################################ ################################################################################
GCCToolChainSettingsPage_Arch=CPU Architecture: GCCToolChainSettingsPage_Arch=CPU Architecture:
GCCToolChainSettingsPage_Browse=Browse... GCCToolChainSettingsPage_Browse=Browse...
GCCToolChainSettingsPage_ClangTitle=clang Toolchain Settings GCCToolChainSettingsPage_ClangTitle=clang Toolchain Settings
GCCToolChainSettingsPage_Compiler=Compiler: GCCToolChainSettingsPage_Compiler=Compiler:
GCCToolChainSettingsPage_Description=Enter the path to the compiler and properties for the toolchain. GCCToolChainSettingsPage_Description=Enter the path to the compiler and properties for the toolchain.
GCCToolChainSettingsPage_OS=Operating System: GCCToolChainSettingsPage_OS=Operating System:
GCCToolChainSettingsPage_Title=GCC ToolChain Settings GCCToolChainSettingsPage_Title=GCC ToolChain Settings
NewClangToolChainWizard_Title=New clang Toolchain NewClangToolChainWizard_Title=New clang Toolchain
NewEnvVarDialog_Append=Append NewEnvVarDialog_Append=Append
NewEnvVarDialog_Delimiter=Delimiter: NewEnvVarDialog_Delimiter=Delimiter:
NewEnvVarDialog_Edit=Edit Environment Variable NewEnvVarDialog_Edit=Edit Environment Variable
NewEnvVarDialog_Name=Name: NewEnvVarDialog_Name=Name:
NewEnvVarDialog_New=New Environment Variable NewEnvVarDialog_New=New Environment Variable
NewEnvVarDialog_Operation=Operation NewEnvVarDialog_Operation=Operation
NewEnvVarDialog_Prepend=Prepend NewEnvVarDialog_Prepend=Prepend
NewEnvVarDialog_Replace=Replace NewEnvVarDialog_Replace=Replace
NewEnvVarDialog_Select=Select... NewEnvVarDialog_Select=Select...
NewEnvVarDialog_Unset=Unset NewEnvVarDialog_Unset=Unset
NewEnvVarDialog_Value=Value: NewEnvVarDialog_Value=Value:
NewGCCToolChainWizard_Add=Add ToolChain NewGCCToolChainWizard_Add=Add ToolChain
NewGCCToolChainWizard_New=New GCC ToolChain NewGCCToolChainWizard_New=New GCC ToolChain
ToolChainEnvironmentPage_Add=Add... ToolChainEnvironmentPage_Add=Add...
ToolChainEnvironmentPage_Append=Append ToolChainEnvironmentPage_Append=Append
ToolChainEnvironmentPage_Description=Environment variables to set when using toolchain. ToolChainEnvironmentPage_Description=Environment variables to set when using toolchain.
ToolChainEnvironmentPage_Edit=Edit... ToolChainEnvironmentPage_Edit=Edit...
ToolChainEnvironmentPage_Name=Name ToolChainEnvironmentPage_Name=Name
ToolChainEnvironmentPage_Operation=Operation ToolChainEnvironmentPage_Operation=Operation
ToolChainEnvironmentPage_Prepend=Prepend ToolChainEnvironmentPage_Prepend=Prepend
ToolChainEnvironmentPage_Remove=Remove ToolChainEnvironmentPage_Remove=Remove
ToolChainEnvironmentPage_RemoveMessage=Are you sure you would like to remove the selected environment variable(s) ToolChainEnvironmentPage_RemoveMessage=Are you sure you would like to remove the selected environment variable(s)
ToolChainEnvironmentPage_RemoveTitle=Remove ToolChainEnvironmentPage_RemoveTitle=Remove
ToolChainEnvironmentPage_Replace=Replace ToolChainEnvironmentPage_Replace=Replace
ToolChainEnvironmentPage_Title=Environment Variables ToolChainEnvironmentPage_Title=Environment Variables
ToolChainEnvironmentPage_Unset=Unset ToolChainEnvironmentPage_Unset=Unset
ToolChainEnvironmentPage_Value=Value ToolChainEnvironmentPage_Value=Value

View file

@ -1,36 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<feature <feature
id="org.eclipse.cdt.core.autotools" id="org.eclipse.cdt.core.autotools"
label="%featureName" label="%featureName"
version="9.6.0.qualifier" version="9.6.0.qualifier"
provider-name="%providerName" provider-name="%providerName"
license-feature="org.eclipse.license" license-feature="org.eclipse.license"
license-feature-version="0.0.0"> license-feature-version="0.0.0">
<description> <description>
%description %description
</description> </description>
<copyright> <copyright>
%copyright %copyright
</copyright> </copyright>
<license url="%licenseURL"> <license url="%licenseURL">
%license %license
</license> </license>
<plugin <plugin
id="org.eclipse.cdt.core.autotools.ui" id="org.eclipse.cdt.core.autotools.ui"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"
unpack="false"/> unpack="false"/>
<plugin <plugin
id="org.eclipse.cdt.core.autotools.core" id="org.eclipse.cdt.core.autotools.core"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"
unpack="false"/> unpack="false"/>
</feature> </feature>

View file

@ -1,43 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<feature <feature
id="org.eclipse.cdt.gnu.build" id="org.eclipse.cdt.gnu.build"
label="%featureName" label="%featureName"
version="9.6.0.qualifier" version="9.6.0.qualifier"
provider-name="%providerName" provider-name="%providerName"
license-feature="org.eclipse.license" license-feature="org.eclipse.license"
license-feature-version="0.0.0"> license-feature-version="0.0.0">
<description> <description>
%description %description
</description> </description>
<copyright> <copyright>
%copyright %copyright
</copyright> </copyright>
<license url="%licenseURL"> <license url="%licenseURL">
%license %license
</license> </license>
<plugin <plugin
id="org.eclipse.cdt.managedbuilder.gnu.ui" id="org.eclipse.cdt.managedbuilder.gnu.ui"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"
unpack="false"/> unpack="false"/>
<plugin <plugin
id="org.eclipse.cdt.build.gcc.core" id="org.eclipse.cdt.build.gcc.core"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"
unpack="false"/> unpack="false"/>
<plugin <plugin
id="org.eclipse.cdt.build.gcc.ui" id="org.eclipse.cdt.build.gcc.ui"
download-size="0" download-size="0"
install-size="0" install-size="0"
version="0.0.0" version="0.0.0"
unpack="false"/> unpack="false"/>
</feature> </feature>

View file

@ -1,109 +1,109 @@
<?xml version='1.0' encoding='UTF-8'?> <?xml version='1.0' encoding='UTF-8'?>
<!-- Schema file written by PDE --> <!-- Schema file written by PDE -->
<schema targetNamespace="org.eclipse.cdt.make.core"> <schema targetNamespace="org.eclipse.cdt.make.core">
<annotation> <annotation>
<appInfo> <appInfo>
<meta.schema plugin="org.eclipse.cdt.make.core" id="MakeTargetBuilder" name="Make Target Builder"/> <meta.schema plugin="org.eclipse.cdt.make.core" id="MakeTargetBuilder" name="Make Target Builder"/>
</appInfo> </appInfo>
<documentation> <documentation>
This extension point is used to identify builders that support IMakeBuidlerInfo an arguments. This extension point is used to identify builders that support IMakeBuidlerInfo an arguments.
</documentation> </documentation>
</annotation> </annotation>
<element name="extension"> <element name="extension">
<complexType> <complexType>
<sequence> <sequence>
<element ref="builder"/> <element ref="builder"/>
</sequence> </sequence>
<attribute name="point" type="string" use="required"> <attribute name="point" type="string" use="required">
<annotation> <annotation>
<documentation> <documentation>
</documentation> </documentation>
</annotation> </annotation>
</attribute> </attribute>
<attribute name="id" type="string"> <attribute name="id" type="string">
<annotation> <annotation>
<documentation> <documentation>
</documentation> </documentation>
</annotation> </annotation>
</attribute> </attribute>
<attribute name="name" type="string"> <attribute name="name" type="string">
<annotation> <annotation>
<documentation> <documentation>
</documentation> </documentation>
<appInfo> <appInfo>
<meta.attribute translatable="true"/> <meta.attribute translatable="true"/>
</appInfo> </appInfo>
</annotation> </annotation>
</attribute> </attribute>
</complexType> </complexType>
</element> </element>
<element name="builder"> <element name="builder">
<complexType> <complexType>
<attribute name="builderID" type="string" use="required"> <attribute name="builderID" type="string" use="required">
<annotation> <annotation>
<documentation> <documentation>
Eclipse builder ID of the builder that supports target builds. (Must support IMakeInfo as argument). Eclipse builder ID of the builder that supports target builds. (Must support IMakeInfo as argument).
</documentation> </documentation>
</annotation> </annotation>
</attribute> </attribute>
<attribute name="id" type="string" use="required"> <attribute name="id" type="string" use="required">
<annotation> <annotation>
<documentation> <documentation>
id used to identify this target builder id used to identify this target builder
</documentation> </documentation>
</annotation> </annotation>
</attribute> </attribute>
</complexType> </complexType>
</element> </element>
<annotation> <annotation>
<appInfo> <appInfo>
<meta.section type="since"/> <meta.section type="since"/>
</appInfo> </appInfo>
<documentation> <documentation>
[Enter the first release in which this extension point appears.] [Enter the first release in which this extension point appears.]
</documentation> </documentation>
</annotation> </annotation>
<annotation> <annotation>
<appInfo> <appInfo>
<meta.section type="examples"/> <meta.section type="examples"/>
</appInfo> </appInfo>
<documentation> <documentation>
[Enter extension point usage example here.] [Enter extension point usage example here.]
</documentation> </documentation>
</annotation> </annotation>
<annotation> <annotation>
<appInfo> <appInfo>
<meta.section type="apiInfo"/> <meta.section type="apiInfo"/>
</appInfo> </appInfo>
<documentation> <documentation>
[Enter API information here.] [Enter API information here.]
</documentation> </documentation>
</annotation> </annotation>
<annotation> <annotation>
<appInfo> <appInfo>
<meta.section type="implementation"/> <meta.section type="implementation"/>
</appInfo> </appInfo>
<documentation> <documentation>
[Enter information about supplied implementation of this extension point.] [Enter information about supplied implementation of this extension point.]
</documentation> </documentation>
</annotation> </annotation>
<annotation> <annotation>
<appInfo> <appInfo>
<meta.section type="copyright"/> <meta.section type="copyright"/>
</appInfo> </appInfo>
<documentation> <documentation>
</documentation> </documentation>
</annotation> </annotation>
</schema> </schema>

View file

@ -1,74 +1,74 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2017 QNX Software Systems and others. * Copyright (c) 2017 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.make.core; package org.eclipse.cdt.make.core;
import org.eclipse.cdt.core.build.ICBuildConfiguration; import org.eclipse.cdt.core.build.ICBuildConfiguration;
import org.eclipse.cdt.core.build.ICBuildConfigurationManager; import org.eclipse.cdt.core.build.ICBuildConfigurationManager;
import org.eclipse.cdt.core.build.ICBuildConfigurationProvider; import org.eclipse.cdt.core.build.ICBuildConfigurationProvider;
import org.eclipse.cdt.core.build.IToolChain; import org.eclipse.cdt.core.build.IToolChain;
import org.eclipse.cdt.core.build.StandardBuildConfiguration; import org.eclipse.cdt.core.build.StandardBuildConfiguration;
import org.eclipse.core.resources.IBuildConfiguration; import org.eclipse.core.resources.IBuildConfiguration;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
/** /**
* @since 7.4 * @since 7.4
*/ */
public class MakefileBuildConfigurationProvider implements ICBuildConfigurationProvider { public class MakefileBuildConfigurationProvider implements ICBuildConfigurationProvider {
public static final String ID = "org.eclipse.cdt.make.core.provider"; //$NON-NLS-1$ public static final String ID = "org.eclipse.cdt.make.core.provider"; //$NON-NLS-1$
@Override @Override
public String getId() { public String getId() {
return ID; return ID;
} }
@Override @Override
public ICBuildConfiguration getCBuildConfiguration(IBuildConfiguration config, String name) public ICBuildConfiguration getCBuildConfiguration(IBuildConfiguration config, String name)
throws CoreException { throws CoreException {
return new StandardBuildConfiguration(config, name); return new StandardBuildConfiguration(config, name);
} }
@Override @Override
public ICBuildConfiguration createBuildConfiguration(IProject project, IToolChain toolChain, public ICBuildConfiguration createBuildConfiguration(IProject project, IToolChain toolChain,
String launchMode, IProgressMonitor monitor) throws CoreException { String launchMode, IProgressMonitor monitor) throws CoreException {
ICBuildConfigurationManager configManager = MakeCorePlugin.getService(ICBuildConfigurationManager.class); ICBuildConfigurationManager configManager = MakeCorePlugin.getService(ICBuildConfigurationManager.class);
StringBuilder configName = new StringBuilder("make."); //$NON-NLS-1$ StringBuilder configName = new StringBuilder("make."); //$NON-NLS-1$
configName.append(launchMode); configName.append(launchMode);
String os = toolChain.getProperty(IToolChain.ATTR_OS); String os = toolChain.getProperty(IToolChain.ATTR_OS);
if ("linux-container".equals(os)) { //$NON-NLS-1$ if ("linux-container".equals(os)) { //$NON-NLS-1$
String osConfigName = toolChain.getProperty("linux-container-id"); //$NON-NLS-1$ String osConfigName = toolChain.getProperty("linux-container-id"); //$NON-NLS-1$
configName.append('.'); configName.append('.');
configName.append(osConfigName); configName.append(osConfigName);
} else { } else {
if (os != null) { if (os != null) {
configName.append('.'); configName.append('.');
configName.append(os); configName.append(os);
} }
String arch = toolChain.getProperty(IToolChain.ATTR_ARCH); String arch = toolChain.getProperty(IToolChain.ATTR_ARCH);
if (arch != null && !arch.isEmpty()) { if (arch != null && !arch.isEmpty()) {
configName.append('.'); configName.append('.');
configName.append(arch); configName.append(arch);
} }
} }
String name = configName.toString(); String name = configName.toString();
int i = 0; int i = 0;
while (configManager.hasConfiguration(this, project, name)) { while (configManager.hasConfiguration(this, project, name)) {
name = configName.toString() + '.' + (++i); name = configName.toString() + '.' + (++i);
} }
IBuildConfiguration config = configManager.createBuildConfiguration(this, project, name, monitor); IBuildConfiguration config = configManager.createBuildConfiguration(this, project, name, monitor);
StandardBuildConfiguration makeConfig = new StandardBuildConfiguration(config, name, toolChain, StandardBuildConfiguration makeConfig = new StandardBuildConfiguration(config, name, toolChain,
launchMode); launchMode);
configManager.addBuildConfiguration(config, makeConfig); configManager.addBuildConfiguration(config, makeConfig);
return makeConfig; return makeConfig;
} }
} }

View file

@ -1,89 +1,89 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2017 QNX Software Systems and others. * Copyright (c) 2017 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.make.core; package org.eclipse.cdt.make.core;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import org.eclipse.cdt.core.CCProjectNature; import org.eclipse.cdt.core.CCProjectNature;
import org.eclipse.cdt.core.CProjectNature; import org.eclipse.cdt.core.CProjectNature;
import org.eclipse.cdt.core.build.CBuilder; import org.eclipse.cdt.core.build.CBuilder;
import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.IPathEntry; import org.eclipse.cdt.core.model.IPathEntry;
import org.eclipse.core.resources.ICommand; import org.eclipse.core.resources.ICommand;
import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription; import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.tools.templates.freemarker.FMProjectGenerator; import org.eclipse.tools.templates.freemarker.FMProjectGenerator;
import org.eclipse.tools.templates.freemarker.SourceRoot; import org.eclipse.tools.templates.freemarker.SourceRoot;
import org.eclipse.tools.templates.freemarker.TemplateManifest; import org.eclipse.tools.templates.freemarker.TemplateManifest;
import org.osgi.framework.Bundle; import org.osgi.framework.Bundle;
/** /**
* Generator for Makefile projects. * Generator for Makefile projects.
* *
* @since 7.4 * @since 7.4
*/ */
public class MakefileProjectGenerator extends FMProjectGenerator { public class MakefileProjectGenerator extends FMProjectGenerator {
public MakefileProjectGenerator(String manifestPath) { public MakefileProjectGenerator(String manifestPath) {
super(manifestPath); super(manifestPath);
} }
@Override @Override
protected Bundle getSourceBundle() { protected Bundle getSourceBundle() {
return MakeCorePlugin.getDefault().getBundle(); return MakeCorePlugin.getDefault().getBundle();
} }
@Override @Override
protected void initProjectDescription(IProjectDescription description) throws CoreException { protected void initProjectDescription(IProjectDescription description) throws CoreException {
description.setNatureIds(new String[] { CProjectNature.C_NATURE_ID, CCProjectNature.CC_NATURE_ID, description.setNatureIds(new String[] { CProjectNature.C_NATURE_ID, CCProjectNature.CC_NATURE_ID,
MakeProjectNature.NATURE_ID }); MakeProjectNature.NATURE_ID });
ICommand command = description.newCommand(); ICommand command = description.newCommand();
CBuilder.setupBuilder(command); CBuilder.setupBuilder(command);
description.setBuildSpec(new ICommand[] { command }); description.setBuildSpec(new ICommand[] { command });
} }
@Override @Override
public void generate(Map<String, Object> model, IProgressMonitor monitor) throws CoreException { public void generate(Map<String, Object> model, IProgressMonitor monitor) throws CoreException {
super.generate(model, monitor); super.generate(model, monitor);
List<IPathEntry> entries = new ArrayList<>(); List<IPathEntry> entries = new ArrayList<>();
IProject project = getProject(); IProject project = getProject();
// Create the source and output folders // Create the source and output folders
IFolder buildFolder = getProject().getFolder("build"); //$NON-NLS-1$ IFolder buildFolder = getProject().getFolder("build"); //$NON-NLS-1$
TemplateManifest manifest = getManifest(); TemplateManifest manifest = getManifest();
if (manifest != null) { if (manifest != null) {
List<SourceRoot> srcRoots = getManifest().getSrcRoots(); List<SourceRoot> srcRoots = getManifest().getSrcRoots();
if (srcRoots != null && !srcRoots.isEmpty()) { if (srcRoots != null && !srcRoots.isEmpty()) {
for (SourceRoot srcRoot : srcRoots) { for (SourceRoot srcRoot : srcRoots) {
IFolder sourceFolder = project.getFolder(srcRoot.getDir()); IFolder sourceFolder = project.getFolder(srcRoot.getDir());
if (!sourceFolder.exists()) { if (!sourceFolder.exists()) {
sourceFolder.create(true, true, monitor); sourceFolder.create(true, true, monitor);
} }
entries.add(CoreModel.newSourceEntry(sourceFolder.getFullPath(), entries.add(CoreModel.newSourceEntry(sourceFolder.getFullPath(),
new IPath[] { buildFolder.getFullPath() })); new IPath[] { buildFolder.getFullPath() }));
} }
} else { } else {
entries.add(CoreModel.newSourceEntry(getProject().getFullPath())); entries.add(CoreModel.newSourceEntry(getProject().getFullPath()));
} }
} }
entries.add(CoreModel.newOutputEntry(buildFolder.getFullPath())); entries.add(CoreModel.newOutputEntry(buildFolder.getFullPath()));
CoreModel.getDefault().create(project) CoreModel.getDefault().create(project)
.setRawPathEntries(entries.toArray(new IPathEntry[entries.size()]), monitor); .setRawPathEntries(entries.toArray(new IPathEntry[entries.size()]), monitor);
} }
} }

View file

@ -1,93 +1,93 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2011 IBM Corporation and others. * Copyright (c) 2004, 2011 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* IBM - Initial API and implementation * IBM - Initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.make.internal.core.scannerconfig2; package org.eclipse.cdt.make.internal.core.scannerconfig2;
import java.util.List; import java.util.List;
import org.eclipse.cdt.core.CCProjectNature; import org.eclipse.cdt.core.CCProjectNature;
import org.eclipse.cdt.core.CProjectNature; import org.eclipse.cdt.core.CProjectNature;
import org.eclipse.cdt.make.core.MakeCorePlugin; import org.eclipse.cdt.make.core.MakeCorePlugin;
import org.eclipse.cdt.make.core.scannerconfig.ScannerInfoTypes; import org.eclipse.cdt.make.core.scannerconfig.ScannerInfoTypes;
import org.eclipse.cdt.make.internal.core.scannerconfig.gnu.GCCScannerConfigUtil; import org.eclipse.cdt.make.internal.core.scannerconfig.gnu.GCCScannerConfigUtil;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
/** /**
* Runs a command to retrieve compiler intrinsic scanner info from 'specs' file. * Runs a command to retrieve compiler intrinsic scanner info from 'specs' file.
* *
* @author vhirsl * @author vhirsl
*/ */
public class GCCSpecsRunSIProvider extends DefaultRunSIProvider { public class GCCSpecsRunSIProvider extends DefaultRunSIProvider {
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.make.internal.core.scannerconfig2.DefaultRunSIProvider#initialize() * @see org.eclipse.cdt.make.internal.core.scannerconfig2.DefaultRunSIProvider#initialize()
*/ */
@Override @Override
protected boolean initialize() { protected boolean initialize() {
boolean rc = super.initialize(); boolean rc = super.initialize();
if (rc) { if (rc) {
String targetFile = "dummy"; //$NON-NLS-1$ String targetFile = "dummy"; //$NON-NLS-1$
IProject project = resource.getProject(); IProject project = resource.getProject();
try { try {
if (project.hasNature(CCProjectNature.CC_NATURE_ID)) { if (project.hasNature(CCProjectNature.CC_NATURE_ID)) {
targetFile = GCCScannerConfigUtil.CPP_SPECS_FILE; targetFile = GCCScannerConfigUtil.CPP_SPECS_FILE;
} }
else if (project.hasNature(CProjectNature.C_NATURE_ID)) { else if (project.hasNature(CProjectNature.C_NATURE_ID)) {
targetFile = GCCScannerConfigUtil.C_SPECS_FILE; targetFile = GCCScannerConfigUtil.C_SPECS_FILE;
} }
// replace string variables in compile arguments // replace string variables in compile arguments
// TODO Vmir - use string variable replacement // TODO Vmir - use string variable replacement
for (int i = 0; i < fCompileArguments.length; ++i) { for (int i = 0; i < fCompileArguments.length; ++i) {
fCompileArguments[i] = fCompileArguments[i].replaceAll("\\$\\{plugin_state_location\\}", //$NON-NLS-1$ fCompileArguments[i] = fCompileArguments[i].replaceAll("\\$\\{plugin_state_location\\}", //$NON-NLS-1$
MakeCorePlugin.getWorkingDirectory().toString()); MakeCorePlugin.getWorkingDirectory().toString());
fCompileArguments[i] = fCompileArguments[i].replaceAll("\\$\\{specs_file\\}", targetFile); //$NON-NLS-1$ fCompileArguments[i] = fCompileArguments[i].replaceAll("\\$\\{specs_file\\}", targetFile); //$NON-NLS-1$
} }
} catch (CoreException e) { } catch (CoreException e) {
//TODO VMIR better error handling //TODO VMIR better error handling
MakeCorePlugin.log(e.getStatus()); MakeCorePlugin.log(e.getStatus());
rc = false; rc = false;
} }
} }
return rc; return rc;
} }
/* (non-Javadoc) /* (non-Javadoc)
* @see org.eclipse.cdt.make.internal.core.scannerconfig2.DefaultRunSIProvider#prepareArguments(boolean) * @see org.eclipse.cdt.make.internal.core.scannerconfig2.DefaultRunSIProvider#prepareArguments(boolean)
*/ */
@Override @Override
protected String[] prepareArguments(boolean isDefaultCommand) { protected String[] prepareArguments(boolean isDefaultCommand) {
if (collector == null) if (collector == null)
return fCompileArguments; return fCompileArguments;
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
List<String> tso = collector.getCollectedScannerInfo(resource.getProject(), ScannerInfoTypes.TARGET_SPECIFIC_OPTION); List<String> tso = collector.getCollectedScannerInfo(resource.getProject(), ScannerInfoTypes.TARGET_SPECIFIC_OPTION);
if (tso == null || tso.size() == 0) { if (tso == null || tso.size() == 0) {
return fCompileArguments; return fCompileArguments;
} }
String[] rv = null; String[] rv = null;
// commandArguments may have multiple arguments; tokenizing // commandArguments may have multiple arguments; tokenizing
int nTokens = 0; int nTokens = 0;
if (fCompileArguments != null && fCompileArguments.length > 0) { if (fCompileArguments != null && fCompileArguments.length > 0) {
nTokens = fCompileArguments.length; nTokens = fCompileArguments.length;
rv = new String[nTokens + tso.size()]; rv = new String[nTokens + tso.size()];
System.arraycopy(fCompileArguments, 0, rv, 0, nTokens); System.arraycopy(fCompileArguments, 0, rv, 0, nTokens);
} }
else { else {
rv = new String[tso.size()]; rv = new String[tso.size()];
} }
for (int i = 0; i < tso.size(); ++i) { for (int i = 0; i < tso.size(); ++i) {
rv[nTokens + i] = tso.get(i); rv[nTokens + i] = tso.get(i);
} }
return rv; return rv;
} }
} }

View file

@ -1,25 +1,25 @@
PROJECT_ROOT = $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) PROJECT_ROOT = $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
OBJS = ${projectName}.o OBJS = ${projectName}.o
ifeq ($(BUILD_MODE),debug) ifeq ($(BUILD_MODE),debug)
CFLAGS += -g CFLAGS += -g
else ifeq ($(BUILD_MODE),run) else ifeq ($(BUILD_MODE),run)
CFLAGS += -O2 CFLAGS += -O2
else else
$(error Build mode $(BUILD_MODE) not supported by this Makefile) $(error Build mode $(BUILD_MODE) not supported by this Makefile)
endif endif
all: ${projectName} all: ${projectName}
${projectName}: $(OBJS) ${projectName}: $(OBJS)
$(CXX) -o $@ $^ $(CXX) -o $@ $^
%.o: $(PROJECT_ROOT)%.cpp %.o: $(PROJECT_ROOT)%.cpp
$(CXX) -c $(CFLAGS) $(CXXFLAGS) $(CPPFLAGS) -o $@ $< $(CXX) -c $(CFLAGS) $(CXXFLAGS) $(CPPFLAGS) -o $@ $<
%.o: $(PROJECT_ROOT)%.c %.o: $(PROJECT_ROOT)%.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $< $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $<
clean: clean:
rm -fr ${projectName} $(OBJS) rm -fr ${projectName} $(OBJS)

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

View file

@ -1,6 +1,6 @@
source.. = src/ source.. = src/
output.. = bin/ output.. = bin/
bin.includes = META-INF/,\ bin.includes = META-INF/,\
.,\ .,\
about.html about.html
src.includes = about.html src.includes = about.html

View file

@ -1,20 +1,20 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2013, 2013 Andrew Gvozdev and others. * Copyright (c) 2013, 2013 Andrew Gvozdev and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Andrew Gvozdev - initial API and implementation * Andrew Gvozdev - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.make.ui.tests; package org.eclipse.cdt.make.ui.tests;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.junit.runners.Suite; import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses; import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class) @RunWith(Suite.class)
@SuiteClasses({ MakeUIImagesTest.class }) @SuiteClasses({ MakeUIImagesTest.class })
public class AutomatedIntegrationSuite { public class AutomatedIntegrationSuite {
} }

View file

@ -1,118 +1,118 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2013, 2013 Andrew Gvozdev and others. * Copyright (c) 2013, 2013 Andrew Gvozdev and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Andrew Gvozdev - initial API and implementation * Andrew Gvozdev - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.make.ui.tests; package org.eclipse.cdt.make.ui.tests;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotSame; import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertSame; import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import java.lang.reflect.Field; import java.lang.reflect.Field;
import java.lang.reflect.Modifier; import java.lang.reflect.Modifier;
import java.net.URL; import java.net.URL;
import org.eclipse.cdt.make.internal.ui.MakeUIImages; import org.eclipse.cdt.make.internal.ui.MakeUIImages;
import org.eclipse.cdt.make.internal.ui.MakeUIPlugin; import org.eclipse.cdt.make.internal.ui.MakeUIPlugin;
import org.eclipse.core.runtime.FileLocator; import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Path;
import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.IDecoration; import org.eclipse.jface.viewers.IDecoration;
import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.Image;
import org.junit.Test; import org.junit.Test;
public class MakeUIImagesTest { public class MakeUIImagesTest {
private static final ImageDescriptor MISSING_IMAGE_DESCRIPTOR = ImageDescriptor.getMissingImageDescriptor(); private static final ImageDescriptor MISSING_IMAGE_DESCRIPTOR = ImageDescriptor.getMissingImageDescriptor();
// sample image (IMG_ETOOL_MAKEFILE) from MakeUIPlugin bundle // sample image (IMG_ETOOL_MAKEFILE) from MakeUIPlugin bundle
private static final String KEY_ETOOL_MAKEFILE = MakeUIImages.IMG_ETOOL_MAKEFILE; private static final String KEY_ETOOL_MAKEFILE = MakeUIImages.IMG_ETOOL_MAKEFILE;
private static final IPath PATH_ETOOL_MAKEFILE = new Path("icons/etool16/makefile.gif"); private static final IPath PATH_ETOOL_MAKEFILE = new Path("icons/etool16/makefile.gif");
private static final URL URL_ETOOL_MAKEFILE= FileLocator.find(MakeUIPlugin.getDefault().getBundle(), PATH_ETOOL_MAKEFILE, null); private static final URL URL_ETOOL_MAKEFILE= FileLocator.find(MakeUIPlugin.getDefault().getBundle(), PATH_ETOOL_MAKEFILE, null);
/** /**
* Handling of missing keys. * Handling of missing keys.
*/ */
@Test @Test
public void testNoImage() throws Exception { public void testNoImage() throws Exception {
ImageDescriptor descriptor = MakeUIImages.getImageDescriptor("missing key 1"); ImageDescriptor descriptor = MakeUIImages.getImageDescriptor("missing key 1");
assertSame(MISSING_IMAGE_DESCRIPTOR, descriptor); assertSame(MISSING_IMAGE_DESCRIPTOR, descriptor);
Image image1 = MakeUIImages.getImage("missing key 1"); Image image1 = MakeUIImages.getImage("missing key 1");
Image image2 = MakeUIImages.getImage("missing key 2"); Image image2 = MakeUIImages.getImage("missing key 2");
assertSame(image1, image2); assertSame(image1, image2);
} }
/** /**
* Test regular images. * Test regular images.
*/ */
@Test @Test
public void testImage() throws Exception { public void testImage() throws Exception {
// create descriptor from MakeUIImages key // create descriptor from MakeUIImages key
ImageDescriptor descriptorFromKey = MakeUIImages.getImageDescriptor(KEY_ETOOL_MAKEFILE); ImageDescriptor descriptorFromKey = MakeUIImages.getImageDescriptor(KEY_ETOOL_MAKEFILE);
assertNotSame(MISSING_IMAGE_DESCRIPTOR, descriptorFromKey); assertNotSame(MISSING_IMAGE_DESCRIPTOR, descriptorFromKey);
// create descriptor from registered bundle URL as a key // create descriptor from registered bundle URL as a key
MakeUIImages.register(URL_ETOOL_MAKEFILE); MakeUIImages.register(URL_ETOOL_MAKEFILE);
ImageDescriptor descriptorFromUrl = MakeUIImages.getImageDescriptor(URL_ETOOL_MAKEFILE.toString()); ImageDescriptor descriptorFromUrl = MakeUIImages.getImageDescriptor(URL_ETOOL_MAKEFILE.toString());
assertNotSame(MISSING_IMAGE_DESCRIPTOR, descriptorFromUrl); assertNotSame(MISSING_IMAGE_DESCRIPTOR, descriptorFromUrl);
assertSame(descriptorFromKey, descriptorFromUrl); assertSame(descriptorFromKey, descriptorFromUrl);
// verify that it is the same image // verify that it is the same image
Image imageFromKey = MakeUIImages.getImage(KEY_ETOOL_MAKEFILE); Image imageFromKey = MakeUIImages.getImage(KEY_ETOOL_MAKEFILE);
Image imageFromUrl = MakeUIImages.getImage(URL_ETOOL_MAKEFILE.toString()); Image imageFromUrl = MakeUIImages.getImage(URL_ETOOL_MAKEFILE.toString());
assertSame(imageFromKey, imageFromUrl); assertSame(imageFromKey, imageFromUrl);
// verify that no leaks on second access // verify that no leaks on second access
Image imageFromKey2 = MakeUIImages.getImage(KEY_ETOOL_MAKEFILE); Image imageFromKey2 = MakeUIImages.getImage(KEY_ETOOL_MAKEFILE);
assertSame(imageFromKey, imageFromKey2); assertSame(imageFromKey, imageFromKey2);
} }
/** /**
* Test images with overlays. * Test images with overlays.
*/ */
@Test @Test
public void testOverlays() throws Exception { public void testOverlays() throws Exception {
{ {
Image image1 = MakeUIImages.getImageOverlaid(KEY_ETOOL_MAKEFILE, new String[5]); Image image1 = MakeUIImages.getImageOverlaid(KEY_ETOOL_MAKEFILE, new String[5]);
Image image2 = MakeUIImages.getImage(KEY_ETOOL_MAKEFILE); Image image2 = MakeUIImages.getImage(KEY_ETOOL_MAKEFILE);
assertSame(image1, image2); assertSame(image1, image2);
} }
{ {
String[] overlayKeys = new String[5]; String[] overlayKeys = new String[5];
overlayKeys[IDecoration.BOTTOM_LEFT] = MakeUIImages.IMG_OVR_AUTOMATIC; overlayKeys[IDecoration.BOTTOM_LEFT] = MakeUIImages.IMG_OVR_AUTOMATIC;
Image imageOver1 = MakeUIImages.getImageOverlaid(KEY_ETOOL_MAKEFILE, overlayKeys); Image imageOver1 = MakeUIImages.getImageOverlaid(KEY_ETOOL_MAKEFILE, overlayKeys);
Image imageOver2 = MakeUIImages.getImageOverlaid(KEY_ETOOL_MAKEFILE, MakeUIImages.IMG_OVR_AUTOMATIC, IDecoration.BOTTOM_LEFT); Image imageOver2 = MakeUIImages.getImageOverlaid(KEY_ETOOL_MAKEFILE, MakeUIImages.IMG_OVR_AUTOMATIC, IDecoration.BOTTOM_LEFT);
assertSame(imageOver1, imageOver2); assertSame(imageOver1, imageOver2);
} }
} }
/** /**
* Verify that MakeUIImages constants define existing images. * Verify that MakeUIImages constants define existing images.
*/ */
@Test @Test
public void testVerifyFields() throws Exception { public void testVerifyFields() throws Exception {
Class<MakeUIImages> clazz = MakeUIImages.class; Class<MakeUIImages> clazz = MakeUIImages.class;
Field[] fields = clazz.getDeclaredFields(); Field[] fields = clazz.getDeclaredFields();
for (Field field : fields) { for (Field field : fields) {
String name = field.getName(); String name = field.getName();
if (name.startsWith("IMG_")) { if (name.startsWith("IMG_")) {
assertEquals("MakeUIImages."+name+" is not a String", String.class, field.getType()); assertEquals("MakeUIImages."+name+" is not a String", String.class, field.getType());
assertTrue("MakeUIImages."+name+" is not a static field", (field.getModifiers() & Modifier.STATIC) != 0); assertTrue("MakeUIImages."+name+" is not a static field", (field.getModifiers() & Modifier.STATIC) != 0);
assertTrue("MakeUIImages."+name+" is not a public field", (field.getModifiers() & Modifier.PUBLIC) != 0); assertTrue("MakeUIImages."+name+" is not a public field", (field.getModifiers() & Modifier.PUBLIC) != 0);
String imageKey = (String) field.get(null); String imageKey = (String) field.get(null);
ImageDescriptor descriptor = MakeUIImages.getImageDescriptor(imageKey); ImageDescriptor descriptor = MakeUIImages.getImageDescriptor(imageKey);
assertTrue("Missing image MakeUIImages."+name+"=\""+imageKey+"\"", descriptor!=MISSING_IMAGE_DESCRIPTOR); assertTrue("Missing image MakeUIImages."+name+"=\""+imageKey+"\"", descriptor!=MISSING_IMAGE_DESCRIPTOR);
} }
} }
} }
} }

View file

@ -1,63 +1,63 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2013, 2013 Andrew Gvozdev and others. * Copyright (c) 2013, 2013 Andrew Gvozdev and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Andrew Gvozdev - initial API and implementation * Andrew Gvozdev - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.make.ui.tests; package org.eclipse.cdt.make.ui.tests;
import java.io.IOException; import java.io.IOException;
import org.eclipse.cdt.core.testplugin.util.TestSourceReader; import org.eclipse.cdt.core.testplugin.util.TestSourceReader;
import org.junit.Rule; import org.junit.Rule;
import org.junit.rules.TestName; import org.junit.rules.TestName;
/** /**
* Base for unit testing of Make UI test suite. * Base for unit testing of Make UI test suite.
*/ */
public class MakeUITestBase { public class MakeUITestBase {
@Rule @Rule
public TestName testNameRule = new TestName(); public TestName testNameRule = new TestName();
private TestSourceReader commentReader; private TestSourceReader commentReader;
/** /**
* Constructor. * Constructor.
*/ */
protected MakeUITestBase() { protected MakeUITestBase() {
this("src"); this("src");
} }
/** /**
* Constructor. * Constructor.
* *
* @param srcRoot - project folder where the test package is rooted. * @param srcRoot - project folder where the test package is rooted.
*/ */
protected MakeUITestBase(String srcRoot) { protected MakeUITestBase(String srcRoot) {
this.commentReader = new TestSourceReader(MakeUITestsPlugin.getDefault().getBundle(), srcRoot, this.getClass(), 1); this.commentReader = new TestSourceReader(MakeUITestsPlugin.getDefault().getBundle(), srcRoot, this.getClass(), 1);
} }
/** /**
* Get name of the current test method. * Get name of the current test method.
* *
* @return Name of the current test method. * @return Name of the current test method.
*/ */
public String getName() { public String getName() {
return testNameRule.getMethodName(); return testNameRule.getMethodName();
} }
/** /**
* Retrieve comments above the current test method. * Retrieve comments above the current test method.
* *
* @return First section of comments above the current test method. * @return First section of comments above the current test method.
* A sections is defined as a block of comments starting with "//". Sections are separated by empty lines. * A sections is defined as a block of comments starting with "//". Sections are separated by empty lines.
* @throws IOException * @throws IOException
*/ */
public StringBuilder getTestComments() throws IOException { public StringBuilder getTestComments() throws IOException {
return commentReader.getContentsForTest(getName())[0]; return commentReader.getContentsForTest(getName())[0];
} }
} }

View file

@ -1,53 +1,53 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2013, 2013 Andrew Gvozdev and others. * Copyright (c) 2013, 2013 Andrew Gvozdev and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Andrew Gvozdev - initial API and implementation * Andrew Gvozdev - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.make.ui.tests; package org.eclipse.cdt.make.ui.tests;
import org.eclipse.ui.plugin.AbstractUIPlugin; import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext; import org.osgi.framework.BundleContext;
/** /**
* The activator class controls the plug-in life cycle * The activator class controls the plug-in life cycle
*/ */
public class MakeUITestsPlugin extends AbstractUIPlugin { public class MakeUITestsPlugin extends AbstractUIPlugin {
// The plug-in ID // The plug-in ID
public static final String PLUGIN_ID = "org.eclipse.cdt.make.ui.tests"; //$NON-NLS-1$ public static final String PLUGIN_ID = "org.eclipse.cdt.make.ui.tests"; //$NON-NLS-1$
// The shared instance // The shared instance
private static MakeUITestsPlugin plugin; private static MakeUITestsPlugin plugin;
/** /**
* The constructor * The constructor
*/ */
public MakeUITestsPlugin() { public MakeUITestsPlugin() {
} }
@Override @Override
public void start(BundleContext context) throws Exception { public void start(BundleContext context) throws Exception {
super.start(context); super.start(context);
plugin = this; plugin = this;
} }
@Override @Override
public void stop(BundleContext context) throws Exception { public void stop(BundleContext context) throws Exception {
plugin = null; plugin = null;
super.stop(context); super.stop(context);
} }
/** /**
* Returns the shared instance * Returns the shared instance
* *
* @return the shared instance * @return the shared instance
*/ */
public static MakeUITestsPlugin getDefault() { public static MakeUITestsPlugin getDefault() {
return plugin; return plugin;
} }
} }

View file

@ -1,214 +1,214 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2017 QNX Software Systems and others. * Copyright (c) 2017 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.make.internal.ui; package org.eclipse.cdt.make.internal.ui;
import java.util.Map; import java.util.Map;
import org.eclipse.cdt.core.build.ICBuildConfiguration; import org.eclipse.cdt.core.build.ICBuildConfiguration;
import org.eclipse.cdt.core.build.StandardBuildConfiguration; import org.eclipse.cdt.core.build.StandardBuildConfiguration;
import org.eclipse.cdt.launch.ui.corebuild.CommonBuildTab; import org.eclipse.cdt.launch.ui.corebuild.CommonBuildTab;
import org.eclipse.cdt.make.core.MakefileBuildConfigurationProvider; import org.eclipse.cdt.make.core.MakefileBuildConfigurationProvider;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path; import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.ILaunchConfiguration; import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy; import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.Text;
public class MakeBuildSettingsTab extends CommonBuildTab { public class MakeBuildSettingsTab extends CommonBuildTab {
private Button projectButton; private Button projectButton;
private Button configButton; private Button configButton;
private Text buildCmdText; private Text buildCmdText;
private Text cleanCmdText; private Text cleanCmdText;
private boolean defaultProject; private boolean defaultProject;
@Override @Override
protected String getBuildConfigProviderId() { protected String getBuildConfigProviderId() {
return MakefileBuildConfigurationProvider.ID; return MakefileBuildConfigurationProvider.ID;
} }
@Override @Override
public void createControl(Composite parent) { public void createControl(Composite parent) {
Composite comp = new Composite(parent, SWT.NONE); Composite comp = new Composite(parent, SWT.NONE);
comp.setLayout(new GridLayout()); comp.setLayout(new GridLayout());
setControl(comp); setControl(comp);
// Toolchain selector // Toolchain selector
Control tcControl = createToolchainSelector(comp); Control tcControl = createToolchainSelector(comp);
tcControl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); tcControl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
// Build Output Group // Build Output Group
Group outputGroup = new Group(comp, SWT.NONE); Group outputGroup = new Group(comp, SWT.NONE);
outputGroup.setText(Messages.MakeBuildSettingsTab_BuildOutputLocation); outputGroup.setText(Messages.MakeBuildSettingsTab_BuildOutputLocation);
outputGroup.setLayout(new GridLayout()); outputGroup.setLayout(new GridLayout());
outputGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); outputGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
projectButton = new Button(outputGroup, SWT.RADIO); projectButton = new Button(outputGroup, SWT.RADIO);
projectButton.setText(Messages.MakeBuildSettingsTab_BuildInProjectDir); projectButton.setText(Messages.MakeBuildSettingsTab_BuildInProjectDir);
projectButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); projectButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
configButton = new Button(outputGroup, SWT.RADIO); configButton = new Button(outputGroup, SWT.RADIO);
configButton.setText(Messages.MakeBuildSettingsTab_BuildInConfigDir); configButton.setText(Messages.MakeBuildSettingsTab_BuildInConfigDir);
configButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); configButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
Group cmdGroup = new Group(comp, SWT.NONE); Group cmdGroup = new Group(comp, SWT.NONE);
cmdGroup.setText(Messages.MakeBuildSettingsTab_BuildCommands); cmdGroup.setText(Messages.MakeBuildSettingsTab_BuildCommands);
cmdGroup.setLayout(new GridLayout(2, false)); cmdGroup.setLayout(new GridLayout(2, false));
cmdGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); cmdGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
Label label = new Label(cmdGroup, SWT.NONE); Label label = new Label(cmdGroup, SWT.NONE);
label.setText(Messages.MakeBuildSettingsTab_Build); label.setText(Messages.MakeBuildSettingsTab_Build);
buildCmdText = new Text(cmdGroup, SWT.BORDER); buildCmdText = new Text(cmdGroup, SWT.BORDER);
buildCmdText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); buildCmdText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
label = new Label(cmdGroup, SWT.NONE); label = new Label(cmdGroup, SWT.NONE);
label.setText(Messages.MakeBuildSettingsTab_Clean); label.setText(Messages.MakeBuildSettingsTab_Clean);
cleanCmdText = new Text(cmdGroup, SWT.BORDER); cleanCmdText = new Text(cmdGroup, SWT.BORDER);
cleanCmdText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); cleanCmdText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
} }
@Override @Override
public String getName() { public String getName() {
return Messages.MakeBuildSettingsTab_Makefile; return Messages.MakeBuildSettingsTab_Makefile;
} }
@Override @Override
protected void restoreProperties(Map<String, String> properties) { protected void restoreProperties(Map<String, String> properties) {
// TODO Auto-generated method stub // TODO Auto-generated method stub
super.restoreProperties(properties); super.restoreProperties(properties);
String container = properties.get(StandardBuildConfiguration.BUILD_CONTAINER); String container = properties.get(StandardBuildConfiguration.BUILD_CONTAINER);
if (container != null && !container.trim().isEmpty()) { if (container != null && !container.trim().isEmpty()) {
IPath containerLoc = new Path(container); IPath containerLoc = new Path(container);
if (containerLoc.segmentCount() == 1) { if (containerLoc.segmentCount() == 1) {
// TODO what if it's not the project? // TODO what if it's not the project?
projectButton.setSelection(true); projectButton.setSelection(true);
defaultProject = true; defaultProject = true;
} else { } else {
configButton.setSelection(true); configButton.setSelection(true);
defaultProject = false; defaultProject = false;
} }
} }
String buildCommand = properties.get(StandardBuildConfiguration.BUILD_COMMAND); String buildCommand = properties.get(StandardBuildConfiguration.BUILD_COMMAND);
if (buildCommand != null && !buildCommand.trim().isEmpty()) { if (buildCommand != null && !buildCommand.trim().isEmpty()) {
buildCmdText.setText(buildCommand); buildCmdText.setText(buildCommand);
} }
String cleanCommand = properties.get(StandardBuildConfiguration.CLEAN_COMMAND); String cleanCommand = properties.get(StandardBuildConfiguration.CLEAN_COMMAND);
if (cleanCommand != null && !cleanCommand.trim().isEmpty()) { if (cleanCommand != null && !cleanCommand.trim().isEmpty()) {
cleanCmdText.setText(cleanCommand); cleanCmdText.setText(cleanCommand);
} }
} }
@Override @Override
protected void saveProperties(Map<String, String> properties) { protected void saveProperties(Map<String, String> properties) {
super.saveProperties(properties); super.saveProperties(properties);
try { try {
ICBuildConfiguration buildConfig = getBuildConfiguration(); ICBuildConfiguration buildConfig = getBuildConfiguration();
if (buildConfig instanceof StandardBuildConfiguration) { if (buildConfig instanceof StandardBuildConfiguration) {
StandardBuildConfiguration stdConfig = (StandardBuildConfiguration) buildConfig; StandardBuildConfiguration stdConfig = (StandardBuildConfiguration) buildConfig;
if (defaultProject && !projectButton.getSelection()) { if (defaultProject && !projectButton.getSelection()) {
properties.put(StandardBuildConfiguration.BUILD_CONTAINER, properties.put(StandardBuildConfiguration.BUILD_CONTAINER,
stdConfig.getDefaultBuildContainer().getFullPath().toString()); stdConfig.getDefaultBuildContainer().getFullPath().toString());
} else if (!defaultProject && projectButton.getSelection()) { } else if (!defaultProject && projectButton.getSelection()) {
properties.put(StandardBuildConfiguration.BUILD_CONTAINER, properties.put(StandardBuildConfiguration.BUILD_CONTAINER,
stdConfig.getProject().getFullPath().toString()); stdConfig.getProject().getFullPath().toString());
} }
String buildCommand = buildCmdText.getText().trim(); String buildCommand = buildCmdText.getText().trim();
if (!buildCommand.isEmpty()) { if (!buildCommand.isEmpty()) {
properties.put(StandardBuildConfiguration.BUILD_COMMAND, buildCommand); properties.put(StandardBuildConfiguration.BUILD_COMMAND, buildCommand);
} }
String cleanCommand = cleanCmdText.getText().trim(); String cleanCommand = cleanCmdText.getText().trim();
if (!cleanCommand.isEmpty()) { if (!cleanCommand.isEmpty()) {
properties.put(StandardBuildConfiguration.CLEAN_COMMAND, cleanCommand); properties.put(StandardBuildConfiguration.CLEAN_COMMAND, cleanCommand);
} }
} }
} catch (CoreException e) { } catch (CoreException e) {
MakeUIPlugin.log(e.getStatus()); MakeUIPlugin.log(e.getStatus());
} }
} }
@Override @Override
public void initializeFrom(ILaunchConfiguration configuration) { public void initializeFrom(ILaunchConfiguration configuration) {
super.initializeFrom(configuration); super.initializeFrom(configuration);
ICBuildConfiguration buildConfig = getBuildConfiguration(); ICBuildConfiguration buildConfig = getBuildConfiguration();
String container = buildConfig.getProperty(StandardBuildConfiguration.BUILD_CONTAINER); String container = buildConfig.getProperty(StandardBuildConfiguration.BUILD_CONTAINER);
if (container != null && !container.trim().isEmpty()) { if (container != null && !container.trim().isEmpty()) {
IPath containerLoc = new Path(container); IPath containerLoc = new Path(container);
if (containerLoc.segmentCount() == 1) { if (containerLoc.segmentCount() == 1) {
// TODO what if it's not the project? // TODO what if it's not the project?
projectButton.setSelection(true); projectButton.setSelection(true);
defaultProject = true; defaultProject = true;
} else { } else {
configButton.setSelection(true); configButton.setSelection(true);
defaultProject = false; defaultProject = false;
} }
} }
String buildCommand = buildConfig.getProperty(StandardBuildConfiguration.BUILD_COMMAND); String buildCommand = buildConfig.getProperty(StandardBuildConfiguration.BUILD_COMMAND);
if (buildCommand != null && !buildCommand.trim().isEmpty()) { if (buildCommand != null && !buildCommand.trim().isEmpty()) {
buildCmdText.setText(buildCommand); buildCmdText.setText(buildCommand);
} }
String cleanCommand = buildConfig.getProperty(StandardBuildConfiguration.CLEAN_COMMAND); String cleanCommand = buildConfig.getProperty(StandardBuildConfiguration.CLEAN_COMMAND);
if (cleanCommand != null && !cleanCommand.trim().isEmpty()) { if (cleanCommand != null && !cleanCommand.trim().isEmpty()) {
cleanCmdText.setText(cleanCommand); cleanCmdText.setText(cleanCommand);
} }
} }
@Override @Override
public void performApply(ILaunchConfigurationWorkingCopy configuration) { public void performApply(ILaunchConfigurationWorkingCopy configuration) {
super.performApply(configuration); super.performApply(configuration);
try { try {
ICBuildConfiguration buildConfig = getBuildConfiguration(); ICBuildConfiguration buildConfig = getBuildConfiguration();
if (buildConfig instanceof StandardBuildConfiguration) { if (buildConfig instanceof StandardBuildConfiguration) {
StandardBuildConfiguration stdConfig = (StandardBuildConfiguration) buildConfig; StandardBuildConfiguration stdConfig = (StandardBuildConfiguration) buildConfig;
if (defaultProject && !projectButton.getSelection()) { if (defaultProject && !projectButton.getSelection()) {
stdConfig.setBuildContainer(stdConfig.getDefaultBuildContainer()); stdConfig.setBuildContainer(stdConfig.getDefaultBuildContainer());
} else if (!defaultProject && projectButton.getSelection()) { } else if (!defaultProject && projectButton.getSelection()) {
stdConfig.setBuildContainer(stdConfig.getProject()); stdConfig.setBuildContainer(stdConfig.getProject());
} }
String buildCommand = buildCmdText.getText().trim(); String buildCommand = buildCmdText.getText().trim();
if (!buildCommand.isEmpty()) { if (!buildCommand.isEmpty()) {
stdConfig.setBuildCommand(buildCommand.split(" ")); //$NON-NLS-1$ stdConfig.setBuildCommand(buildCommand.split(" ")); //$NON-NLS-1$
} else { } else {
stdConfig.setBuildCommand(null); stdConfig.setBuildCommand(null);
} }
String cleanCommand = cleanCmdText.getText().trim(); String cleanCommand = cleanCmdText.getText().trim();
if (!cleanCommand.isEmpty()) { if (!cleanCommand.isEmpty()) {
stdConfig.setCleanCommand(cleanCommand.split(" ")); //$NON-NLS-1$ stdConfig.setCleanCommand(cleanCommand.split(" ")); //$NON-NLS-1$
} else { } else {
stdConfig.setCleanCommand(null); stdConfig.setCleanCommand(null);
} }
} }
} catch (CoreException e) { } catch (CoreException e) {
MakeUIPlugin.log(e.getStatus()); MakeUIPlugin.log(e.getStatus());
} }
} }
} }

View file

@ -1,21 +1,21 @@
package org.eclipse.cdt.make.internal.ui; package org.eclipse.cdt.make.internal.ui;
import org.eclipse.osgi.util.NLS; import org.eclipse.osgi.util.NLS;
public class Messages extends NLS { public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.eclipse.cdt.make.internal.ui.messages"; //$NON-NLS-1$ private static final String BUNDLE_NAME = "org.eclipse.cdt.make.internal.ui.messages"; //$NON-NLS-1$
public static String MakeBuildSettingsTab_Build; public static String MakeBuildSettingsTab_Build;
public static String MakeBuildSettingsTab_BuildCommands; public static String MakeBuildSettingsTab_BuildCommands;
public static String MakeBuildSettingsTab_BuildInConfigDir; public static String MakeBuildSettingsTab_BuildInConfigDir;
public static String MakeBuildSettingsTab_BuildInProjectDir; public static String MakeBuildSettingsTab_BuildInProjectDir;
public static String MakeBuildSettingsTab_BuildOutputLocation; public static String MakeBuildSettingsTab_BuildOutputLocation;
public static String MakeBuildSettingsTab_Clean; public static String MakeBuildSettingsTab_Clean;
public static String MakeBuildSettingsTab_Makefile; public static String MakeBuildSettingsTab_Makefile;
static { static {
// initialize resource bundle // initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class); NLS.initializeMessages(BUNDLE_NAME, Messages.class);
} }
private Messages() { private Messages() {
} }
} }

View file

@ -1,7 +1,7 @@
MakeBuildSettingsTab_Build=Build: MakeBuildSettingsTab_Build=Build:
MakeBuildSettingsTab_BuildCommands=Build Commands MakeBuildSettingsTab_BuildCommands=Build Commands
MakeBuildSettingsTab_BuildInConfigDir=Build in configuration specific directory MakeBuildSettingsTab_BuildInConfigDir=Build in configuration specific directory
MakeBuildSettingsTab_BuildInProjectDir=Build in project directory MakeBuildSettingsTab_BuildInProjectDir=Build in project directory
MakeBuildSettingsTab_BuildOutputLocation=Build Output Location MakeBuildSettingsTab_BuildOutputLocation=Build Output Location
MakeBuildSettingsTab_Clean=Clean: MakeBuildSettingsTab_Clean=Clean:
MakeBuildSettingsTab_Makefile=Makefile MakeBuildSettingsTab_Makefile=Makefile

View file

@ -1,78 +1,78 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2017 QNX Software Systems and others. * Copyright (c) 2017 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.make.internal.ui.wizards; package org.eclipse.cdt.make.internal.ui.wizards;
import org.eclipse.cdt.make.core.MakefileProjectGenerator; import org.eclipse.cdt.make.core.MakefileProjectGenerator;
import org.eclipse.jface.dialogs.Dialog; import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.wizard.IWizardContainer; import org.eclipse.jface.wizard.IWizardContainer;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Composite;
import org.eclipse.tools.templates.core.IGenerator; import org.eclipse.tools.templates.core.IGenerator;
import org.eclipse.tools.templates.ui.TemplateWizard; import org.eclipse.tools.templates.ui.TemplateWizard;
import org.eclipse.ui.dialogs.WizardNewProjectCreationPage; import org.eclipse.ui.dialogs.WizardNewProjectCreationPage;
public class NewMakefileProjectWizard extends TemplateWizard { public class NewMakefileProjectWizard extends TemplateWizard {
private WizardNewProjectCreationPage mainPage; private WizardNewProjectCreationPage mainPage;
private boolean generateSource = true; private boolean generateSource = true;
@Override @Override
public void setContainer(IWizardContainer wizardContainer) { public void setContainer(IWizardContainer wizardContainer) {
super.setContainer(wizardContainer); super.setContainer(wizardContainer);
setWindowTitle("New Makefile Project"); setWindowTitle("New Makefile Project");
} }
@Override @Override
public void addPages() { public void addPages() {
mainPage = new WizardNewProjectCreationPage("basicNewProjectPage") { //$NON-NLS-1$ mainPage = new WizardNewProjectCreationPage("basicNewProjectPage") { //$NON-NLS-1$
@Override @Override
public void createControl(Composite parent) { public void createControl(Composite parent) {
super.createControl(parent); super.createControl(parent);
Composite comp = (Composite) getControl(); Composite comp = (Composite) getControl();
createWorkingSetGroup(comp, getSelection(), createWorkingSetGroup(comp, getSelection(),
new String[] { "org.eclipse.ui.resourceWorkingSetPage" }); //$NON-NLS-1$ new String[] { "org.eclipse.ui.resourceWorkingSetPage" }); //$NON-NLS-1$
Composite buttonComp = new Composite(comp, SWT.NONE); Composite buttonComp = new Composite(comp, SWT.NONE);
buttonComp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); buttonComp.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
buttonComp.setLayout(new GridLayout()); buttonComp.setLayout(new GridLayout());
Button genSourceButton = new Button(buttonComp, SWT.CHECK); Button genSourceButton = new Button(buttonComp, SWT.CHECK);
genSourceButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false)); genSourceButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
genSourceButton.setText("Generate Source and Makefile"); genSourceButton.setText("Generate Source and Makefile");
genSourceButton.setSelection(generateSource); genSourceButton.setSelection(generateSource);
genSourceButton.addSelectionListener(new SelectionAdapter() { genSourceButton.addSelectionListener(new SelectionAdapter() {
@Override @Override
public void widgetSelected(SelectionEvent e) { public void widgetSelected(SelectionEvent e) {
generateSource = genSourceButton.getSelection(); generateSource = genSourceButton.getSelection();
} }
}); });
Dialog.applyDialogFont(getControl()); Dialog.applyDialogFont(getControl());
} }
}; };
mainPage.setTitle("New Makefile Project"); mainPage.setTitle("New Makefile Project");
mainPage.setDescription("Specify properties of new Makefile project."); mainPage.setDescription("Specify properties of new Makefile project.");
this.addPage(mainPage); this.addPage(mainPage);
} }
@Override @Override
protected IGenerator getGenerator() { protected IGenerator getGenerator() {
String manifest = generateSource ? "templates/simple/manifest.xml" : null; //$NON-NLS-1$ String manifest = generateSource ? "templates/simple/manifest.xml" : null; //$NON-NLS-1$
MakefileProjectGenerator generator = new MakefileProjectGenerator(manifest); MakefileProjectGenerator generator = new MakefileProjectGenerator(manifest);
generator.setProjectName(mainPage.getProjectName()); generator.setProjectName(mainPage.getProjectName());
if (!mainPage.useDefaults()) { if (!mainPage.useDefaults()) {
generator.setLocationURI(mainPage.getLocationURI()); generator.setLocationURI(mainPage.getLocationURI());
} }
return generator; return generator;
} }
} }

View file

@ -1,294 +1,294 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2011, 2012 QNX Software Systems and others. * Copyright (c) 2011, 2012 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* QNX Software Systems - Initial API and implementation * QNX Software Systems - Initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.managedbuilder.core.tests; package org.eclipse.cdt.managedbuilder.core.tests;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import junit.framework.Test; import junit.framework.Test;
import junit.framework.TestSuite; import junit.framework.TestSuite;
import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.settings.model.ICProjectDescription; import org.eclipse.cdt.core.settings.model.ICProjectDescription;
import org.eclipse.cdt.managedbuilder.core.IBuilder; import org.eclipse.cdt.managedbuilder.core.IBuilder;
import org.eclipse.cdt.managedbuilder.core.IConfiguration; import org.eclipse.cdt.managedbuilder.core.IConfiguration;
import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo; import org.eclipse.cdt.managedbuilder.core.IManagedBuildInfo;
import org.eclipse.cdt.managedbuilder.core.IToolChain; import org.eclipse.cdt.managedbuilder.core.IToolChain;
import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager; import org.eclipse.cdt.managedbuilder.core.ManagedBuildManager;
import org.eclipse.cdt.managedbuilder.internal.core.FolderInfo; import org.eclipse.cdt.managedbuilder.internal.core.FolderInfo;
import org.eclipse.cdt.managedbuilder.tcmodification.IConfigurationModification; import org.eclipse.cdt.managedbuilder.tcmodification.IConfigurationModification;
import org.eclipse.cdt.managedbuilder.tcmodification.IToolChainModificationManager; import org.eclipse.cdt.managedbuilder.tcmodification.IToolChainModificationManager;
import org.eclipse.cdt.managedbuilder.testplugin.AbstractBuilderTest; import org.eclipse.cdt.managedbuilder.testplugin.AbstractBuilderTest;
import org.eclipse.cdt.managedbuilder.testplugin.ManagedBuildTestHelper; import org.eclipse.cdt.managedbuilder.testplugin.ManagedBuildTestHelper;
import org.eclipse.core.resources.IContainer; import org.eclipse.core.resources.IContainer;
import org.eclipse.core.resources.IFile; import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IFolder; import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription; import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspaceDescription; import org.eclipse.core.resources.IWorkspaceDescription;
import org.eclipse.core.resources.IncrementalProjectBuilder; import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.core.runtime.OperationCanceledException;
public class ManagedBuildDependencyLibsTests extends AbstractBuilderTest { public class ManagedBuildDependencyLibsTests extends AbstractBuilderTest {
private static final String PROJ_PATH = "depLibsProjects"; private static final String PROJ_PATH = "depLibsProjects";
private static final String MESSAGE_TAIL = " (see .log file for more details)."; private static final String MESSAGE_TAIL = " (see .log file for more details).";
private IProject fTapp, fTlib, fTobjs; private IProject fTapp, fTlib, fTobjs;
private IToolChain[] allToolChains; private IToolChain[] allToolChains;
public ManagedBuildDependencyLibsTests(String name) { public ManagedBuildDependencyLibsTests(String name) {
super(name); super(name);
} }
public static Test suite() { public static Test suite() {
TestSuite suite = new TestSuite(ManagedBuildDependencyLibsTests.class.getName()); TestSuite suite = new TestSuite(ManagedBuildDependencyLibsTests.class.getName());
suite.addTest(new ManagedBuildDependencyLibsTests("testDepLibs")); suite.addTest(new ManagedBuildDependencyLibsTests("testDepLibs"));
suite.addTest(new ManagedBuildDependencyLibsTests("testDepUObjs")); suite.addTest(new ManagedBuildDependencyLibsTests("testDepUObjs"));
suite.addTest(new ManagedBuildDependencyLibsTests("testGetArtifactTimeStampEscapeURI_bug377295")); suite.addTest(new ManagedBuildDependencyLibsTests("testGetArtifactTimeStampEscapeURI_bug377295"));
return suite; return suite;
} }
private void buildProject(IProject curProject) { private void buildProject(IProject curProject) {
try { try {
IProject[] referencedProjects = curProject.getReferencedProjects(); IProject[] referencedProjects = curProject.getReferencedProjects();
for(int i = 0; i < referencedProjects.length; ++i) for(int i = 0; i < referencedProjects.length; ++i)
buildProject(referencedProjects[i]); buildProject(referencedProjects[i]);
// Build the project in order to generate the makefiles // Build the project in order to generate the makefiles
curProject.build(IncrementalProjectBuilder.INCREMENTAL_BUILD,new NullProgressMonitor()); curProject.build(IncrementalProjectBuilder.INCREMENTAL_BUILD,new NullProgressMonitor());
} }
catch(CoreException e){ catch(CoreException e){
fail(e.getStatus().getMessage()); fail(e.getStatus().getMessage());
} }
catch(OperationCanceledException e){ catch(OperationCanceledException e){
fail("the project \"" + curProject.getName() + "\" build was cancelled, exception message: " + e.getMessage()); fail("the project \"" + curProject.getName() + "\" build was cancelled, exception message: " + e.getMessage());
} }
} }
@Override @Override
protected void setUp() throws Exception { protected void setUp() throws Exception {
super.setUp(); super.setUp();
allToolChains = ManagedBuildManager. allToolChains = ManagedBuildManager.
getRealToolChains(); getRealToolChains();
IWorkspaceDescription wsDescription = ResourcesPlugin.getWorkspace().getDescription(); IWorkspaceDescription wsDescription = ResourcesPlugin.getWorkspace().getDescription();
wsDescription.setAutoBuilding(false); wsDescription.setAutoBuilding(false);
ResourcesPlugin.getWorkspace().setDescription(wsDescription); ResourcesPlugin.getWorkspace().setDescription(wsDescription);
assertNotNull("Cannot create tapp project", assertNotNull("Cannot create tapp project",
fTapp = ManagedBuildTestHelper.loadProject("tapp", PROJ_PATH)); fTapp = ManagedBuildTestHelper.loadProject("tapp", PROJ_PATH));
assertNotNull("Cannot create tlib project", assertNotNull("Cannot create tlib project",
fTlib = ManagedBuildTestHelper.loadProject("tlib", PROJ_PATH)); fTlib = ManagedBuildTestHelper.loadProject("tlib", PROJ_PATH));
assertNotNull("Cannot create tobjs project", assertNotNull("Cannot create tobjs project",
fTobjs = ManagedBuildTestHelper.loadProject("tobjs", PROJ_PATH)); fTobjs = ManagedBuildTestHelper.loadProject("tobjs", PROJ_PATH));
IProjectDescription projDescription = fTapp.getDescription(); IProjectDescription projDescription = fTapp.getDescription();
projDescription.setReferencedProjects(new IProject[] projDescription.setReferencedProjects(new IProject[]
{fTlib, fTobjs}); {fTlib, fTobjs});
fTapp.setDescription(projDescription, new NullProgressMonitor()); fTapp.setDescription(projDescription, new NullProgressMonitor());
IToolChain toolChain = setToolChain(fTapp, null); IToolChain toolChain = setToolChain(fTapp, null);
assertNotNull("No compatible tool chain.", toolChain); assertNotNull("No compatible tool chain.", toolChain);
setToolChain(fTlib, toolChain); setToolChain(fTlib, toolChain);
setToolChain(fTobjs, toolChain); setToolChain(fTobjs, toolChain);
} }
@Override @Override
protected void tearDown() throws Exception { protected void tearDown() throws Exception {
super.tearDown(); super.tearDown();
ManagedBuildTestHelper.removeProject(fTapp.getName()); ManagedBuildTestHelper.removeProject(fTapp.getName());
ManagedBuildTestHelper.removeProject(fTlib.getName()); ManagedBuildTestHelper.removeProject(fTlib.getName());
ManagedBuildTestHelper.removeProject(fTobjs.getName()); ManagedBuildTestHelper.removeProject(fTobjs.getName());
} }
private void findFiles(IResource dir, String pattern, List<IFile> files) { private void findFiles(IResource dir, String pattern, List<IFile> files) {
IResource resource = null; IResource resource = null;
try { try {
IResource[] members; IResource[] members;
if(dir instanceof IContainer) if(dir instanceof IContainer)
members = ((IContainer)dir).members(IFolder.INCLUDE_PHANTOMS); members = ((IContainer)dir).members(IFolder.INCLUDE_PHANTOMS);
else else
if(dir instanceof IFolder) if(dir instanceof IFolder)
members = ((IFolder)dir).members(IFolder.INCLUDE_PHANTOMS); members = ((IFolder)dir).members(IFolder.INCLUDE_PHANTOMS);
else // Not possible else // Not possible
return; return;
for(int i = 0; i < members.length; ++i) { for(int i = 0; i < members.length; ++i) {
resource = members[i]; resource = members[i];
if(resource.getType() == IResource.FOLDER) if(resource.getType() == IResource.FOLDER)
findFiles(resource, pattern, files); findFiles(resource, pattern, files);
else { else {
if(resource.getName().matches(pattern)) if(resource.getName().matches(pattern))
files.add((IFile)resource); files.add((IFile)resource);
} }
} }
} catch (CoreException e) { } catch (CoreException e) {
e.printStackTrace(); e.printStackTrace();
fail("Error while collecting files." + MESSAGE_TAIL); fail("Error while collecting files." + MESSAGE_TAIL);
} }
} }
private IToolChain setToolChain(IProject project, IToolChain setTo) { private IToolChain setToolChain(IProject project, IToolChain setTo) {
try { try {
IConfiguration cfg = getProjectConfiguration(project); IConfiguration cfg = getProjectConfiguration(project);
IToolChain currentToolChain = cfg.getToolChain(); IToolChain currentToolChain = cfg.getToolChain();
IToolChainModificationManager mngr = IToolChainModificationManager mngr =
ManagedBuildManager.getToolChainModificationManager(); ManagedBuildManager.getToolChainModificationManager();
IConfigurationModification cfgM = IConfigurationModification cfgM =
(IConfigurationModification)mngr. (IConfigurationModification)mngr.
createModification(cfg.getRootFolderInfo()); createModification(cfg.getRootFolderInfo());
FolderInfo folderInfo = (FolderInfo)cfg.getRootFolderInfo(); FolderInfo folderInfo = (FolderInfo)cfg.getRootFolderInfo();
if(setTo == null) { if(setTo == null) {
for(int i = 0; i < allToolChains.length; ++i) { for(int i = 0; i < allToolChains.length; ++i) {
// If predefined tool chain supported, leave it alone // If predefined tool chain supported, leave it alone
if(allToolChains[i].equals(currentToolChain)) if(allToolChains[i].equals(currentToolChain))
return currentToolChain; return currentToolChain;
// In the same loop try to find compatible tool chain // In the same loop try to find compatible tool chain
if(setTo == null) { if(setTo == null) {
IBuilder builder = allToolChains[i].getBuilder(); IBuilder builder = allToolChains[i].getBuilder();
if(cfg.isBuilderCompatible(builder) && if(cfg.isBuilderCompatible(builder) &&
folderInfo.isToolChainCompatible(allToolChains[i])) folderInfo.isToolChainCompatible(allToolChains[i]))
setTo = allToolChains[i]; setTo = allToolChains[i];
} }
} }
} }
if(null != setTo) { if(null != setTo) {
cfgM.setToolChain(setTo); cfgM.setToolChain(setTo);
assertEquals(setTo, cfgM.getToolChain()); assertEquals(setTo, cfgM.getToolChain());
assertEquals(setTo.getBuilder(), cfgM.getBuilder()); assertEquals(setTo.getBuilder(), cfgM.getBuilder());
} }
} catch (CoreException e) { } catch (CoreException e) {
e.printStackTrace(); e.printStackTrace();
fail("Error. " + MESSAGE_TAIL); fail("Error. " + MESSAGE_TAIL);
} }
return setTo; return setTo;
} }
private IConfiguration getProjectConfiguration(IProject project) throws CoreException { private IConfiguration getProjectConfiguration(IProject project) throws CoreException {
ICProjectDescription cProjDescription = CoreModel.getDefault(). ICProjectDescription cProjDescription = CoreModel.getDefault().
createProjectDescription(project, true); createProjectDescription(project, true);
return ManagedBuildManager. return ManagedBuildManager.
getConfigurationForDescription( getConfigurationForDescription(
cProjDescription.getConfigurations()[0]); cProjDescription.getConfigurations()[0]);
} }
private void rebuildArtefact(IProject project) { private void rebuildArtefact(IProject project) {
// deleteFiles(getProjectFolder(project), // deleteFiles(getProjectFolder(project),
// getArtefactFullName(project), // getArtefactFullName(project),
// new NullProgressMonitor()); // new NullProgressMonitor());
try { try {
project.build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor()); project.build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
} catch (CoreException e) { } catch (CoreException e) {
e.printStackTrace(); e.printStackTrace();
fail("Cannot clean project " + fTapp.getName() + '.' + MESSAGE_TAIL); fail("Cannot clean project " + fTapp.getName() + '.' + MESSAGE_TAIL);
} }
buildProject(project); buildProject(project);
} }
private long getArtifactTimeStamp(IProject project) { private long getArtifactTimeStamp(IProject project) {
List<IFile> files = new ArrayList<IFile>(); List<IFile> files = new ArrayList<IFile>();
findFiles(project, getArtefactFullName(project), files); findFiles(project, getArtefactFullName(project), files);
if(files.size() == 0) // File not exists if(files.size() == 0) // File not exists
return 0; return 0;
IFile artefact = files.iterator().next(); IFile artefact = files.iterator().next();
return artefact.getModificationStamp(); return artefact.getModificationStamp();
} }
private String getArtefactFullName(IProject project) { private String getArtefactFullName(IProject project) {
IConfiguration cfg = null; IConfiguration cfg = null;
try { try {
cfg = getProjectConfiguration(project); cfg = getProjectConfiguration(project);
} catch (CoreException e) { } catch (CoreException e) {
e.printStackTrace(); e.printStackTrace();
fail("Error. " + MESSAGE_TAIL); fail("Error. " + MESSAGE_TAIL);
} }
String name = cfg.getArtifactName(); String name = cfg.getArtifactName();
String ext = cfg.getArtifactExtension(); String ext = cfg.getArtifactExtension();
if((null != ext) && (ext.length() > 0)) { if((null != ext) && (ext.length() > 0)) {
name += '.'; name += '.';
name += ext; name += ext;
} }
return name; return name;
} }
public void testDepLibs() { public void testDepLibs() {
buildProject(fTapp); buildProject(fTapp);
long timeStamp = getArtifactTimeStamp(fTapp); long timeStamp = getArtifactTimeStamp(fTapp);
if(timeStamp == 0) { if(timeStamp == 0) {
fail("Cannot build project " + fTapp.getName()); fail("Cannot build project " + fTapp.getName());
} }
try { // To be sure that in case of build the time should be changed try { // To be sure that in case of build the time should be changed
Thread.sleep(1000); Thread.sleep(1000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
// Do nothing // Do nothing
} }
// Check if no build any more // Check if no build any more
buildProject(fTapp); buildProject(fTapp);
if(timeStamp != getArtifactTimeStamp(fTapp)) { if(timeStamp != getArtifactTimeStamp(fTapp)) {
fail("Error. This time it should be nothing to build"); fail("Error. This time it should be nothing to build");
} }
rebuildArtefact(fTlib); rebuildArtefact(fTlib);
buildProject(fTapp); buildProject(fTapp);
if(timeStamp == getArtifactTimeStamp(fTapp)) { if(timeStamp == getArtifactTimeStamp(fTapp)) {
fail("Error. This time it should build application."); fail("Error. This time it should build application.");
} }
} }
public void testDepUObjs() { public void testDepUObjs() {
buildProject(fTapp); buildProject(fTapp);
long timeStamp = getArtifactTimeStamp(fTapp); long timeStamp = getArtifactTimeStamp(fTapp);
if(timeStamp == 0) { if(timeStamp == 0) {
fail("Cannot build project " + fTapp.getName()); fail("Cannot build project " + fTapp.getName());
} }
try { // To be sure that in case of build the time should be changed try { // To be sure that in case of build the time should be changed
Thread.sleep(1000); Thread.sleep(1000);
} catch (InterruptedException e) { } catch (InterruptedException e) {
// Do nothing // Do nothing
} }
// Check if no build any more // Check if no build any more
buildProject(fTapp); buildProject(fTapp);
if(timeStamp != getArtifactTimeStamp(fTapp)) { if(timeStamp != getArtifactTimeStamp(fTapp)) {
fail("Error. This time it should be nothing to build"); fail("Error. This time it should be nothing to build");
} }
// deleteFiles(getProjectFolder(fTobjs), "*.o", new NullProgressMonitor()); // deleteFiles(getProjectFolder(fTobjs), "*.o", new NullProgressMonitor());
rebuildArtefact(fTobjs); rebuildArtefact(fTobjs);
buildProject(fTapp); buildProject(fTapp);
if(timeStamp == getArtifactTimeStamp(fTapp)) { if(timeStamp == getArtifactTimeStamp(fTapp)) {
fail("Error. This time it should build application."); fail("Error. This time it should build application.");
} }
} }
// Tests that the URI used to get the time stamp of the artifact is escaped correctly // Tests that the URI used to get the time stamp of the artifact is escaped correctly
// See AdditionalInput.getArtifactTimeStamp(IToolChain toolChain) // See AdditionalInput.getArtifactTimeStamp(IToolChain toolChain)
public void testGetArtifactTimeStampEscapeURI_bug377295() throws CoreException { public void testGetArtifactTimeStampEscapeURI_bug377295() throws CoreException {
setWorkspace("regressions"); setWorkspace("regressions");
final IProject project = loadProject("helloworldC"); final IProject project = loadProject("helloworldC");
IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(project); IManagedBuildInfo buildInfo = ManagedBuildManager.getBuildInfo(project);
IConfiguration[] configs = buildInfo.getManagedProject().getConfigurations(); IConfiguration[] configs = buildInfo.getManagedProject().getConfigurations();
for (IConfiguration configuration : configs) { for (IConfiguration configuration : configs) {
configuration.setArtifactName("test [377295]"); configuration.setArtifactName("test [377295]");
} }
project.build(IncrementalProjectBuilder.FULL_BUILD, null); project.build(IncrementalProjectBuilder.FULL_BUILD, null);
// This will trigger AdditionalInput.getArtifactTimeStamp to get called, no IllegalArgumentException should be thrown // This will trigger AdditionalInput.getArtifactTimeStamp to get called, no IllegalArgumentException should be thrown
project.build(IncrementalProjectBuilder.FULL_BUILD, null); project.build(IncrementalProjectBuilder.FULL_BUILD, null);
} }
} }

View file

@ -1,3 +1,3 @@
test.provider.Test_One=cmd1 test.provider.Test_One=cmd1
test.provider.Test_Two=cmd2 test.provider.Test_Two=cmd2
test.provider.Test_Three=cmd test.provider.Test_Three=cmd

View file

@ -1,39 +1,39 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2010, 2012 Andrew Gvozdev and others. * Copyright (c) 2010, 2012 Andrew Gvozdev and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Andrew Gvozdev - Initial API and implementation * Andrew Gvozdev - Initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers; package org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers;
import java.net.URL; import java.net.URL;
import org.eclipse.cdt.internal.ui.buildconsole.CBuildConsole; import org.eclipse.cdt.internal.ui.buildconsole.CBuildConsole;
import org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuiltinSpecsDetector; import org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuiltinSpecsDetector;
import org.eclipse.cdt.ui.language.settings.providers.LanguageSettingsProvidersImages; import org.eclipse.cdt.ui.language.settings.providers.LanguageSettingsProvidersImages;
/** /**
* Console adapter for {@link AbstractBuiltinSpecsDetector}. * Console adapter for {@link AbstractBuiltinSpecsDetector}.
*/ */
public class ScannerDiscoveryConsole extends CBuildConsole { public class ScannerDiscoveryConsole extends CBuildConsole {
/** /**
* {@inheritDoc} * {@inheritDoc}
* @param consoleId - a console ID is expected here which then is used as menu context ID. * @param consoleId - a console ID is expected here which then is used as menu context ID.
* @param defaultIconUrl - if {@code LanguageSettingsProviderAssociation} extension point * @param defaultIconUrl - if {@code LanguageSettingsProviderAssociation} extension point
* defines URL by provider id, {@code defaultIconUrl} will be ignored and the URL from the extension * defines URL by provider id, {@code defaultIconUrl} will be ignored and the URL from the extension
* point will be used. If not, supplied {@code defaultIconUrl} will be used. * point will be used. If not, supplied {@code defaultIconUrl} will be used.
*/ */
@Override @Override
public void init(String consoleId, String name, URL defaultIconUrl) { public void init(String consoleId, String name, URL defaultIconUrl) {
URL iconUrl = LanguageSettingsProvidersImages.getImageUrl(consoleId); URL iconUrl = LanguageSettingsProvidersImages.getImageUrl(consoleId);
if (iconUrl == null) { if (iconUrl == null) {
iconUrl = defaultIconUrl; iconUrl = defaultIconUrl;
} }
super.init(consoleId, name, iconUrl); super.init(consoleId, name, iconUrl);
} }
} }

View file

@ -1,117 +1,117 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2011, 2012 Andrew Gvozdev and others. * Copyright (c) 2011, 2012 Andrew Gvozdev and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Andrew Gvozdev - Initial API and implementation * Andrew Gvozdev - Initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers; package org.eclipse.cdt.managedbuilder.internal.ui.language.settings.providers;
import java.io.IOException; import java.io.IOException;
import java.net.URL; import java.net.URL;
import org.eclipse.cdt.core.ConsoleOutputStream; import org.eclipse.cdt.core.ConsoleOutputStream;
import org.eclipse.cdt.internal.core.ICConsole; import org.eclipse.cdt.internal.core.ICConsole;
import org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuiltinSpecsDetector; import org.eclipse.cdt.managedbuilder.language.settings.providers.AbstractBuiltinSpecsDetector;
import org.eclipse.cdt.ui.CDTSharedImages; import org.eclipse.cdt.ui.CDTSharedImages;
import org.eclipse.cdt.ui.language.settings.providers.LanguageSettingsProvidersImages; import org.eclipse.cdt.ui.language.settings.providers.LanguageSettingsProvidersImages;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.console.ConsolePlugin; import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole; import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.IConsoleManager; import org.eclipse.ui.console.IConsoleManager;
import org.eclipse.ui.console.MessageConsole; import org.eclipse.ui.console.MessageConsole;
import org.eclipse.ui.console.MessageConsoleStream; import org.eclipse.ui.console.MessageConsoleStream;
/** /**
* Console adapter for global {@link AbstractBuiltinSpecsDetector}. * Console adapter for global {@link AbstractBuiltinSpecsDetector}.
* *
* Note that this console is not colored. * Note that this console is not colored.
*/ */
public class ScannerDiscoveryGlobalConsole implements ICConsole { public class ScannerDiscoveryGlobalConsole implements ICConsole {
private MessageConsole console; private MessageConsole console;
private class ConsoleOutputStreamAdapter extends ConsoleOutputStream { private class ConsoleOutputStreamAdapter extends ConsoleOutputStream {
private MessageConsoleStream fConsoleStream; private MessageConsoleStream fConsoleStream;
public ConsoleOutputStreamAdapter(MessageConsoleStream stream) { public ConsoleOutputStreamAdapter(MessageConsoleStream stream) {
fConsoleStream = stream; fConsoleStream = stream;
} }
@Override @Override
public void write(int arg0) throws IOException { public void write(int arg0) throws IOException {
fConsoleStream.write(arg0); fConsoleStream.write(arg0);
} }
@Override @Override
public synchronized void write(byte[] b, int off, int len) throws IOException { public synchronized void write(byte[] b, int off, int len) throws IOException {
fConsoleStream.write(b, off, len); fConsoleStream.write(b, off, len);
} }
@Override @Override
public void flush() throws IOException { public void flush() throws IOException {
fConsoleStream.flush(); fConsoleStream.flush();
} }
@Override @Override
public void close() throws IOException { public void close() throws IOException {
fConsoleStream.close(); fConsoleStream.close();
} }
} }
@Override @Override
public void start(IProject project) { public void start(IProject project) {
Assert.isTrue(project == null); Assert.isTrue(project == null);
} }
@Override @Override
public ConsoleOutputStream getOutputStream() throws CoreException { public ConsoleOutputStream getOutputStream() throws CoreException {
return new ConsoleOutputStreamAdapter(console.newMessageStream()); return new ConsoleOutputStreamAdapter(console.newMessageStream());
} }
@Override @Override
public ConsoleOutputStream getInfoStream() throws CoreException { public ConsoleOutputStream getInfoStream() throws CoreException {
return new ConsoleOutputStreamAdapter(console.newMessageStream()); return new ConsoleOutputStreamAdapter(console.newMessageStream());
} }
@Override @Override
public ConsoleOutputStream getErrorStream() throws CoreException { public ConsoleOutputStream getErrorStream() throws CoreException {
return new ConsoleOutputStreamAdapter(console.newMessageStream()); return new ConsoleOutputStreamAdapter(console.newMessageStream());
} }
@Override @Override
public void init(String consoleId, String name, URL defaultIconUrl) { public void init(String consoleId, String name, URL defaultIconUrl) {
console = null; console = null;
IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager(); IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
IConsole[] allConsoles = consoleManager.getConsoles(); IConsole[] allConsoles = consoleManager.getConsoles();
for (IConsole con : allConsoles) { for (IConsole con : allConsoles) {
if (name.equals(con.getName()) && con instanceof MessageConsole) { if (name.equals(con.getName()) && con instanceof MessageConsole) {
console = (MessageConsole) con; console = (MessageConsole) con;
console.clearConsole(); console.clearConsole();
break; break;
} }
} }
if (console==null) { if (console==null) {
URL iconUrl = LanguageSettingsProvidersImages.getImageUrl(consoleId); URL iconUrl = LanguageSettingsProvidersImages.getImageUrl(consoleId);
if (iconUrl == null) { if (iconUrl == null) {
iconUrl = defaultIconUrl; iconUrl = defaultIconUrl;
} }
ImageDescriptor imageDescriptor; ImageDescriptor imageDescriptor;
if (iconUrl != null) { if (iconUrl != null) {
imageDescriptor = CDTSharedImages.getImageDescriptor(iconUrl.toString()); imageDescriptor = CDTSharedImages.getImageDescriptor(iconUrl.toString());
} else { } else {
imageDescriptor = ImageDescriptor.getMissingImageDescriptor(); imageDescriptor = ImageDescriptor.getMissingImageDescriptor();
} }
console = new MessageConsole(name, imageDescriptor); console = new MessageConsole(name, imageDescriptor);
console.activate(); console.activate();
consoleManager.addConsoles(new IConsole[]{ console }); consoleManager.addConsoles(new IConsole[]{ console });
} }
} }
} }

View file

@ -1,45 +1,45 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2011, 2013 Gil Barash * Copyright (c) 2011, 2013 Gil Barash
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Gil Barash - Initial implementation * Gil Barash - Initial implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.codan.internal.checkers.ui.quickfix; package org.eclipse.cdt.codan.internal.checkers.ui.quickfix;
import org.eclipse.cdt.codan.internal.checkers.ui.CheckersUiActivator; import org.eclipse.cdt.codan.internal.checkers.ui.CheckersUiActivator;
import org.eclipse.cdt.core.dom.ast.IASTBreakStatement; import org.eclipse.cdt.core.dom.ast.IASTBreakStatement;
import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit; import org.eclipse.cdt.core.dom.ast.IASTTranslationUnit;
import org.eclipse.cdt.core.index.IIndex; import org.eclipse.cdt.core.index.IIndex;
import org.eclipse.cdt.core.model.ITranslationUnit; import org.eclipse.cdt.core.model.ITranslationUnit;
import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
public class CaseBreakQuickFixBreak extends AbstractCaseBreakQuickFix { public class CaseBreakQuickFixBreak extends AbstractCaseBreakQuickFix {
@Override @Override
public boolean isApplicable(IMarker marker) { public boolean isApplicable(IMarker marker) {
int line = marker.getAttribute(IMarker.LINE_NUMBER, 0) - 1; int line = marker.getAttribute(IMarker.LINE_NUMBER, 0) - 1;
if (line < 0) if (line < 0)
return false; return false;
return true; return true;
} }
@Override @Override
public String getLabel() { public String getLabel() {
return QuickFixMessages.CaseBreakQuickFixBreak_Label; return QuickFixMessages.CaseBreakQuickFixBreak_Label;
} }
@Override @Override
public void modifyAST(IIndex index, IMarker marker) { public void modifyAST(IIndex index, IMarker marker) {
try { try {
IASTTranslationUnit ast = getTranslationUnitViaEditor(marker).getAST(index, ITranslationUnit.AST_SKIP_INDEXED_HEADERS); IASTTranslationUnit ast = getTranslationUnitViaEditor(marker).getAST(index, ITranslationUnit.AST_SKIP_INDEXED_HEADERS);
IASTBreakStatement breakStatement = ast.getASTNodeFactory().newBreakStatement(); IASTBreakStatement breakStatement = ast.getASTNodeFactory().newBreakStatement();
addNewNodeAtMarkedCaseEnd(breakStatement, ast, marker); addNewNodeAtMarkedCaseEnd(breakStatement, ast, marker);
} catch (CoreException e) { } catch (CoreException e) {
CheckersUiActivator.log(e); CheckersUiActivator.log(e);
} }
} }
} }

View file

@ -1,66 +1,66 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2011 Alena Laskavaia and others. * Copyright (c) 2011 Alena Laskavaia and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Alena Laskavaia - initial API and implementation * Alena Laskavaia - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.codan.internal.checkers.ui.quickfix; package org.eclipse.cdt.codan.internal.checkers.ui.quickfix;
import org.eclipse.cdt.codan.core.model.IProblem; import org.eclipse.cdt.codan.core.model.IProblem;
import org.eclipse.cdt.codan.core.param.RootProblemPreference; import org.eclipse.cdt.codan.core.param.RootProblemPreference;
import org.eclipse.cdt.codan.internal.checkers.CaseBreakChecker; import org.eclipse.cdt.codan.internal.checkers.CaseBreakChecker;
import org.eclipse.cdt.codan.ui.AbstractCodanCMarkerResolution; import org.eclipse.cdt.codan.ui.AbstractCodanCMarkerResolution;
import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IMarker;
import org.eclipse.jface.text.BadLocationException; import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.IDocument; import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion; import org.eclipse.jface.text.IRegion;
import org.eclipse.text.edits.InsertEdit; import org.eclipse.text.edits.InsertEdit;
import org.eclipse.text.edits.MalformedTreeException; import org.eclipse.text.edits.MalformedTreeException;
public class CaseBreakQuickFixComment extends AbstractCodanCMarkerResolution { public class CaseBreakQuickFixComment extends AbstractCodanCMarkerResolution {
@Override @Override
public String getLabel() { public String getLabel() {
return QuickFixMessages.CaseBreakQuickFixComment_Label; return QuickFixMessages.CaseBreakQuickFixComment_Label;
} }
@Override @Override
public void apply(IMarker marker, IDocument document) { public void apply(IMarker marker, IDocument document) {
try { try {
int line = marker.getAttribute(IMarker.LINE_NUMBER, -1); int line = marker.getAttribute(IMarker.LINE_NUMBER, -1);
if (line < 0) if (line < 0)
return; return;
int offset = document.getLineOffset(line); int offset = document.getLineOffset(line);
String indent = getIndentationStr(document, line); String indent = getIndentationStr(document, line);
String comment = getNoBreakComment(marker); String comment = getNoBreakComment(marker);
String editStr = String.format("%s/* %s */\n", indent, comment); //$NON-NLS-1$ String editStr = String.format("%s/* %s */\n", indent, comment); //$NON-NLS-1$
InsertEdit edit = new InsertEdit(offset, editStr); InsertEdit edit = new InsertEdit(offset, editStr);
edit.apply(document); edit.apply(document);
} catch (MalformedTreeException e) { } catch (MalformedTreeException e) {
return; return;
} catch (BadLocationException e) { } catch (BadLocationException e) {
return; return;
} }
} }
private String getIndentationStr(IDocument document, int line) throws BadLocationException { private String getIndentationStr(IDocument document, int line) throws BadLocationException {
int prevLine = line - 1; int prevLine = line - 1;
IRegion lineInformation = document.getLineInformation(prevLine); IRegion lineInformation = document.getLineInformation(prevLine);
String prevLineStr = document.get(lineInformation.getOffset(), lineInformation.getLength()); String prevLineStr = document.get(lineInformation.getOffset(), lineInformation.getLength());
int nonSpace = prevLineStr.indexOf(prevLineStr.trim()); int nonSpace = prevLineStr.indexOf(prevLineStr.trim());
String indent = prevLineStr.substring(0, nonSpace); String indent = prevLineStr.substring(0, nonSpace);
return indent; return indent;
} }
private String getNoBreakComment(IMarker marker) { private String getNoBreakComment(IMarker marker) {
IProblem problem = getProblem(marker); IProblem problem = getProblem(marker);
RootProblemPreference map = (RootProblemPreference) problem.getPreference(); RootProblemPreference map = (RootProblemPreference) problem.getPreference();
String comment = (String) map.getChildValue(CaseBreakChecker.PARAM_NO_BREAK_COMMENT); String comment = (String) map.getChildValue(CaseBreakChecker.PARAM_NO_BREAK_COMMENT);
if (comment == null || comment.trim().length() == 0) if (comment == null || comment.trim().length() == 0)
comment = "no break"; //$NON-NLS-1$ comment = "no break"; //$NON-NLS-1$
return comment; return comment;
} }
} }

View file

@ -1,69 +1,69 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2010, 2013 Tomasz Wesolowski and others * Copyright (c) 2010, 2013 Tomasz Wesolowski and others
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Tomasz Wesolowski - initial API and implementation * Tomasz Wesolowski - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.codan.internal.checkers.ui.quickfix; package org.eclipse.cdt.codan.internal.checkers.ui.quickfix;
import org.eclipse.cdt.codan.ui.AbstractCodanCMarkerResolution; import org.eclipse.cdt.codan.ui.AbstractCodanCMarkerResolution;
public class CaseBreakQuickFixBreakTest extends QuickFixTestCase { public class CaseBreakQuickFixBreakTest extends QuickFixTestCase {
@SuppressWarnings("restriction") @SuppressWarnings("restriction")
@Override @Override
protected AbstractCodanCMarkerResolution createQuickFix() { protected AbstractCodanCMarkerResolution createQuickFix() {
return new CaseBreakQuickFixBreak(); return new CaseBreakQuickFixBreak();
} }
//void func() { //void func() {
// int a; // int a;
// switch(a) { // switch(a) {
// case 1: // case 1:
// hello(); // hello();
// case 2: // case 2:
// break; // break;
// } // }
//} //}
public void testSimpleCase() throws Exception { public void testSimpleCase() throws Exception {
loadcode(getAboveComment()); loadcode(getAboveComment());
String result = runQuickFixOneFile(); String result = runQuickFixOneFile();
assertContainedIn("break;\tcase 2:", result); assertContainedIn("break;\tcase 2:", result);
} }
//void func() { //void func() {
// int a; // int a;
// switch(a) { // switch(a) {
// case 1: { // case 1: {
// hello(); // hello();
// } // }
// default: // default:
// } // }
//} //}
public void testCompositeStatementCase() throws Exception { public void testCompositeStatementCase() throws Exception {
loadcode(getAboveComment()); loadcode(getAboveComment());
String result = runQuickFixOneFile(); String result = runQuickFixOneFile();
assertContainedIn("hello();\t\tbreak;", result); assertContainedIn("hello();\t\tbreak;", result);
} }
// int main() { // int main() {
// int a; // int a;
// switch(a) // switch(a)
// { // {
// case 0: // case 0:
// { // {
// } // }
// default: // default:
// break; // break;
// } // }
// return 0; // return 0;
// } // }
public void testNPE_bug363884() throws Exception { public void testNPE_bug363884() throws Exception {
loadcode(getAboveComment()); loadcode(getAboveComment());
String result = runQuickFixOneFile(); String result = runQuickFixOneFile();
assertContainedIn("break;\t}\t\t\tdefault:", result); assertContainedIn("break;\t}\t\t\tdefault:", result);
} }
} }

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<classpath> <classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/> <classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/> <classpathentry kind="output" path="bin"/>
</classpath> </classpath>

View file

@ -1,346 +1,346 @@
#Sat Jan 07 18:28:52 PST 2012 #Sat Jan 07 18:28:52 PST 2012
eclipse.preferences.version=1 eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.8 org.eclipse.jdt.core.compiler.compliance=1.8
org.eclipse.jdt.core.compiler.debug.lineNumber=generate org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.autoboxing=ignore org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
org.eclipse.jdt.core.compiler.problem.comparingIdentical=error org.eclipse.jdt.core.compiler.problem.comparingIdentical=error
org.eclipse.jdt.core.compiler.problem.deadCode=warning org.eclipse.jdt.core.compiler.problem.deadCode=warning
org.eclipse.jdt.core.compiler.problem.deprecation=warning org.eclipse.jdt.core.compiler.problem.deprecation=warning
org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
org.eclipse.jdt.core.compiler.problem.emptyStatement=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
org.eclipse.jdt.core.compiler.problem.forbiddenReference=error org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=error
org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error org.eclipse.jdt.core.compiler.problem.noEffectAssignment=error
org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=error
org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
org.eclipse.jdt.core.compiler.problem.nullReference=error org.eclipse.jdt.core.compiler.problem.nullReference=error
org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=error
org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore
org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
org.eclipse.jdt.core.compiler.problem.unusedImport=error org.eclipse.jdt.core.compiler.problem.unusedImport=error
org.eclipse.jdt.core.compiler.problem.unusedLabel=warning org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
org.eclipse.jdt.core.compiler.problem.unusedLocal=warning org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
org.eclipse.jdt.core.compiler.problem.unusedParameter=warning org.eclipse.jdt.core.compiler.problem.unusedParameter=warning
org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
org.eclipse.jdt.core.compiler.source=1.8 org.eclipse.jdt.core.compiler.source=1.8
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_assignment=0 org.eclipse.jdt.core.formatter.alignment_for_assignment=0
org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16
org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
org.eclipse.jdt.core.formatter.blank_lines_after_package=1 org.eclipse.jdt.core.formatter.blank_lines_after_package=1
org.eclipse.jdt.core.formatter.blank_lines_before_field=0 org.eclipse.jdt.core.formatter.blank_lines_before_field=0
org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1
org.eclipse.jdt.core.formatter.blank_lines_before_method=1 org.eclipse.jdt.core.formatter.blank_lines_before_method=1
org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=0 org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=0
org.eclipse.jdt.core.formatter.blank_lines_before_package=0 org.eclipse.jdt.core.formatter.blank_lines_before_package=0
org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
org.eclipse.jdt.core.formatter.comment.format_block_comments=true org.eclipse.jdt.core.formatter.comment.format_block_comments=true
org.eclipse.jdt.core.formatter.comment.format_header=false org.eclipse.jdt.core.formatter.comment.format_header=false
org.eclipse.jdt.core.formatter.comment.format_html=false org.eclipse.jdt.core.formatter.comment.format_html=false
org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
org.eclipse.jdt.core.formatter.comment.format_line_comments=false org.eclipse.jdt.core.formatter.comment.format_line_comments=false
org.eclipse.jdt.core.formatter.comment.format_source_code=true org.eclipse.jdt.core.formatter.comment.format_source_code=true
org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false org.eclipse.jdt.core.formatter.comment.indent_parameter_description=false
org.eclipse.jdt.core.formatter.comment.indent_root_tags=true org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert
org.eclipse.jdt.core.formatter.comment.line_length=80 org.eclipse.jdt.core.formatter.comment.line_length=80
org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
org.eclipse.jdt.core.formatter.compact_else_if=true org.eclipse.jdt.core.formatter.compact_else_if=true
org.eclipse.jdt.core.formatter.continuation_indentation=2 org.eclipse.jdt.core.formatter.continuation_indentation=2
org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
org.eclipse.jdt.core.formatter.disabling_tag= org.eclipse.jdt.core.formatter.disabling_tag=
org.eclipse.jdt.core.formatter.enabling_tag= org.eclipse.jdt.core.formatter.enabling_tag=
org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_empty_lines=false org.eclipse.jdt.core.formatter.indent_empty_lines=false
org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true
org.eclipse.jdt.core.formatter.indentation.size=4 org.eclipse.jdt.core.formatter.indentation.size=4
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
org.eclipse.jdt.core.formatter.join_lines_in_comments=false org.eclipse.jdt.core.formatter.join_lines_in_comments=false
org.eclipse.jdt.core.formatter.join_wrapped_lines=true org.eclipse.jdt.core.formatter.join_wrapped_lines=true
org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
org.eclipse.jdt.core.formatter.lineSplit=140 org.eclipse.jdt.core.formatter.lineSplit=140
org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=0 org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=0
org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
org.eclipse.jdt.core.formatter.tabulation.char=tab org.eclipse.jdt.core.formatter.tabulation.char=tab
org.eclipse.jdt.core.formatter.tabulation.size=4 org.eclipse.jdt.core.formatter.tabulation.size=4
org.eclipse.jdt.core.formatter.use_on_off_tags=false org.eclipse.jdt.core.formatter.use_on_off_tags=false
org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true

View file

@ -1,17 +1,17 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2012 Marc-Andre Laperle * Copyright (c) 2012 Marc-Andre Laperle
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Marc-Andre Laperle - initial API and implementation * Marc-Andre Laperle - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.codan.internal.ui; package org.eclipse.cdt.codan.internal.ui;
public interface ImageConstants { public interface ImageConstants {
String ICON_WARNING = "icons/yellow_bug.gif"; //$NON-NLS-1$ String ICON_WARNING = "icons/yellow_bug.gif"; //$NON-NLS-1$
String ICON_ERROR = "icons/red_bug.gif"; //$NON-NLS-1$ String ICON_ERROR = "icons/red_bug.gif"; //$NON-NLS-1$
String ICON_INFO = "icons/blue_bug.gif"; //$NON-NLS-1$ String ICON_INFO = "icons/blue_bug.gif"; //$NON-NLS-1$
} }

View file

@ -1,32 +1,32 @@
/* DO NOT EDIT THIS FILE - it is machine generated */ /* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h> #include <jni.h>
/* Header for class com_qnx_tools_utils_spawner_SpawnerInputStream */ /* Header for class com_qnx_tools_utils_spawner_SpawnerInputStream */
#ifndef _Included_com_qnx_tools_utils_spawner_SpawnerInputStream #ifndef _Included_com_qnx_tools_utils_spawner_SpawnerInputStream
#define _Included_com_qnx_tools_utils_spawner_SpawnerInputStream #define _Included_com_qnx_tools_utils_spawner_SpawnerInputStream
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#undef com_qnx_tools_utils_spawner_SpawnerInputStream_SKIP_BUFFER_SIZE #undef com_qnx_tools_utils_spawner_SpawnerInputStream_SKIP_BUFFER_SIZE
#define com_qnx_tools_utils_spawner_SpawnerInputStream_SKIP_BUFFER_SIZE 2048L #define com_qnx_tools_utils_spawner_SpawnerInputStream_SKIP_BUFFER_SIZE 2048L
/* Inaccessible static: skipBuffer */ /* Inaccessible static: skipBuffer */
/* /*
* Class: org_elipse_cdt_utils_spawner_SpawnerInputStream * Class: org_elipse_cdt_utils_spawner_SpawnerInputStream
* Method: read0 * Method: read0
* Signature: (I[BI)I * Signature: (I[BI)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0
(JNIEnv *, jobject, jint, jbyteArray, jint); (JNIEnv *, jobject, jint, jbyteArray, jint);
/* /*
* Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream * Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream
* Method: close0 * Method: close0
* Signature: (I)I * Signature: (I)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0
(JNIEnv *, jobject, jint); (JNIEnv *, jobject, jint);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif

View file

@ -1,29 +1,29 @@
/* DO NOT EDIT THIS FILE - it is machine generated */ /* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h> #include <jni.h>
/* Header for class com_qnx_tools_utils_spawner_SpawnerOutputStream */ /* Header for class com_qnx_tools_utils_spawner_SpawnerOutputStream */
#ifndef _Included_com_qnx_tools_utils_spawner_SpawnerOutputStream #ifndef _Included_com_qnx_tools_utils_spawner_SpawnerOutputStream
#define _Included_com_qnx_tools_utils_spawner_SpawnerOutputStream #define _Included_com_qnx_tools_utils_spawner_SpawnerOutputStream
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* /*
* Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream
* Method: write0 * Method: write0
* Signature: (I[BI)I * Signature: (I[BI)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0
(JNIEnv *, jobject, jint, jbyteArray, jint); (JNIEnv *, jobject, jint, jbyteArray, jint);
/* /*
* Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream
* Method: close0 * Method: close0
* Signature: (I)I * Signature: (I)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0
(JNIEnv *, jobject, jint); (JNIEnv *, jobject, jint);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif

View file

@ -1,29 +1,29 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2002, 2010 QNX Software Systems and others. * Copyright (c) 2002, 2010 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* QNX Software Systems - initial API and implementation * QNX Software Systems - initial API and implementation
* Wind River Systems, Inc. * Wind River Systems, Inc.
* Mikhail Zabaluev (Nokia) - bug 82744 * Mikhail Zabaluev (Nokia) - bug 82744
*******************************************************************************/ *******************************************************************************/
#include <unistd.h> #include <unistd.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sys/types.h> #include <sys/types.h>
#include <signal.h> #include <signal.h>
#include <errno.h> #include <errno.h>
extern pid_t exec0(const char *path, char *const argv[], extern pid_t exec0(const char *path, char *const argv[],
char *const envp[], const char *dirpath, char *const envp[], const char *dirpath,
int channels[3]); int channels[3]);
extern pid_t exec_pty(const char *path, char *const argv[], extern pid_t exec_pty(const char *path, char *const argv[],
char *const envp[], const char *dirpath, char *const envp[], const char *dirpath,
int channels[3], const char *pts_name, int fdm, int channels[3], const char *pts_name, int fdm,
int console); int console);
extern int wait0(pid_t pid); extern int wait0(pid_t pid);

View file

@ -1,186 +1,186 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2010 QNX Software Systems and others. * Copyright (c) 2004, 2010 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* QNX Software Systems - initial API and implementation * QNX Software Systems - initial API and implementation
* Wind River Systems, Inc. * Wind River Systems, Inc.
* Mikhail Zabaluev (Nokia) - bug 82744 * Mikhail Zabaluev (Nokia) - bug 82744
* Mikhail Sennikovsky - bug 145737 * Mikhail Sennikovsky - bug 145737
*******************************************************************************/ *******************************************************************************/
#include "exec0.h" #include "exec0.h"
#include "openpty.h" #include "openpty.h"
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include <libgen.h> #include <libgen.h>
#include <stdlib.h> #include <stdlib.h>
#include <termios.h> #include <termios.h>
/* from pfind.c */ /* from pfind.c */
extern char *pfind(const char *name, char * const envp[]); extern char *pfind(const char *name, char * const envp[]);
pid_t pid_t
exec_pty(const char *path, char *const argv[], char *const envp[], exec_pty(const char *path, char *const argv[], char *const envp[],
const char *dirpath, int channels[3], const char *pts_name, int fdm, int console) const char *dirpath, int channels[3], const char *pts_name, int fdm, int console)
{ {
int pipe2[2]; int pipe2[2];
pid_t childpid; pid_t childpid;
char *full_path; char *full_path;
/* /*
* We use pfind() to check that the program exists and is an executable. * We use pfind() to check that the program exists and is an executable.
* If not pass the error up. Also execve() wants a full path. * If not pass the error up. Also execve() wants a full path.
*/ */
full_path = pfind(path, envp); full_path = pfind(path, envp);
if (full_path == NULL) { if (full_path == NULL) {
fprintf(stderr, "Unable to find full path for \"%s\"\n", (path) ? path : ""); fprintf(stderr, "Unable to find full path for \"%s\"\n", (path) ? path : "");
return -1; return -1;
} }
/* /*
* Make sure we can create our pipes before forking. * Make sure we can create our pipes before forking.
*/ */
if (channels != NULL && console) { if (channels != NULL && console) {
if (pipe(pipe2) < 0) { if (pipe(pipe2) < 0) {
fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno)); fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno));
free(full_path); free(full_path);
return -1; return -1;
} }
} }
childpid = fork(); childpid = fork();
if (childpid < 0) { if (childpid < 0) {
fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno)); fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno));
free(full_path); free(full_path);
return -1; return -1;
} else if (childpid == 0) { /* child */ } else if (childpid == 0) { /* child */
chdir(dirpath); chdir(dirpath);
if (channels != NULL) { if (channels != NULL) {
int fds; int fds;
if (!console && setsid() < 0) { if (!console && setsid() < 0) {
perror("setsid()"); perror("setsid()");
return -1; return -1;
} }
fds = ptys_open(fdm, pts_name); fds = ptys_open(fdm, pts_name);
if (fds < 0) { if (fds < 0) {
fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno)); fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno));
return -1; return -1;
} }
/* Close the read end of pipe2 */ /* Close the read end of pipe2 */
if (console && close(pipe2[0]) == -1) { if (console && close(pipe2[0]) == -1) {
perror("close(pipe2[0]))"); perror("close(pipe2[0]))");
} }
/* close the master, no need in the child */ /* close the master, no need in the child */
close(fdm); close(fdm);
if (console) { if (console) {
set_noecho(fds); set_noecho(fds);
if (setpgid(getpid(), getpid()) < 0) { if (setpgid(getpid(), getpid()) < 0) {
perror("setpgid()"); perror("setpgid()");
return -1; return -1;
} }
} }
/* redirections */ /* redirections */
dup2(fds, STDIN_FILENO); /* dup stdin */ dup2(fds, STDIN_FILENO); /* dup stdin */
dup2(fds, STDOUT_FILENO); /* dup stdout */ dup2(fds, STDOUT_FILENO); /* dup stdout */
if (console) { if (console) {
dup2(pipe2[1], STDERR_FILENO); /* dup stderr */ dup2(pipe2[1], STDERR_FILENO); /* dup stderr */
} else { } else {
dup2(fds, STDERR_FILENO); /* dup stderr */ dup2(fds, STDERR_FILENO); /* dup stderr */
} }
close(fds); /* done with fds. */ close(fds); /* done with fds. */
} }
/* Close all the fd's in the child */ /* Close all the fd's in the child */
{ {
int fdlimit = sysconf(_SC_OPEN_MAX); int fdlimit = sysconf(_SC_OPEN_MAX);
int fd = 3; int fd = 3;
while (fd < fdlimit) while (fd < fdlimit)
close(fd++); close(fd++);
} }
if (envp[0] == NULL) { if (envp[0] == NULL) {
execv(full_path, argv); execv(full_path, argv);
} else { } else {
execve(full_path, argv, envp); execve(full_path, argv, envp);
} }
_exit(127); _exit(127);
} else if (childpid != 0) { /* parent */ } else if (childpid != 0) { /* parent */
if (console) { if (console) {
set_noecho(fdm); set_noecho(fdm);
} }
if (channels != NULL) { if (channels != NULL) {
channels[0] = fdm; /* Input Stream. */ channels[0] = fdm; /* Input Stream. */
channels[1] = fdm; /* Output Stream. */ channels[1] = fdm; /* Output Stream. */
if (console) { if (console) {
/* close the write end of pipe1 */ /* close the write end of pipe1 */
if (close(pipe2[1]) == -1) if (close(pipe2[1]) == -1)
perror("close(pipe2[1])"); perror("close(pipe2[1])");
channels[2] = pipe2[0]; /* stderr Stream. */ channels[2] = pipe2[0]; /* stderr Stream. */
} else { } else {
channels[2] = fdm; /* Error Stream. */ channels[2] = fdm; /* Error Stream. */
} }
} }
free(full_path); free(full_path);
return childpid; return childpid;
} }
free(full_path); free(full_path);
return -1; /*NOT REACHED */ return -1; /*NOT REACHED */
} }
#ifdef __STAND_ALONE__ #ifdef __STAND_ALONE__
int main(int argc, char **argv, char **envp) { int main(int argc, char **argv, char **envp) {
const char *path = "./bufferring_test"; const char *path = "./bufferring_test";
int channels[3] = { -1, -1, -1}; int channels[3] = { -1, -1, -1};
int status; int status;
FILE *app_stdin; FILE *app_stdin;
FILE *app_stdout; FILE *app_stdout;
FILE *app_stderr; FILE *app_stderr;
char pts_name[32]; char pts_name[32];
int fdm; int fdm;
char buffer[32]; char buffer[32];
fdm = ptym_open(pts_name); fdm = ptym_open(pts_name);
status = exec_pty(path, argv, envp, ".", channels, pts_name, fdm); status = exec_pty(path, argv, envp, ".", channels, pts_name, fdm);
if (status >= 0) { if (status >= 0) {
app_stdin = fdopen(channels[0], "w"); app_stdin = fdopen(channels[0], "w");
app_stdout = fdopen(channels[1], "r"); app_stdout = fdopen(channels[1], "r");
app_stderr = fdopen(channels[2], "r"); app_stderr = fdopen(channels[2], "r");
if (app_stdout == NULL || app_stderr == NULL || app_stdin == NULL) { if (app_stdout == NULL || app_stderr == NULL || app_stdin == NULL) {
fprintf(stderr, "PROBLEMS\n"); fprintf(stderr, "PROBLEMS\n");
} else { } else {
fputs("foo\n", app_stdin); fputs("foo\n", app_stdin);
fputs("bar\n", app_stdin); fputs("bar\n", app_stdin);
while(fgets(buffer, sizeof buffer, app_stdout) != NULL) { while(fgets(buffer, sizeof buffer, app_stdout) != NULL) {
fprintf(stdout, "STDOUT: %s\n", buffer); fprintf(stdout, "STDOUT: %s\n", buffer);
} }
while(fgets(buffer, sizeof buffer, app_stderr) != NULL) { while(fgets(buffer, sizeof buffer, app_stderr) != NULL) {
fprintf(stdout, "STDERR: %s\n", buffer); fprintf(stdout, "STDERR: %s\n", buffer);
} }
} }
} }
fputs("bye\n", stdout); fputs("bye\n", stdout);
close(channels[0]); close(channels[0]);
close(channels[1]); close(channels[1]);
close(channels[2]); close(channels[2]);
return 0; return 0;
} }
#endif #endif

View file

@ -1,158 +1,158 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2002, 2010 QNX Software Systems and others. * Copyright (c) 2002, 2010 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* QNX Software Systems - initial API and implementation * QNX Software Systems - initial API and implementation
* Wind River Systems, Inc. * Wind River Systems, Inc.
* Mikhail Sennikovsky - bug 145737 * Mikhail Sennikovsky - bug 145737
*******************************************************************************/ *******************************************************************************/
#include "exec0.h" #include "exec0.h"
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include <libgen.h> #include <libgen.h>
#include <stdlib.h> #include <stdlib.h>
/* from pfind.c */ /* from pfind.c */
extern char *pfind(const char *name, char * const envp[]); extern char *pfind(const char *name, char * const envp[]);
pid_t pid_t
exec0(const char *path, char *const argv[], char *const envp[], exec0(const char *path, char *const argv[], char *const envp[],
const char *dirpath, int channels[3]) const char *dirpath, int channels[3])
{ {
int pipe0[2], pipe1[2], pipe2[2]; int pipe0[2], pipe1[2], pipe2[2];
pid_t childpid; pid_t childpid;
char *full_path; char *full_path;
/* /*
* We use pfind() to check that the program exists and is an executable. * We use pfind() to check that the program exists and is an executable.
* If not pass the error up. Also execve() wants a full path. * If not pass the error up. Also execve() wants a full path.
*/ */
full_path = pfind(path, envp); full_path = pfind(path, envp);
if (full_path == NULL) { if (full_path == NULL) {
fprintf(stderr, "Unable to find full path for \"%s\"\n", (path) ? path : ""); fprintf(stderr, "Unable to find full path for \"%s\"\n", (path) ? path : "");
return -1; return -1;
} }
/* /*
* Make sure we can create our pipes before forking. * Make sure we can create our pipes before forking.
*/ */
if (channels != NULL) { if (channels != NULL) {
if (pipe(pipe0) < 0 || pipe(pipe1) < 0 || pipe(pipe2) < 0) { if (pipe(pipe0) < 0 || pipe(pipe1) < 0 || pipe(pipe2) < 0) {
fprintf(stderr, "%s(%d): returning due to error.\n", fprintf(stderr, "%s(%d): returning due to error.\n",
__FUNCTION__, __LINE__); __FUNCTION__, __LINE__);
free(full_path); free(full_path);
return -1; return -1;
} }
} }
childpid = fork(); childpid = fork();
if (childpid < 0) { if (childpid < 0) {
fprintf(stderr, "%s(%d): returning due to error: %s\n", fprintf(stderr, "%s(%d): returning due to error: %s\n",
__FUNCTION__, __LINE__, strerror(errno)); __FUNCTION__, __LINE__, strerror(errno));
free(full_path); free(full_path);
return -1; return -1;
} else if (childpid == 0) { /* child */ } else if (childpid == 0) { /* child */
char *ptr; char *ptr;
chdir(dirpath); chdir(dirpath);
if (channels != NULL) { if (channels != NULL) {
/* Close the write end of pipe0 */ /* Close the write end of pipe0 */
if (close(pipe0[1]) == -1) if (close(pipe0[1]) == -1)
perror("close(pipe0[1])"); perror("close(pipe0[1])");
/* Close the read end of pipe1 */ /* Close the read end of pipe1 */
if (close(pipe1[0]) == -1) if (close(pipe1[0]) == -1)
perror("close(pipe1[0])"); perror("close(pipe1[0])");
/* Close the read end of pipe2 */ /* Close the read end of pipe2 */
if (close(pipe2[0]) == -1) if (close(pipe2[0]) == -1)
perror("close(pipe2[0]))"); perror("close(pipe2[0]))");
/* redirections */ /* redirections */
dup2(pipe0[0], STDIN_FILENO); /* dup stdin */ dup2(pipe0[0], STDIN_FILENO); /* dup stdin */
dup2(pipe1[1], STDOUT_FILENO); /* dup stdout */ dup2(pipe1[1], STDOUT_FILENO); /* dup stdout */
dup2(pipe2[1], STDERR_FILENO); /* dup stderr */ dup2(pipe2[1], STDERR_FILENO); /* dup stderr */
} }
/* Close all the fd's in the child */ /* Close all the fd's in the child */
{ {
int fdlimit = sysconf(_SC_OPEN_MAX); int fdlimit = sysconf(_SC_OPEN_MAX);
int fd = 3; int fd = 3;
while (fd < fdlimit) while (fd < fdlimit)
close(fd++); close(fd++);
} }
setpgid(getpid(), getpid()); setpgid(getpid(), getpid());
if (envp[0] == NULL) { if (envp[0] == NULL) {
execv(full_path, argv); execv(full_path, argv);
} else { } else {
execve(full_path, argv, envp); execve(full_path, argv, envp);
} }
_exit(127); _exit(127);
} else if (childpid != 0) { /* parent */ } else if (childpid != 0) { /* parent */
char b; char b;
if (channels != NULL) { if (channels != NULL) {
/* close the read end of pipe1 */ /* close the read end of pipe1 */
if (close(pipe0[0]) == -1) if (close(pipe0[0]) == -1)
perror("close(pipe0[0])"); perror("close(pipe0[0])");
/* close the write end of pipe2 */ /* close the write end of pipe2 */
if (close(pipe1[1]) == -1) if (close(pipe1[1]) == -1)
perror("close(pipe1[1])"); perror("close(pipe1[1])");
/* close the write end of pipe2 */ /* close the write end of pipe2 */
if (close(pipe2[1]) == -1) if (close(pipe2[1]) == -1)
perror("close(pipe2[1])"); perror("close(pipe2[1])");
channels[0] = pipe0[1]; /* Output Stream. */ channels[0] = pipe0[1]; /* Output Stream. */
channels[1] = pipe1[0]; /* Input Stream. */ channels[1] = pipe1[0]; /* Input Stream. */
channels[2] = pipe2[0]; /* Input Stream. */ channels[2] = pipe2[0]; /* Input Stream. */
} }
free(full_path); free(full_path);
return childpid; return childpid;
} }
free(full_path); free(full_path);
return -1; /*NOT REACHED */ return -1; /*NOT REACHED */
} }
int wait0(pid_t pid) int wait0(pid_t pid)
{ {
int status; int status;
int val = -1; int val = -1;
if (pid < 0) if (pid < 0)
return -1; return -1;
for (;;) { for (;;) {
if (waitpid(pid, &status, 0) < 0) { if (waitpid(pid, &status, 0) < 0) {
if (errno == EINTR) { if (errno == EINTR) {
// interrupted system call - retry // interrupted system call - retry
continue; continue;
} }
} }
break; break;
} }
if (WIFEXITED(status)) { if (WIFEXITED(status)) {
val = WEXITSTATUS(status); val = WEXITSTATUS(status);
} }
return val; return val;
} }

View file

@ -1,114 +1,114 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2002, 2006 QNX Software Systems and others. * Copyright (c) 2002, 2006 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* QNX Software Systems - initial API and implementation * QNX Software Systems - initial API and implementation
* Wind River Systems, Inc. * Wind River Systems, Inc.
*******************************************************************************/ *******************************************************************************/
#include <jni.h> #include <jni.h>
#include <stdio.h> #include <stdio.h>
#include <SpawnerInputStream.h> #include <SpawnerInputStream.h>
#include <SpawnerOutputStream.h> #include <SpawnerOutputStream.h>
#include <unistd.h> #include <unistd.h>
/* Header for class _org_eclipse_cdt_utils_spawner_SpawnerInputStream */ /* Header for class _org_eclipse_cdt_utils_spawner_SpawnerInputStream */
/* Header for class _org_eclipse_cdt_utils_spawner_SpawnerOutputStream */ /* Header for class _org_eclipse_cdt_utils_spawner_SpawnerOutputStream */
/* /*
* Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream * Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream
* Method: read0 * Method: read0
* Signature: (I)I * Signature: (I)I
*/ */
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL
Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0(JNIEnv * env, Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_read0(JNIEnv * env,
jobject jobj, jobject jobj,
jint jfd, jint jfd,
jbyteArray buf, jbyteArray buf,
jint buf_len) jint buf_len)
{ {
int fd; int fd;
int status; int status;
jbyte *data; jbyte *data;
int data_len; int data_len;
data = (*env)->GetByteArrayElements(env, buf, 0); data = (*env)->GetByteArrayElements(env, buf, 0);
data_len = buf_len; data_len = buf_len;
fd = jfd; fd = jfd;
status = read( fd, data, data_len ); status = read( fd, data, data_len );
(*env)->ReleaseByteArrayElements(env, buf, data, 0); (*env)->ReleaseByteArrayElements(env, buf, data, 0);
if (status == 0) { if (status == 0) {
/* EOF. */ /* EOF. */
status = -1; status = -1;
} else if (status == -1) { } else if (status == -1) {
/* Error, toss an exception */ /* Error, toss an exception */
jclass exception = (*env)->FindClass(env, "java/io/IOException"); jclass exception = (*env)->FindClass(env, "java/io/IOException");
if (exception == NULL) { if (exception == NULL) {
/* Give up. */ /* Give up. */
return -1; return -1;
} }
(*env)->ThrowNew(env, exception, "read error"); (*env)->ThrowNew(env, exception, "read error");
} }
return status; return status;
} }
/* /*
* Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream * Class: org_eclipse_cdt_utils_spawner_SpawnerInputStream
* Method: close0 * Method: close0
* Signature: (I)I * Signature: (I)I
*/ */
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL
Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0(JNIEnv * env, Java_org_eclipse_cdt_utils_spawner_SpawnerInputStream_close0(JNIEnv * env,
jobject jobj, jobject jobj,
jint fd) jint fd)
{ {
return close(fd); return close(fd);
} }
/* /*
* Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream
* Method: write0 * Method: write0
* Signature: (II)I * Signature: (II)I
*/ */
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL
Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0(JNIEnv * env, Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_write0(JNIEnv * env,
jobject jobj, jobject jobj,
jint jfd, jint jfd,
jbyteArray buf, jbyteArray buf,
jint buf_len) jint buf_len)
{ {
int status; int status;
int fd; int fd;
jbyte *data; jbyte *data;
int data_len; int data_len;
data = (*env)->GetByteArrayElements(env, buf, 0); data = (*env)->GetByteArrayElements(env, buf, 0);
data_len = buf_len; data_len = buf_len;
fd = jfd; fd = jfd;
status = write(fd, data, data_len); status = write(fd, data, data_len);
(*env)->ReleaseByteArrayElements(env, buf, data, 0); (*env)->ReleaseByteArrayElements(env, buf, data, 0);
return status; return status;
} }
/* /*
* Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream * Class: org_eclipse_cdt_utils_spawner_SpawnerOutputStream
* Method: close0 * Method: close0
* Signature: (I)I * Signature: (I)I
*/ */
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL
Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0(JNIEnv * env, Java_org_eclipse_cdt_utils_spawner_SpawnerOutputStream_close0(JNIEnv * env,
jobject jobj, jobject jobj,
jint fd) jint fd)
{ {
return close(fd); return close(fd);
} }

View file

@ -1,302 +1,302 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2002, 2010 QNX Software Systems and others. * Copyright (c) 2002, 2010 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* QNX Software Systems - initial API and implementation * QNX Software Systems - initial API and implementation
* Wind River Systems, Inc. * Wind River Systems, Inc.
* Mikhail Zabaluev (Nokia) - bug 82744 * Mikhail Zabaluev (Nokia) - bug 82744
*******************************************************************************/ *******************************************************************************/
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <signal.h> #include <signal.h>
#include <string.h> #include <string.h>
#include <jni.h> #include <jni.h>
#include "exec0.h" #include "exec0.h"
#include <Spawner.h> #include <Spawner.h>
#define DEBUGIT 0 #define DEBUGIT 0
/* /*
* Header for class org_eclipse_cdt_utils_spawner_Spawner * Header for class org_eclipse_cdt_utils_spawner_Spawner
*/ */
#if DEBUGIT #if DEBUGIT
static void print_array(char **c_array) static void print_array(char **c_array)
{ {
if (c_array) { if (c_array) {
char **p = c_array; char **p = c_array;
for (; *p; p++) { for (; *p; p++) {
if (*p) { if (*p) {
fprintf(stderr, " %s", *p); fprintf(stderr, " %s", *p);
} }
} }
} else { } else {
fprintf(stderr, "null"); fprintf(stderr, "null");
} }
fprintf(stderr, "\n"); fprintf(stderr, "\n");
} }
#endif #endif
static char **alloc_c_array(JNIEnv * env, jobjectArray j_array) static char **alloc_c_array(JNIEnv * env, jobjectArray j_array)
{ {
int i; int i;
jint c_array_size = (*env)->GetArrayLength(env, j_array); jint c_array_size = (*env)->GetArrayLength(env, j_array);
char **c_array = calloc(c_array_size + 1, sizeof(*c_array)); char **c_array = calloc(c_array_size + 1, sizeof(*c_array));
if (c_array == NULL) if (c_array == NULL)
return NULL; return NULL;
for (i = 0; i < c_array_size; i++) { for (i = 0; i < c_array_size; i++) {
jstring j_str = jstring j_str =
(jstring) (*env)->GetObjectArrayElement(env, j_array, i); (jstring) (*env)->GetObjectArrayElement(env, j_array, i);
const char *c_str = (*env)->GetStringUTFChars(env, j_str, NULL); const char *c_str = (*env)->GetStringUTFChars(env, j_str, NULL);
c_array[i] = (char *) strdup(c_str); c_array[i] = (char *) strdup(c_str);
(*env)->ReleaseStringUTFChars(env, j_str, c_str); (*env)->ReleaseStringUTFChars(env, j_str, c_str);
(*env)->DeleteLocalRef(env, j_str); (*env)->DeleteLocalRef(env, j_str);
} }
return c_array; return c_array;
} }
static void free_c_array(char **c_array) static void free_c_array(char **c_array)
{ {
if (c_array) { if (c_array) {
char **p = c_array; char **p = c_array;
for (; *p; p++) { for (; *p; p++) {
if (*p) { if (*p) {
free(*p); free(*p);
} }
} }
free(c_array); free(c_array);
} }
} }
/* /*
* Class: org_eclipse_cdt_utils_spawner_Spawner * Class: org_eclipse_cdt_utils_spawner_Spawner
* Method: exec2 * Method: exec2
* Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[ILorg/eclipse/cdt/utils/pty/PTY;)I * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[ILorg/eclipse/cdt/utils/pty/PTY;)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec2 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_spawner_Spawner_exec2
(JNIEnv *env, jobject jobj, jobjectArray jcmd, jobjectArray jenv, jstring jdir, jintArray jchannels, (JNIEnv *env, jobject jobj, jobjectArray jcmd, jobjectArray jenv, jstring jdir, jintArray jchannels,
jstring jslaveName, jint masterFD, jboolean console) jstring jslaveName, jint masterFD, jboolean console)
{ {
jint *channels = (*env)->GetIntArrayElements(env, jchannels, 0); jint *channels = (*env)->GetIntArrayElements(env, jchannels, 0);
const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL); const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL);
const char *pts_name = (*env)->GetStringUTFChars(env, jslaveName, NULL); const char *pts_name = (*env)->GetStringUTFChars(env, jslaveName, NULL);
char **cmd = NULL; char **cmd = NULL;
char **envp = NULL; char **envp = NULL;
int fd[3]; int fd[3];
pid_t pid = -1; pid_t pid = -1;
if (channels == NULL) if (channels == NULL)
goto bail_out; goto bail_out;
cmd = alloc_c_array(env, jcmd); cmd = alloc_c_array(env, jcmd);
if (cmd == NULL) if (cmd == NULL)
goto bail_out; goto bail_out;
envp = alloc_c_array(env, jenv); envp = alloc_c_array(env, jenv);
if (envp == NULL) if (envp == NULL)
goto bail_out; goto bail_out;
#if DEBUGIT #if DEBUGIT
fprintf(stderr, "command:"); fprintf(stderr, "command:");
print_array(cmd); print_array(cmd);
fprintf(stderr, "Envp:"); fprintf(stderr, "Envp:");
print_array(envp); print_array(envp);
fprintf(stderr, "dirpath: %s\n", dirpath); fprintf(stderr, "dirpath: %s\n", dirpath);
fprintf(stderr, "pts_name: %s\n", pts_name); fprintf(stderr, "pts_name: %s\n", pts_name);
#endif #endif
pid = exec_pty(cmd[0], cmd, envp, dirpath, fd, pts_name, masterFD, console); pid = exec_pty(cmd[0], cmd, envp, dirpath, fd, pts_name, masterFD, console);
if (pid < 0) if (pid < 0)
goto bail_out; goto bail_out;
channels[0] = fd[0]; channels[0] = fd[0];
channels[1] = fd[1]; channels[1] = fd[1];
channels[2] = fd[2]; channels[2] = fd[2];
bail_out: bail_out:
(*env)->ReleaseIntArrayElements(env, jchannels, channels, 0); (*env)->ReleaseIntArrayElements(env, jchannels, channels, 0);
(*env)->ReleaseStringUTFChars(env, jdir, dirpath); (*env)->ReleaseStringUTFChars(env, jdir, dirpath);
(*env)->ReleaseStringUTFChars(env, jslaveName, pts_name); (*env)->ReleaseStringUTFChars(env, jslaveName, pts_name);
if (cmd) if (cmd)
free_c_array(cmd); free_c_array(cmd);
if (envp) if (envp)
free_c_array(envp); free_c_array(envp);
return pid; return pid;
} }
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL
Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv * env, jobject jobj, Java_org_eclipse_cdt_utils_spawner_Spawner_exec1(JNIEnv * env, jobject jobj,
jobjectArray jcmd, jobjectArray jcmd,
jobjectArray jenv, jobjectArray jenv,
jstring jdir) jstring jdir)
{ {
const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL); const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL);
char **cmd = NULL; char **cmd = NULL;
char **envp = NULL; char **envp = NULL;
pid_t pid = -1; pid_t pid = -1;
cmd = alloc_c_array(env, jcmd); cmd = alloc_c_array(env, jcmd);
if (cmd == NULL) if (cmd == NULL)
goto bail_out; goto bail_out;
envp = alloc_c_array(env, jenv); envp = alloc_c_array(env, jenv);
if (envp == NULL) if (envp == NULL)
goto bail_out; goto bail_out;
#if DEBUGIT #if DEBUGIT
fprintf(stderr, "command:"); fprintf(stderr, "command:");
print_array(cmd); print_array(cmd);
fprintf(stderr, "Envp:"); fprintf(stderr, "Envp:");
print_array(envp); print_array(envp);
fprintf(stderr, "dirpath: %s\n", dirpath); fprintf(stderr, "dirpath: %s\n", dirpath);
#endif #endif
pid = exec0(cmd[0], cmd, envp, dirpath, NULL); pid = exec0(cmd[0], cmd, envp, dirpath, NULL);
if (pid < 0) if (pid < 0)
goto bail_out; goto bail_out;
bail_out: bail_out:
(*env)->ReleaseStringUTFChars(env, jdir, dirpath); (*env)->ReleaseStringUTFChars(env, jdir, dirpath);
if (cmd) if (cmd)
free_c_array(cmd); free_c_array(cmd);
if (envp) if (envp)
free_c_array(envp); free_c_array(envp);
return pid; return pid;
} }
/* /*
* Class: org_eclipse_cdt_utils_spawner_Spawner * Class: org_eclipse_cdt_utils_spawner_Spawner
* Method: exec0 * Method: exec0
* Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[I)I * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[I)I
*/ */
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL
Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv * env, jobject jobj, Java_org_eclipse_cdt_utils_spawner_Spawner_exec0(JNIEnv * env, jobject jobj,
jobjectArray jcmd, jobjectArray jcmd,
jobjectArray jenv, jobjectArray jenv,
jstring jdir, jstring jdir,
jintArray jchannels) jintArray jchannels)
{ {
jint *channels = (*env)->GetIntArrayElements(env, jchannels, 0); jint *channels = (*env)->GetIntArrayElements(env, jchannels, 0);
const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL); const char *dirpath = (*env)->GetStringUTFChars(env, jdir, NULL);
char **cmd = NULL; char **cmd = NULL;
char **envp = NULL; char **envp = NULL;
int fd[3]; int fd[3];
pid_t pid = -1; pid_t pid = -1;
if (channels == NULL) if (channels == NULL)
goto bail_out; goto bail_out;
cmd = alloc_c_array(env, jcmd); cmd = alloc_c_array(env, jcmd);
if (cmd == NULL) if (cmd == NULL)
goto bail_out; goto bail_out;
envp = alloc_c_array(env, jenv); envp = alloc_c_array(env, jenv);
if (envp == NULL) if (envp == NULL)
goto bail_out; goto bail_out;
#if DEBUGIT #if DEBUGIT
fprintf(stderr, "command:"); fprintf(stderr, "command:");
print_array(cmd); print_array(cmd);
fprintf(stderr, "Envp:"); fprintf(stderr, "Envp:");
print_array(envp); print_array(envp);
fprintf(stderr, "dirpath: %s\n", dirpath); fprintf(stderr, "dirpath: %s\n", dirpath);
#endif #endif
pid = exec0(cmd[0], cmd, envp, dirpath, fd); pid = exec0(cmd[0], cmd, envp, dirpath, fd);
if (pid < 0) if (pid < 0)
goto bail_out; goto bail_out;
channels[0] = fd[0]; channels[0] = fd[0];
channels[1] = fd[1]; channels[1] = fd[1];
channels[2] = fd[2]; channels[2] = fd[2];
bail_out: bail_out:
(*env)->ReleaseIntArrayElements(env, jchannels, channels, 0); (*env)->ReleaseIntArrayElements(env, jchannels, channels, 0);
(*env)->ReleaseStringUTFChars(env, jdir, dirpath); (*env)->ReleaseStringUTFChars(env, jdir, dirpath);
if (cmd) if (cmd)
free_c_array(cmd); free_c_array(cmd);
if (envp) if (envp)
free_c_array(envp); free_c_array(envp);
return pid; return pid;
} }
/* /*
* Class: org_eclipse_cdt_utils_spawner_Spawner * Class: org_eclipse_cdt_utils_spawner_Spawner
* Method: raise * Method: raise
* Signature: (II)I * Signature: (II)I
*/ */
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL
Java_org_eclipse_cdt_utils_spawner_Spawner_raise(JNIEnv * env, jobject jobj, Java_org_eclipse_cdt_utils_spawner_Spawner_raise(JNIEnv * env, jobject jobj,
jint pid, jint sig) jint pid, jint sig)
{ {
int status = -1; int status = -1;
switch (sig) { switch (sig) {
case 0: /* NOOP */ case 0: /* NOOP */
status = killpg(pid, 0); status = killpg(pid, 0);
if(status == -1) { if(status == -1) {
status = kill(pid, 0); status = kill(pid, 0);
} }
break; break;
case 2: /* INTERRUPT */ case 2: /* INTERRUPT */
status = killpg(pid, SIGINT); status = killpg(pid, SIGINT);
if(status == -1) { if(status == -1) {
status = kill(pid, SIGINT); status = kill(pid, SIGINT);
} }
break; break;
case 9: /* KILL */ case 9: /* KILL */
status = killpg(pid, SIGKILL); status = killpg(pid, SIGKILL);
if(status == -1) { if(status == -1) {
status = kill(pid, SIGKILL); status = kill(pid, SIGKILL);
} }
break; break;
case 15: /* TERM */ case 15: /* TERM */
status = killpg(pid, SIGTERM); status = killpg(pid, SIGTERM);
if(status == -1) { if(status == -1) {
status = kill(pid, SIGTERM); status = kill(pid, SIGTERM);
} }
break; break;
default: default:
status = killpg(pid, sig); /* WHAT ?? */ status = killpg(pid, sig); /* WHAT ?? */
if(status == -1) { if(status == -1) {
status = kill(pid, sig); /* WHAT ?? */ status = kill(pid, sig); /* WHAT ?? */
} }
break; break;
} }
return status; return status;
} }
/* /*
* Class: org_eclipse_cdt_utils_spawner_Spawner * Class: org_eclipse_cdt_utils_spawner_Spawner
* Method: waitFor * Method: waitFor
* Signature: (I)I * Signature: (I)I
*/ */
JNIEXPORT jint JNICALL JNIEXPORT jint JNICALL
Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor(JNIEnv * env, Java_org_eclipse_cdt_utils_spawner_Spawner_waitFor(JNIEnv * env,
jobject jobj, jint pid) jobject jobj, jint pid)
{ {
return wait0(pid); return wait0(pid);
} }

View file

@ -1,2 +1,2 @@
fragmentName.linux=C/C++ Development Tools Core for Linux fragmentName.linux=C/C++ Development Tools Core for Linux
providerName=Eclipse CDT providerName=Eclipse CDT

View file

@ -1,186 +1,186 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2004, 2010 QNX Software Systems and others. * Copyright (c) 2004, 2010 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* QNX Software Systems - initial API and implementation * QNX Software Systems - initial API and implementation
* Wind River Systems, Inc. * Wind River Systems, Inc.
* Mikhail Zabaluev (Nokia) - bug 82744 * Mikhail Zabaluev (Nokia) - bug 82744
* Mikhail Sennikovsky - bug 145737 * Mikhail Sennikovsky - bug 145737
*******************************************************************************/ *******************************************************************************/
#include "exec0.h" #include "exec0.h"
#include "openpty.h" #include "openpty.h"
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#include <libgen.h> #include <libgen.h>
#include <stdlib.h> #include <stdlib.h>
#include <termios.h> #include <termios.h>
/* from pfind.c */ /* from pfind.c */
extern char *pfind(const char *name, char * const envp[]); extern char *pfind(const char *name, char * const envp[]);
pid_t pid_t
exec_pty(const char *path, char *const argv[], char *const envp[], exec_pty(const char *path, char *const argv[], char *const envp[],
const char *dirpath, int channels[3], const char *pts_name, int fdm, int console) const char *dirpath, int channels[3], const char *pts_name, int fdm, int console)
{ {
int pipe2[2]; int pipe2[2];
pid_t childpid; pid_t childpid;
char *full_path; char *full_path;
/* /*
* We use pfind() to check that the program exists and is an executable. * We use pfind() to check that the program exists and is an executable.
* If not pass the error up. Also execve() wants a full path. * If not pass the error up. Also execve() wants a full path.
*/ */
full_path = pfind(path, envp); full_path = pfind(path, envp);
if (full_path == NULL) { if (full_path == NULL) {
fprintf(stderr, "Unable to find full path for \"%s\"\n", (path) ? path : ""); fprintf(stderr, "Unable to find full path for \"%s\"\n", (path) ? path : "");
return -1; return -1;
} }
/* /*
* Make sure we can create our pipes before forking. * Make sure we can create our pipes before forking.
*/ */
if (channels != NULL && console) { if (channels != NULL && console) {
if (pipe(pipe2) < 0) { if (pipe(pipe2) < 0) {
fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno)); fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno));
free(full_path); free(full_path);
return -1; return -1;
} }
} }
childpid = fork(); childpid = fork();
if (childpid < 0) { if (childpid < 0) {
fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno)); fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno));
free(full_path); free(full_path);
return -1; return -1;
} else if (childpid == 0) { /* child */ } else if (childpid == 0) { /* child */
chdir(dirpath); chdir(dirpath);
if (channels != NULL) { if (channels != NULL) {
int fds; int fds;
if (!console && setsid() < 0) { if (!console && setsid() < 0) {
perror("setsid()"); perror("setsid()");
return -1; return -1;
} }
fds = ptys_open(fdm, pts_name); fds = ptys_open(fdm, pts_name);
if (fds < 0) { if (fds < 0) {
fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno)); fprintf(stderr, "%s(%d): returning due to error: %s\n", __FUNCTION__, __LINE__, strerror(errno));
return -1; return -1;
} }
/* Close the read end of pipe2 */ /* Close the read end of pipe2 */
if (console && close(pipe2[0]) == -1) { if (console && close(pipe2[0]) == -1) {
perror("close(pipe2[0]))"); perror("close(pipe2[0]))");
} }
/* close the master, no need in the child */ /* close the master, no need in the child */
close(fdm); close(fdm);
if (console) { if (console) {
set_noecho(fds); set_noecho(fds);
if (setpgid(getpid(), getpid()) < 0) { if (setpgid(getpid(), getpid()) < 0) {
perror("setpgid()"); perror("setpgid()");
return -1; return -1;
} }
} }
/* redirections */ /* redirections */
dup2(fds, STDIN_FILENO); /* dup stdin */ dup2(fds, STDIN_FILENO); /* dup stdin */
dup2(fds, STDOUT_FILENO); /* dup stdout */ dup2(fds, STDOUT_FILENO); /* dup stdout */
if (console) { if (console) {
dup2(pipe2[1], STDERR_FILENO); /* dup stderr */ dup2(pipe2[1], STDERR_FILENO); /* dup stderr */
} else { } else {
dup2(fds, STDERR_FILENO); /* dup stderr */ dup2(fds, STDERR_FILENO); /* dup stderr */
} }
close(fds); /* done with fds. */ close(fds); /* done with fds. */
} }
/* Close all the fd's in the child */ /* Close all the fd's in the child */
{ {
int fdlimit = sysconf(_SC_OPEN_MAX); int fdlimit = sysconf(_SC_OPEN_MAX);
int fd = 3; int fd = 3;
while (fd < fdlimit) while (fd < fdlimit)
close(fd++); close(fd++);
} }
if (envp[0] == NULL) { if (envp[0] == NULL) {
execv(full_path, argv); execv(full_path, argv);
} else { } else {
execve(full_path, argv, envp); execve(full_path, argv, envp);
} }
_exit(127); _exit(127);
} else if (childpid != 0) { /* parent */ } else if (childpid != 0) { /* parent */
if (console) { if (console) {
set_noecho(fdm); set_noecho(fdm);
} }
if (channels != NULL) { if (channels != NULL) {
channels[0] = fdm; /* Input Stream. */ channels[0] = fdm; /* Input Stream. */
channels[1] = fdm; /* Output Stream. */ channels[1] = fdm; /* Output Stream. */
if (console) { if (console) {
/* close the write end of pipe1 */ /* close the write end of pipe1 */
if (close(pipe2[1]) == -1) if (close(pipe2[1]) == -1)
perror("close(pipe2[1])"); perror("close(pipe2[1])");
channels[2] = pipe2[0]; /* stderr Stream. */ channels[2] = pipe2[0]; /* stderr Stream. */
} else { } else {
channels[2] = fdm; /* Error Stream. */ channels[2] = fdm; /* Error Stream. */
} }
} }
free(full_path); free(full_path);
return childpid; return childpid;
} }
free(full_path); free(full_path);
return -1; /*NOT REACHED */ return -1; /*NOT REACHED */
} }
#ifdef __STAND_ALONE__ #ifdef __STAND_ALONE__
int main(int argc, char **argv, char **envp) { int main(int argc, char **argv, char **envp) {
const char *path = "./bufferring_test"; const char *path = "./bufferring_test";
int channels[3] = { -1, -1, -1}; int channels[3] = { -1, -1, -1};
int status; int status;
FILE *app_stdin; FILE *app_stdin;
FILE *app_stdout; FILE *app_stdout;
FILE *app_stderr; FILE *app_stderr;
char pts_name[32]; char pts_name[32];
int fdm; int fdm;
char buffer[32]; char buffer[32];
fdm = ptym_open(pts_name); fdm = ptym_open(pts_name);
status = exec_pty(path, argv, envp, ".", channels, pts_name, fdm); status = exec_pty(path, argv, envp, ".", channels, pts_name, fdm);
if (status >= 0) { if (status >= 0) {
app_stdin = fdopen(channels[0], "w"); app_stdin = fdopen(channels[0], "w");
app_stdout = fdopen(channels[1], "r"); app_stdout = fdopen(channels[1], "r");
app_stderr = fdopen(channels[2], "r"); app_stderr = fdopen(channels[2], "r");
if (app_stdout == NULL || app_stderr == NULL || app_stdin == NULL) { if (app_stdout == NULL || app_stderr == NULL || app_stdin == NULL) {
fprintf(stderr, "PROBLEMS\n"); fprintf(stderr, "PROBLEMS\n");
} else { } else {
fputs("foo\n", app_stdin); fputs("foo\n", app_stdin);
fputs("bar\n", app_stdin); fputs("bar\n", app_stdin);
while(fgets(buffer, sizeof buffer, app_stdout) != NULL) { while(fgets(buffer, sizeof buffer, app_stdout) != NULL) {
fprintf(stdout, "STDOUT: %s\n", buffer); fprintf(stdout, "STDOUT: %s\n", buffer);
} }
while(fgets(buffer, sizeof buffer, app_stderr) != NULL) { while(fgets(buffer, sizeof buffer, app_stderr) != NULL) {
fprintf(stdout, "STDERR: %s\n", buffer); fprintf(stdout, "STDERR: %s\n", buffer);
} }
} }
} }
fputs("bye\n", stdout); fputs("bye\n", stdout);
close(channels[0]); close(channels[0]);
close(channels[1]); close(channels[1]);
close(channels[2]); close(channels[2]);
return 0; return 0;
} }
#endif #endif

View file

@ -1,2 +1,2 @@
fragmentName.linux=C/C++ Development Tools Core for Mac OS X fragmentName.linux=C/C++ Development Tools Core for Mac OS X
providerName=Eclipse CDT providerName=Eclipse CDT

View file

@ -1,33 +1,33 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2010, 2012 Andrew Gvozdev and others. * Copyright (c) 2010, 2012 Andrew Gvozdev and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Andrew Gvozdev - initial API and implementation * Andrew Gvozdev - initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.internal.tests.filesystem.ram; package org.eclipse.cdt.core.internal.tests.filesystem.ram;
import java.net.URI; import java.net.URI;
import org.eclipse.cdt.core.EFSExtensionProvider; import org.eclipse.cdt.core.EFSExtensionProvider;
/** /**
* Test stub to test EFSExtensionProvider mappings. * Test stub to test EFSExtensionProvider mappings.
* *
*/ */
public class MemoryEFSExtensionProvider extends EFSExtensionProvider { public class MemoryEFSExtensionProvider extends EFSExtensionProvider {
public String getMappedPath(URI locationURI) { public String getMappedPath(URI locationURI) {
String path = locationURI.getPath(); String path = locationURI.getPath();
if (path.contains("/BeingMappedFrom/Folder")) { if (path.contains("/BeingMappedFrom/Folder")) {
return path.replaceFirst("/BeingMappedFrom/Folder", "/LocallyMappedTo/Folder"); return path.replaceFirst("/BeingMappedFrom/Folder", "/LocallyMappedTo/Folder");
} }
return super.getMappedPath(locationURI); return super.getMappedPath(locationURI);
} }
} }

View file

@ -1,302 +1,302 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2013 Andrew Gvozdev and others. * Copyright (c) 2013 Andrew Gvozdev and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Andrew Gvozdev - Initial API and implementation * Andrew Gvozdev - Initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.language.settings.providers; package org.eclipse.cdt.core.language.settings.providers;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.LinkedHashSet; import java.util.LinkedHashSet;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import junit.framework.TestSuite; import junit.framework.TestSuite;
import org.eclipse.cdt.core.model.CoreModel; import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.settings.model.CIncludePathEntry; import org.eclipse.cdt.core.settings.model.CIncludePathEntry;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry; import org.eclipse.cdt.core.settings.model.ICLanguageSettingEntry;
import org.eclipse.cdt.core.settings.model.ICProjectDescription; import org.eclipse.cdt.core.settings.model.ICProjectDescription;
import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager; import org.eclipse.cdt.core.settings.model.ICProjectDescriptionManager;
import org.eclipse.cdt.core.settings.model.ICSettingEntry; import org.eclipse.cdt.core.settings.model.ICSettingEntry;
import org.eclipse.cdt.core.settings.model.util.CDataUtil; import org.eclipse.cdt.core.settings.model.util.CDataUtil;
import org.eclipse.cdt.core.testplugin.ResourceHelper; import org.eclipse.cdt.core.testplugin.ResourceHelper;
import org.eclipse.cdt.core.testplugin.util.BaseTestCase; import org.eclipse.cdt.core.testplugin.util.BaseTestCase;
import org.eclipse.cdt.internal.core.language.settings.providers.ReferencedProjectsLanguageSettingsProvider; import org.eclipse.cdt.internal.core.language.settings.providers.ReferencedProjectsLanguageSettingsProvider;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
/** /**
* Test cases testing ReferencedProjectsLanguageSettingsProvider functionality * Test cases testing ReferencedProjectsLanguageSettingsProvider functionality
*/ */
public class LanguageSettingsProviderReferencedProjectsTests extends BaseTestCase { public class LanguageSettingsProviderReferencedProjectsTests extends BaseTestCase {
/** /**
* Constructor. * Constructor.
* @param name - name of the test. * @param name - name of the test.
*/ */
public LanguageSettingsProviderReferencedProjectsTests(String name) { public LanguageSettingsProviderReferencedProjectsTests(String name) {
super(name); super(name);
} }
@Override @Override
protected void setUp() throws Exception { protected void setUp() throws Exception {
super.setUp(); super.setUp();
} }
@Override @Override
protected void tearDown() throws Exception { protected void tearDown() throws Exception {
super.tearDown(); // includes ResourceHelper cleanup super.tearDown(); // includes ResourceHelper cleanup
} }
/** /**
* @return - new TestSuite. * @return - new TestSuite.
*/ */
public static TestSuite suite() { public static TestSuite suite() {
return new TestSuite(LanguageSettingsProviderReferencedProjectsTests.class); return new TestSuite(LanguageSettingsProviderReferencedProjectsTests.class);
} }
/** /**
* main function of the class. * main function of the class.
* *
* @param args - arguments * @param args - arguments
*/ */
public static void main(String[] args) { public static void main(String[] args) {
junit.textui.TestRunner.run(suite()); junit.textui.TestRunner.run(suite());
} }
/** /**
* Helper method to fetch configuration descriptions. * Helper method to fetch configuration descriptions.
*/ */
private ICConfigurationDescription[] getConfigurationDescriptions(IProject project) { private ICConfigurationDescription[] getConfigurationDescriptions(IProject project) {
CoreModel coreModel = CoreModel.getDefault(); CoreModel coreModel = CoreModel.getDefault();
ICProjectDescriptionManager mngr = coreModel.getProjectDescriptionManager(); ICProjectDescriptionManager mngr = coreModel.getProjectDescriptionManager();
// project description // project description
ICProjectDescription projectDescription = mngr.getProjectDescription(project, false); ICProjectDescription projectDescription = mngr.getProjectDescription(project, false);
assertNotNull(projectDescription); assertNotNull(projectDescription);
assertEquals(1, projectDescription.getConfigurations().length); assertEquals(1, projectDescription.getConfigurations().length);
// configuration description // configuration description
ICConfigurationDescription[] cfgDescriptions = projectDescription.getConfigurations(); ICConfigurationDescription[] cfgDescriptions = projectDescription.getConfigurations();
return cfgDescriptions; return cfgDescriptions;
} }
/** /**
* Helper method to set reference project. * Helper method to set reference project.
*/ */
private void setReference(IProject project, final IProject projectReferenced) throws CoreException { private void setReference(IProject project, final IProject projectReferenced) throws CoreException {
{ {
CoreModel coreModel = CoreModel.getDefault(); CoreModel coreModel = CoreModel.getDefault();
ICProjectDescriptionManager mngr = coreModel.getProjectDescriptionManager(); ICProjectDescriptionManager mngr = coreModel.getProjectDescriptionManager();
// project description // project description
ICProjectDescription projectDescription = mngr.getProjectDescription(project); ICProjectDescription projectDescription = mngr.getProjectDescription(project);
assertNotNull(projectDescription); assertNotNull(projectDescription);
assertEquals(1, projectDescription.getConfigurations().length); assertEquals(1, projectDescription.getConfigurations().length);
// configuration description // configuration description
ICConfigurationDescription[] cfgDescriptions = projectDescription.getConfigurations(); ICConfigurationDescription[] cfgDescriptions = projectDescription.getConfigurations();
ICConfigurationDescription cfgDescription = cfgDescriptions[0]; ICConfigurationDescription cfgDescription = cfgDescriptions[0];
final ICConfigurationDescription cfgDescriptionReferenced = getConfigurationDescriptions(projectReferenced)[0]; final ICConfigurationDescription cfgDescriptionReferenced = getConfigurationDescriptions(projectReferenced)[0];
cfgDescription.setReferenceInfo(new HashMap<String, String>() {{ put(projectReferenced.getName(), cfgDescriptionReferenced.getId()); }}); cfgDescription.setReferenceInfo(new HashMap<String, String>() {{ put(projectReferenced.getName(), cfgDescriptionReferenced.getId()); }});
coreModel.setProjectDescription(project, projectDescription); coreModel.setProjectDescription(project, projectDescription);
} }
{ {
// doublecheck that it's set as expected // doublecheck that it's set as expected
ICConfigurationDescription[] cfgDescriptions = getConfigurationDescriptions(project); ICConfigurationDescription[] cfgDescriptions = getConfigurationDescriptions(project);
ICConfigurationDescription cfgDescription = cfgDescriptions[0]; ICConfigurationDescription cfgDescription = cfgDescriptions[0];
Map<String,String> refs = cfgDescription.getReferenceInfo(); Map<String,String> refs = cfgDescription.getReferenceInfo();
assertEquals(1, refs.size()); assertEquals(1, refs.size());
Set<String> referencedProjectsNames = new LinkedHashSet<String>(refs.keySet()); Set<String> referencedProjectsNames = new LinkedHashSet<String>(refs.keySet());
assertEquals(projectReferenced.getName(), referencedProjectsNames.toArray()[0]); assertEquals(projectReferenced.getName(), referencedProjectsNames.toArray()[0]);
} }
} }
/** /**
* Test that null arguments don't crash the provider. * Test that null arguments don't crash the provider.
*/ */
public void testNulls() throws Exception { public void testNulls() throws Exception {
ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(ReferencedProjectsLanguageSettingsProvider.ID); ILanguageSettingsProvider provider = LanguageSettingsManager.getWorkspaceProvider(ReferencedProjectsLanguageSettingsProvider.ID);
assertNotNull(provider); assertNotNull(provider);
List<ICLanguageSettingEntry> entries = provider.getSettingEntries(null, null, null); List<ICLanguageSettingEntry> entries = provider.getSettingEntries(null, null, null);
assertEquals(null, entries); assertEquals(null, entries);
} }
/** /**
* Test main functionality of ReferencedProjectsLanguageSettingsProvider. * Test main functionality of ReferencedProjectsLanguageSettingsProvider.
*/ */
public void testReferencedProjectProvider() throws Exception { public void testReferencedProjectProvider() throws Exception {
// Create model project and accompanied descriptions // Create model project and accompanied descriptions
String projectName = getName(); String projectName = getName();
IProject project = ResourceHelper.createCDTProjectWithConfig(projectName); IProject project = ResourceHelper.createCDTProjectWithConfig(projectName);
IProject nonReferencedProject = ResourceHelper.createCDTProjectWithConfig(projectName+"-non-referenced"); IProject nonReferencedProject = ResourceHelper.createCDTProjectWithConfig(projectName+"-non-referenced");
IProject referencedProject = ResourceHelper.createCDTProjectWithConfig(projectName+"-referenced"); IProject referencedProject = ResourceHelper.createCDTProjectWithConfig(projectName+"-referenced");
setReference(project, referencedProject); setReference(project, referencedProject);
// get cfgDescription // get cfgDescription
ICConfigurationDescription[] cfgDescriptions = getConfigurationDescriptions(project); ICConfigurationDescription[] cfgDescriptions = getConfigurationDescriptions(project);
ICConfigurationDescription cfgDescription = cfgDescriptions[0]; ICConfigurationDescription cfgDescription = cfgDescriptions[0];
{ {
// double-check that provider for referenced projects is set in the configuration // double-check that provider for referenced projects is set in the configuration
ILanguageSettingsProvider refProjectsProvider = LanguageSettingsManager.getWorkspaceProvider(ReferencedProjectsLanguageSettingsProvider.ID); ILanguageSettingsProvider refProjectsProvider = LanguageSettingsManager.getWorkspaceProvider(ReferencedProjectsLanguageSettingsProvider.ID);
assertNotNull(refProjectsProvider); assertNotNull(refProjectsProvider);
List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders(); List<ILanguageSettingsProvider> providers = ((ILanguageSettingsProvidersKeeper) cfgDescription).getLanguageSettingProviders();
assertTrue(providers.contains(refProjectsProvider)); assertTrue(providers.contains(refProjectsProvider));
} }
// Check that no setting entries are set initially // Check that no setting entries are set initially
{ {
List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescription, project, null, ICSettingEntry.ALL); List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescription, project, null, ICSettingEntry.ALL);
assertEquals(0, entries.size()); assertEquals(0, entries.size());
} }
// Add an entry into a non-referenced project // Add an entry into a non-referenced project
CIncludePathEntry nonRefEntry = CDataUtil.createCIncludePathEntry("non-referenced-exported", ICSettingEntry.EXPORTED); CIncludePathEntry nonRefEntry = CDataUtil.createCIncludePathEntry("non-referenced-exported", ICSettingEntry.EXPORTED);
{ {
ICConfigurationDescription[] nonRefCfgDescriptions = getConfigurationDescriptions(nonReferencedProject); ICConfigurationDescription[] nonRefCfgDescriptions = getConfigurationDescriptions(nonReferencedProject);
ICConfigurationDescription nonRefCfgDescription = nonRefCfgDescriptions[0]; ICConfigurationDescription nonRefCfgDescription = nonRefCfgDescriptions[0];
List<ILanguageSettingsProvider> providersNonRef = ((ILanguageSettingsProvidersKeeper) nonRefCfgDescription).getLanguageSettingProviders(); List<ILanguageSettingsProvider> providersNonRef = ((ILanguageSettingsProvidersKeeper) nonRefCfgDescription).getLanguageSettingProviders();
// get user provider which is the first one // get user provider which is the first one
ILanguageSettingsProvider userProviderNonRef = providersNonRef.get(0); ILanguageSettingsProvider userProviderNonRef = providersNonRef.get(0);
assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderNonRef.getId()); assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderNonRef.getId());
assertTrue(userProviderNonRef instanceof LanguageSettingsGenericProvider); assertTrue(userProviderNonRef instanceof LanguageSettingsGenericProvider);
// add sample entries // add sample entries
ArrayList<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); ArrayList<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
entries.add(nonRefEntry); entries.add(nonRefEntry);
((LanguageSettingsGenericProvider) userProviderNonRef).setSettingEntries(null, null, null, entries); ((LanguageSettingsGenericProvider) userProviderNonRef).setSettingEntries(null, null, null, entries);
} }
// Confirm that that does not add entries to the main project // Confirm that that does not add entries to the main project
{ {
List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescription, project, null, ICSettingEntry.ALL); List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescription, project, null, ICSettingEntry.ALL);
assertEquals(0, entries.size()); assertEquals(0, entries.size());
} }
CIncludePathEntry refEntry = CDataUtil.createCIncludePathEntry("referenced-exported", ICSettingEntry.EXPORTED); CIncludePathEntry refEntry = CDataUtil.createCIncludePathEntry("referenced-exported", ICSettingEntry.EXPORTED);
// Add entries into a referenced project // Add entries into a referenced project
{ {
ICConfigurationDescription[] refCfgDescriptions = getConfigurationDescriptions(referencedProject); ICConfigurationDescription[] refCfgDescriptions = getConfigurationDescriptions(referencedProject);
ICConfigurationDescription refCfgDescription = refCfgDescriptions[0]; ICConfigurationDescription refCfgDescription = refCfgDescriptions[0];
List<ILanguageSettingsProvider> providersRef = ((ILanguageSettingsProvidersKeeper) refCfgDescription).getLanguageSettingProviders(); List<ILanguageSettingsProvider> providersRef = ((ILanguageSettingsProvidersKeeper) refCfgDescription).getLanguageSettingProviders();
// get user provider which is the first one // get user provider which is the first one
ILanguageSettingsProvider userProviderRef = providersRef.get(0); ILanguageSettingsProvider userProviderRef = providersRef.get(0);
assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderRef.getId()); assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderRef.getId());
assertTrue(userProviderRef instanceof LanguageSettingsGenericProvider); assertTrue(userProviderRef instanceof LanguageSettingsGenericProvider);
// add sample entries // add sample entries
ArrayList<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); ArrayList<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
CIncludePathEntry refEntryNotExported = CDataUtil.createCIncludePathEntry("referenced-not-exported", 0); CIncludePathEntry refEntryNotExported = CDataUtil.createCIncludePathEntry("referenced-not-exported", 0);
entries.add(refEntry); entries.add(refEntry);
entries.add(refEntryNotExported); entries.add(refEntryNotExported);
((LanguageSettingsGenericProvider) userProviderRef).setSettingEntries(null, null, null, entries); ((LanguageSettingsGenericProvider) userProviderRef).setSettingEntries(null, null, null, entries);
List<ICLanguageSettingEntry> entriesActual = LanguageSettingsManager.getSettingEntriesByKind(refCfgDescription, project, null, ICSettingEntry.ALL); List<ICLanguageSettingEntry> entriesActual = LanguageSettingsManager.getSettingEntriesByKind(refCfgDescription, project, null, ICSettingEntry.ALL);
assertEquals(entries, entriesActual); assertEquals(entries, entriesActual);
} }
// Check that the new entries from referenced project made it to the main project // Check that the new entries from referenced project made it to the main project
{ {
List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescription, project, null, ICSettingEntry.ALL); List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescription, project, null, ICSettingEntry.ALL);
assertEquals(CDataUtil.createCIncludePathEntry(refEntry.getName(), 0), entries.get(0)); assertEquals(CDataUtil.createCIncludePathEntry(refEntry.getName(), 0), entries.get(0));
assertEquals(1, entries.size()); assertEquals(1, entries.size());
} }
} }
/** /**
* Test case when projects reference each other recursively. * Test case when projects reference each other recursively.
*/ */
public void testRecursiveReferences() throws Exception { public void testRecursiveReferences() throws Exception {
// Create model projects that reference each other // Create model projects that reference each other
String projectName = getName(); String projectName = getName();
IProject projectA = ResourceHelper.createCDTProjectWithConfig(projectName + "-A"); IProject projectA = ResourceHelper.createCDTProjectWithConfig(projectName + "-A");
IProject projectB = ResourceHelper.createCDTProjectWithConfig(projectName + "-B"); IProject projectB = ResourceHelper.createCDTProjectWithConfig(projectName + "-B");
setReference(projectA, projectB); setReference(projectA, projectB);
setReference(projectB, projectA); setReference(projectB, projectA);
{ {
// get cfgDescriptions to work with // get cfgDescriptions to work with
ICConfigurationDescription[] cfgDescriptionsA = getConfigurationDescriptions(projectA); ICConfigurationDescription[] cfgDescriptionsA = getConfigurationDescriptions(projectA);
ICConfigurationDescription cfgDescriptionA = cfgDescriptionsA[0]; ICConfigurationDescription cfgDescriptionA = cfgDescriptionsA[0];
ICConfigurationDescription[] cfgDescriptionsB = getConfigurationDescriptions(projectB); ICConfigurationDescription[] cfgDescriptionsB = getConfigurationDescriptions(projectB);
ICConfigurationDescription cfgDescriptionB = cfgDescriptionsB[0]; ICConfigurationDescription cfgDescriptionB = cfgDescriptionsB[0];
// double-check that provider for referenced projects is set in the configurations // double-check that provider for referenced projects is set in the configurations
ILanguageSettingsProvider refProjectsProvider = LanguageSettingsManager.getWorkspaceProvider(ReferencedProjectsLanguageSettingsProvider.ID); ILanguageSettingsProvider refProjectsProvider = LanguageSettingsManager.getWorkspaceProvider(ReferencedProjectsLanguageSettingsProvider.ID);
assertNotNull(refProjectsProvider); assertNotNull(refProjectsProvider);
List<ILanguageSettingsProvider> providersA = ((ILanguageSettingsProvidersKeeper) cfgDescriptionA).getLanguageSettingProviders(); List<ILanguageSettingsProvider> providersA = ((ILanguageSettingsProvidersKeeper) cfgDescriptionA).getLanguageSettingProviders();
assertTrue(providersA.contains(refProjectsProvider)); assertTrue(providersA.contains(refProjectsProvider));
List<ILanguageSettingsProvider> providersB = ((ILanguageSettingsProvidersKeeper) cfgDescriptionB).getLanguageSettingProviders(); List<ILanguageSettingsProvider> providersB = ((ILanguageSettingsProvidersKeeper) cfgDescriptionB).getLanguageSettingProviders();
assertTrue(providersB.contains(refProjectsProvider)); assertTrue(providersB.contains(refProjectsProvider));
// Check that no setting entries are set initially // Check that no setting entries are set initially
List<ICLanguageSettingEntry> entriesA = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionA, projectA, null, ICSettingEntry.ALL); List<ICLanguageSettingEntry> entriesA = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionA, projectA, null, ICSettingEntry.ALL);
assertEquals(0, entriesA.size()); assertEquals(0, entriesA.size());
List<ICLanguageSettingEntry> entriesB = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionA, projectB, null, ICSettingEntry.ALL); List<ICLanguageSettingEntry> entriesB = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionA, projectB, null, ICSettingEntry.ALL);
assertEquals(0, entriesB.size()); assertEquals(0, entriesB.size());
} }
CIncludePathEntry entryExportedA = CDataUtil.createCIncludePathEntry("referenced-exported-A", ICSettingEntry.EXPORTED); CIncludePathEntry entryExportedA = CDataUtil.createCIncludePathEntry("referenced-exported-A", ICSettingEntry.EXPORTED);
CIncludePathEntry entryNotExportedA = CDataUtil.createCIncludePathEntry("referenced-not-exported-A", 0); CIncludePathEntry entryNotExportedA = CDataUtil.createCIncludePathEntry("referenced-not-exported-A", 0);
// Add entries into a project A // Add entries into a project A
{ {
ICConfigurationDescription[] refCfgDescriptions = getConfigurationDescriptions(projectA); ICConfigurationDescription[] refCfgDescriptions = getConfigurationDescriptions(projectA);
ICConfigurationDescription refCfgDescription = refCfgDescriptions[0]; ICConfigurationDescription refCfgDescription = refCfgDescriptions[0];
List<ILanguageSettingsProvider> providersRef = ((ILanguageSettingsProvidersKeeper) refCfgDescription).getLanguageSettingProviders(); List<ILanguageSettingsProvider> providersRef = ((ILanguageSettingsProvidersKeeper) refCfgDescription).getLanguageSettingProviders();
// get user provider which is the first one // get user provider which is the first one
ILanguageSettingsProvider userProviderRef = providersRef.get(0); ILanguageSettingsProvider userProviderRef = providersRef.get(0);
assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderRef.getId()); assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderRef.getId());
assertTrue(userProviderRef instanceof LanguageSettingsGenericProvider); assertTrue(userProviderRef instanceof LanguageSettingsGenericProvider);
// add sample entries // add sample entries
ArrayList<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); ArrayList<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
entries.add(entryExportedA); entries.add(entryExportedA);
entries.add(entryNotExportedA); entries.add(entryNotExportedA);
((LanguageSettingsGenericProvider) userProviderRef).setSettingEntries(null, null, null, entries); ((LanguageSettingsGenericProvider) userProviderRef).setSettingEntries(null, null, null, entries);
} }
CIncludePathEntry entryExportedB = CDataUtil.createCIncludePathEntry("referenced-exported-B", ICSettingEntry.EXPORTED); CIncludePathEntry entryExportedB = CDataUtil.createCIncludePathEntry("referenced-exported-B", ICSettingEntry.EXPORTED);
CIncludePathEntry entryNotExportedB = CDataUtil.createCIncludePathEntry("referenced-not-exported-B", 0); CIncludePathEntry entryNotExportedB = CDataUtil.createCIncludePathEntry("referenced-not-exported-B", 0);
// Add entries into a project B // Add entries into a project B
{ {
ICConfigurationDescription[] refCfgDescriptions = getConfigurationDescriptions(projectB); ICConfigurationDescription[] refCfgDescriptions = getConfigurationDescriptions(projectB);
ICConfigurationDescription refCfgDescription = refCfgDescriptions[0]; ICConfigurationDescription refCfgDescription = refCfgDescriptions[0];
List<ILanguageSettingsProvider> providersRef = ((ILanguageSettingsProvidersKeeper) refCfgDescription).getLanguageSettingProviders(); List<ILanguageSettingsProvider> providersRef = ((ILanguageSettingsProvidersKeeper) refCfgDescription).getLanguageSettingProviders();
// get user provider which is the first one // get user provider which is the first one
ILanguageSettingsProvider userProviderRef = providersRef.get(0); ILanguageSettingsProvider userProviderRef = providersRef.get(0);
assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderRef.getId()); assertEquals(ScannerDiscoveryLegacySupport.USER_LANGUAGE_SETTINGS_PROVIDER_ID, userProviderRef.getId());
assertTrue(userProviderRef instanceof LanguageSettingsGenericProvider); assertTrue(userProviderRef instanceof LanguageSettingsGenericProvider);
// add sample entries // add sample entries
ArrayList<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>(); ArrayList<ICLanguageSettingEntry> entries = new ArrayList<ICLanguageSettingEntry>();
entries.add(entryExportedB); entries.add(entryExportedB);
entries.add(entryNotExportedB); entries.add(entryNotExportedB);
((LanguageSettingsGenericProvider) userProviderRef).setSettingEntries(null, null, null, entries); ((LanguageSettingsGenericProvider) userProviderRef).setSettingEntries(null, null, null, entries);
} }
// Check that the new entries from projectB made it to projectA // Check that the new entries from projectB made it to projectA
{ {
ICConfigurationDescription[] cfgDescriptionsA = getConfigurationDescriptions(projectA); ICConfigurationDescription[] cfgDescriptionsA = getConfigurationDescriptions(projectA);
ICConfigurationDescription cfgDescriptionA = cfgDescriptionsA[0]; ICConfigurationDescription cfgDescriptionA = cfgDescriptionsA[0];
List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionA, projectA, null, ICSettingEntry.ALL); List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionA, projectA, null, ICSettingEntry.ALL);
assertEquals(entryExportedA, entries.get(0)); assertEquals(entryExportedA, entries.get(0));
assertEquals(entryNotExportedA, entries.get(1)); assertEquals(entryNotExportedA, entries.get(1));
assertEquals(CDataUtil.createCIncludePathEntry(entryExportedB.getName(), 0), entries.get(2)); assertEquals(CDataUtil.createCIncludePathEntry(entryExportedB.getName(), 0), entries.get(2));
assertEquals(3, entries.size()); assertEquals(3, entries.size());
} }
// Check that the new entries from projectA made it to projectB // Check that the new entries from projectA made it to projectB
{ {
ICConfigurationDescription[] cfgDescriptionsB = getConfigurationDescriptions(projectB); ICConfigurationDescription[] cfgDescriptionsB = getConfigurationDescriptions(projectB);
ICConfigurationDescription cfgDescriptionB = cfgDescriptionsB[0]; ICConfigurationDescription cfgDescriptionB = cfgDescriptionsB[0];
List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionB, projectB, null, ICSettingEntry.ALL); List<ICLanguageSettingEntry> entries = LanguageSettingsManager.getSettingEntriesByKind(cfgDescriptionB, projectB, null, ICSettingEntry.ALL);
assertEquals(entryExportedB, entries.get(0)); assertEquals(entryExportedB, entries.get(0));
assertEquals(entryNotExportedB, entries.get(1)); assertEquals(entryNotExportedB, entries.get(1));
assertEquals(CDataUtil.createCIncludePathEntry(entryExportedA.getName(), 0), entries.get(2)); assertEquals(CDataUtil.createCIncludePathEntry(entryExportedA.getName(), 0), entries.get(2));
assertEquals(3, entries.size()); assertEquals(3, entries.size());
} }
// Hopefully it gets here without stack overflow // Hopefully it gets here without stack overflow
} }
} }

View file

@ -1,104 +1,104 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2011, 2012 Andrew Gvozdev and others. * Copyright (c) 2011, 2012 Andrew Gvozdev and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Andrew Gvozdev - Initial API and implementation * Andrew Gvozdev - Initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.language.settings.providers; package org.eclipse.cdt.core.language.settings.providers;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.core.runtime.Assert; import org.eclipse.core.runtime.Assert;
/** /**
* Mock Language Settings Provider that keeps count how many times it has been registered. * Mock Language Settings Provider that keeps count how many times it has been registered.
*/ */
public class MockListenerRegisterer extends LanguageSettingsSerializableProvider implements ILanguageSettingsEditableProvider, ICListenerAgent { public class MockListenerRegisterer extends LanguageSettingsSerializableProvider implements ILanguageSettingsEditableProvider, ICListenerAgent {
private static MockListenerManager mockListenerManager = new MockListenerManager(); private static MockListenerManager mockListenerManager = new MockListenerManager();
private static class MockListenerManager { private static class MockListenerManager {
private class ListenerCount { private class ListenerCount {
private MockListenerRegisterer listener; private MockListenerRegisterer listener;
private int count; private int count;
public ListenerCount(MockListenerRegisterer l, int cnt) { public ListenerCount(MockListenerRegisterer l, int cnt) {
listener = l; listener = l;
count = cnt; count = cnt;
} }
} }
private List<ListenerCount> register = new ArrayList<ListenerCount>(); private List<ListenerCount> register = new ArrayList<ListenerCount>();
public void registerListener(MockListenerRegisterer listener) { public void registerListener(MockListenerRegisterer listener) {
for (ListenerCount lc : register) { for (ListenerCount lc : register) {
if (lc.listener == listener) { if (lc.listener == listener) {
lc.count++; lc.count++;
return; return;
} }
} }
register.add(new ListenerCount(listener, 1)); register.add(new ListenerCount(listener, 1));
} }
public void unregisterListener(MockListenerRegisterer listener) { public void unregisterListener(MockListenerRegisterer listener) {
for (ListenerCount lc : register) { for (ListenerCount lc : register) {
if (lc.listener == listener) { if (lc.listener == listener) {
lc.count--; lc.count--;
Assert.isTrue(lc.count>=0); Assert.isTrue(lc.count>=0);
return; return;
} }
} }
// attempt to unregister non-registered listener // attempt to unregister non-registered listener
Assert.isTrue(false); Assert.isTrue(false);
} }
/** /**
* Note that that count includes all listeners with that id. * Note that that count includes all listeners with that id.
*/ */
public int getCount(String id) { public int getCount(String id) {
int count = 0; int count = 0;
for (ListenerCount lc : register) { for (ListenerCount lc : register) {
if (lc.listener.getId().equals(id)) { if (lc.listener.getId().equals(id)) {
count = count + lc.count; count = count + lc.count;
} }
} }
return count; return count;
} }
} }
public MockListenerRegisterer() { public MockListenerRegisterer() {
super(); super();
} }
public MockListenerRegisterer(String id, String name) { public MockListenerRegisterer(String id, String name) {
super(id, name); super(id, name);
} }
@Override @Override
public void registerListener(ICConfigurationDescription cfgDescription) { public void registerListener(ICConfigurationDescription cfgDescription) {
mockListenerManager.registerListener(this); mockListenerManager.registerListener(this);
} }
@Override @Override
public void unregisterListener() { public void unregisterListener() {
mockListenerManager.unregisterListener(this); mockListenerManager.unregisterListener(this);
} }
@Override @Override
public MockListenerRegisterer cloneShallow() throws CloneNotSupportedException { public MockListenerRegisterer cloneShallow() throws CloneNotSupportedException {
return (MockListenerRegisterer) super.cloneShallow(); return (MockListenerRegisterer) super.cloneShallow();
} }
@Override @Override
public MockListenerRegisterer clone() throws CloneNotSupportedException { public MockListenerRegisterer clone() throws CloneNotSupportedException {
return (MockListenerRegisterer) super.clone(); return (MockListenerRegisterer) super.clone();
} }
public static int getCount(String id) { public static int getCount(String id) {
return mockListenerManager.getCount(id); return mockListenerManager.getCount(id);
} }
} }

View file

@ -1,146 +1,146 @@
// include // include
#include "included.h" #include "included.h"
// macro // macro
#define PRINT(string,msg) printf(string, msg) #define PRINT(string,msg) printf(string, msg)
//namespace //namespace
namespace MyPackage namespace MyPackage
{ {
// check class // check class
// class // class
class Hello class Hello
{ {
// protected visibility // protected visibility
protected: protected:
// field // field
int x; int x;
// method // method
inline void setX(int X) inline void setX(int X)
{ {
x = X; x = X;
}; };
// check nested pachage // check nested pachage
// nested namespace // nested namespace
namespace MyNestedPackage { namespace MyNestedPackage {
// check parent nested class // check parent nested class
// nested class // nested class
class Y class Y
{ // public visibility { // public visibility
public: public:
// constructor // constructor
Y(); Y();
// virtual destructor // virtual destructor
virtual ~Y(); virtual ~Y();
}; };
// check derived nested class // check derived nested class
// derived class // derived class
class X : public Y { class X : public Y {
// private visibility // private visibility
private: private:
// private field // private field
B b; B b;
public: public:
// constructor chain // constructor chain
X(int x) : Y(x) { X(int x) : Y(x) {
cout << "In consturctor\n"; cout << "In consturctor\n";
} }
// method declaration // method declaration
int doNothing(); int doNothing();
}; };
} }
}; };
// check enums // check enums
// enum without name // enum without name
enum { enum {
first = 1, first = 1,
second, second,
third third
} }
; ;
// enum with name // enum with name
enum MyEnum { enum MyEnum {
f, f,
s, s,
t }; t };
// check variables // check variables
// variable // variable
int v; int v;
// unsigned long variable // unsigned long variable
unsigned long vuLong; unsigned long vuLong;
// unsigned short variable // unsigned short variable
unsigned short vuShort; unsigned short vuShort;
// check variable declarations // check variable declarations
// variable declaration // variable declaration
extern int evar; extern int evar;
// function pointer // function pointer
static void * (*orig_malloc_hook)(const char *file, int line, size_t size); static void * (*orig_malloc_hook)(const char *file, int line, size_t size);
// check functions // check functions
// simple function declaration // simple function declaration
void foo(); void foo();
// function declaration with parameters // function declaration with parameters
char* foo(int& x, char* foo(int& x,
char**y); char**y);
// simple function definition // simple function definition
void boo(){ void boo(){
int g = 0; int g = 0;
}; };
// check Structs // check Structs
// struct // struct
struct MyStruct{ struct MyStruct{
int sint; int sint;
}; };
// typedef and elaborated types // typedef and elaborated types
typedef struct MyStruct myStruct; typedef struct MyStruct myStruct;
// typedef // typedef
typedef struct{ typedef struct{
int ss; int ss;
} myTypedef; } myTypedef;
// unions // unions
union U{ union U{
int U1; int U1;
}; };
// check templates // check templates
// template function // template function
template<class A, typename B=C> template<class A, typename B=C>
A aTemplatedFunction( B bInstance ); A aTemplatedFunction( B bInstance );
// template method // template method
class enclosing { class enclosing {
// public visibility // public visibility
public: public:
template<class A, typename B=C> template<class A, typename B=C>
A aTemplatedMethod( B bInstance ); A aTemplatedMethod( B bInstance );
}; };
// template class // template class
template<class T, typename Tibor = junk> template<class T, typename Tibor = junk>
class myarray { /* */ }; class myarray { /* */ };
// template struct // template struct
template<class T, typename Tibor = junk> template<class T, typename Tibor = junk>
struct mystruct { /* */ }; struct mystruct { /* */ };
// template variable // template variable
// template <bool __threads, int __inst> // template <bool __threads, int __inst>
// char* default_alloc_template<__threads, __inst>::_S_start_free = 0; // char* default_alloc_template<__threads, __inst>::_S_start_free = 0;
}; };
// check arrays // check arrays
// arrays // arrays
int myArray [5][]; int myArray [5][];
int main(int argc, char * argv[]) int main(int argc, char * argv[])
{ {
} }
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=180815 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=180815
struct bug180815 { struct bug180815 {
int i,j; int i,j;
} bug180815_var0, bug180815_var1; } bug180815_var0, bug180815_var1;
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=352350 // https://bugs.eclipse.org/bugs/show_bug.cgi?id=352350
namespace { namespace {
int bug352350; int bug352350;
} }

View file

@ -1,70 +1,70 @@
/* /*
* (c) Copyright QNX Software Systems Ltd. 2002, 2003. * (c) Copyright QNX Software Systems Ltd. 2002, 2003.
* All Rights Reserved. * All Rights Reserved.
*/ */
/******** /********
* This is a sample C file that will be used in testing the TranslationUnit * This is a sample C file that will be used in testing the TranslationUnit
* class. It has a specific structure that will be looked for within the * class. It has a specific structure that will be looked for within the
* test case. * test case.
* This file is only ment to contain various C elements, and may not compile * This file is only ment to contain various C elements, and may not compile
* into a running application (but should be valid C) * into a running application (but should be valid C)
*/ */
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
/* A function prototype */ /* A function prototype */
int func2p(void); int func2p(void);
/* A global variable */ /* A global variable */
int globalvar; int globalvar;
/* A enumeration */ /* A enumeration */
enum myenum {ENUM_A=1, ENUM_B=2, ENUM_C=3, ENUM_D=4}; enum myenum {ENUM_A=1, ENUM_B=2, ENUM_C=3, ENUM_D=4};
/* A structure. This also includes a typedef around the strcture def /* A structure. This also includes a typedef around the strcture def
* which at the time of writing was not picked up. * which at the time of writing was not picked up.
*/ */
typedef struct mystruct { typedef struct mystruct {
int a; int a;
char b; char b;
long c; long c;
} mystruct_t; } mystruct_t;
/* A union */ /* A union */
union myunion { union myunion {
int x; int x;
char y; char y;
long z; long z;
}; };
/* A typedef */ /* A typedef */
typedef struct mystruct mytype; typedef struct mystruct mytype;
/* A couple functions */ /* A couple functions */
void * func1(void) void * func1(void)
{ {
return(NULL); return(NULL);
} }
int func2(void) int func2(void)
{ {
return(0); return(0);
} }
int main(int argc, char ** argv) int main(int argc, char ** argv)
{ {
int var1; int var1;
printf("Hello world\n"); printf("Hello world\n");
} }
void func3() void func3()
{ {
printf("This is not really here\n"); printf("This is not really here\n");
} }

View file

@ -1,10 +1,10 @@
#define size_t int #define size_t int
class A; class A;
class B; class B;
class C; class C;
class T; class T;
class junk; class junk;

View file

@ -1,24 +1,24 @@
void decl_0001(char); void decl_0001(char);
void (decl_0002)(char); void (decl_0002)(char);
void ((decl_0003))(char); void ((decl_0003))(char);
void *decl_0004(char); void *decl_0004(char);
void (*decl_0005)(char); void (*decl_0005)(char);
void (*(decl_0006))(char); void (*(decl_0006))(char);
void ((*decl_0007))(char); void ((*decl_0007))(char);
typedef void decl_0011(char); typedef void decl_0011(char);
typedef void (decl_0012)(char); typedef void (decl_0012)(char);
typedef void ((decl_0013))(char); typedef void ((decl_0013))(char);
typedef void *decl_0014(char); typedef void *decl_0014(char);
typedef void (*decl_0015)(char); typedef void (*decl_0015)(char);
typedef void (*(decl_0016))(char); typedef void (*(decl_0016))(char);
typedef void ((*decl_0017))(char); typedef void ((*decl_0017))(char);
typedef void decl_0021(char); typedef void decl_0021(char);
void (*decl_0022)(char); void (*decl_0022)(char);
void (*(*decl_0023(int a)))(char) { return &decl_0021; } void (*(*decl_0023(int a)))(char) { return &decl_0021; }
void (*(*(*((decl_0024)))(int))(float))(char); void (*(*(*((decl_0024)))(int))(float))(char);
int (*decl_0031)(char(*yyy)(bool)); int (*decl_0031)(char(*yyy)(bool));

View file

@ -1,42 +1,42 @@
// include // include
#include <stdio.h> #include <stdio.h>
#include "whatever.h" #include "whatever.h"
#include <src/slash.h> #include <src/slash.h>
#include <src\backslash.h> #include <src\backslash.h>
#include "Program Files/space.h" #include "Program Files/space.h"
#include "../up1dir.h" #include "../up1dir.h"
#include "./samedir.h" #include "./samedir.h"
#include "different_extension1.hpp" #include "different_extension1.hpp"
#include "different_extension2.hh" #include "different_extension2.hh"
#include "different_extension3.x" #include "different_extension3.x"
#include <no_extension> #include <no_extension>
# include "whitespace_after_hash" # include "whitespace_after_hash"
#include "whitespace_before_hash" #include "whitespace_before_hash"
// failure cases: // failure cases:
#include garbage #include garbage
#include "resync_after_bad_parse_1" #include "resync_after_bad_parse_1"
#include #include
#include "resync_after_bad_parse_2" #include "resync_after_bad_parse_2"
#include "one" "two" "three" #include "one" "two" "three"
#include "resync_after_bad_parse_3" #include "resync_after_bad_parse_3"
// from the Spec: // from the Spec:
// from [C, 6.10.p8] // from [C, 6.10.p8]
// should fail // should fail
#define EMPTY #define EMPTY
EMPTY #include "invalid.h" EMPTY #include "invalid.h"
// from [C, 6.10.2.p8]: // from [C, 6.10.2.p8]:
// should equal #include "myInclude1.h" // should equal #include "myInclude1.h"
#define MYINCFILE "myInclude1.h" #define MYINCFILE "myInclude1.h"
#include MYINCFILE #include MYINCFILE
// from [C, 6.10.3.5.p6]: // from [C, 6.10.3.5.p6]:
// should equal #include "vers2.h" // should equal #include "vers2.h"
#define INCFILE(x) vers ## x #define INCFILE(x) vers ## x
#define xstr(x) str(x) #define xstr(x) str(x)
#define str(x) #x #define str(x) #x
#include xstr(INCFILE(2).h) #include xstr(INCFILE(2).h)

View file

@ -1,4 +1,4 @@
// macro // macro
#define SINGLETON #define SINGLETON
#define NUMBER 1 #define NUMBER 1
#define PRINT(string,msg) printf(string, msg) #define PRINT(string,msg) printf(string, msg)

View file

@ -1,72 +1,72 @@
class Key; class Key;
class Value; class Value;
class SortAlgorithm; class SortAlgorithm;
class DefaultSort; class DefaultSort;
class T; class T;
class X; class X;
class Y; class Y;
class Bar; class Bar;
class Foo { class Foo {
template<class Bar> void fum(int i); template<class Bar> void fum(int i);
}; };
// TEMPLATE_STRUCT // TEMPLATE_STRUCT
template<class Key, class Value, class SortAlgorithm=DefaultSort> template<class Key, class Value, class SortAlgorithm=DefaultSort>
struct Map struct Map
{ {
Key* keys; Key* keys;
Value* values; Value* values;
SortAlgorithm* sortAlgorithm; SortAlgorithm* sortAlgorithm;
Map(); Map();
}; };
// TEMPLATE_CLASS // TEMPLATE_CLASS
template<class T> class nonVector { template<class T> class nonVector {
private: private:
T* head; T* head;
public: public:
nonVector() { head =new T(); } nonVector() { head =new T(); }
int length() { return 1; } int length() { return 1; }
const T& first(); const T& first();
}; };
// TEMPLATE_UNION // TEMPLATE_UNION
template<class X, class Y, int size=16> template<class X, class Y, int size=16>
union ArrayOverlay { union ArrayOverlay {
public: public:
X x[size]; X x[size];
Y y[size]; Y y[size];
static int<X,Y> numArrays; static int<X,Y> numArrays;
}; };
// TEMPLATE_METHODS // TEMPLATE_METHODS
class TemplateContainer { class TemplateContainer {
// these are in an enclosing class // these are in an enclosing class
template<class Bar> void fum(int i); template<class Bar> void fum(int i);
template<int> void scrum(void) {}; template<int> void scrum(void) {};
}; };
// TEMPLATE_FUNCTION // TEMPLATE_FUNCTION
template<class T> const T& nonVector<T>::first() const template<class T> const T& nonVector<T>::first() const
{ {
return *head; return *head;
} }
template<class X> bool IsGreaterThan(X,X); template<class X> bool IsGreaterThan(X,X);
template<class Bar> void Foo::fum(int i) {} template<class Bar> void Foo::fum(int i) {}
// TEMPLATE_VARIABLES // TEMPLATE_VARIABLES
template <bool threads, int inst> char* default_alloc_template<threads, inst>::S_start_free = 0; template <bool threads, int inst> char* default_alloc_template<threads, inst>::S_start_free = 0;
// an instantiation, not a template: // an instantiation, not a template:
complex<float> cf(0,0); complex<float> cf(0,0);
//template<class Language, class CharacterSet, class SortAlgorithm<CharacterSet> > //template<class Language, class CharacterSet, class SortAlgorithm<CharacterSet> >
//Dictionary* TheSpellCheckDictionary; //Dictionary* TheSpellCheckDictionary;
int success; int success;

View file

@ -1,8 +1,8 @@
#include "DepTest.h" #include "DepTest.h"
#include "d.h" #include "d.h"
DepTest::DepTest() DepTest::DepTest()
{}; {};
DepTest::~DepTest() DepTest::~DepTest()
{}; {};

View file

@ -1,8 +1,8 @@
#include "Inc1.h" #include "Inc1.h"
#include "a.h" #include "a.h"
class DepTest{ class DepTest{
public: public:
DepTest(); DepTest();
~DepTest(); ~DepTest();
}; };

View file

@ -1,8 +1,8 @@
#include "DepTest2.h" #include "DepTest2.h"
#include "d.h" #include "d.h"
DepTest2::DepTest2() DepTest2::DepTest2()
{}; {};
DepTest2::~DepTest2() DepTest2::~DepTest2()
{}; {};

View file

@ -1,8 +1,8 @@
#include "d.h" #include "d.h"
class DepTest2{ class DepTest2{
public: public:
DepTest2(); DepTest2();
~DepTest2(); ~DepTest2();
}; };

View file

@ -1,7 +1,7 @@
#include "DepTest3.h" #include "DepTest3.h"
DepTest3::DepTest3() DepTest3::DepTest3()
{}; {};
DepTest3::~DepTest3() DepTest3::~DepTest3()
{}; {};

View file

@ -1,8 +1,8 @@
#include "a.h" #include "a.h"
class DepTest3{ class DepTest3{
public: public:
DepTest3(); DepTest3();
~DepTest3(); ~DepTest3();
}; };

View file

@ -1,8 +1,8 @@
#include "c.h" #include "c.h"
class X class X
{ {
public: public:
X(){}; X(){};
~X(){}; ~X(){};
}; };

View file

@ -1,8 +1,8 @@
#include "c.h" #include "c.h"
class Z class Z
{ {
public: public:
Z(){}; Z(){};
~Z(){}; ~Z(){};
}; };

View file

@ -1,6 +1,6 @@
class Y class Y
{ {
public: public:
Y(){}; Y(){};
~Y(){}; ~Y(){};
}; };

View file

@ -1,6 +1,6 @@
class d class d
{ {
public: public:
d(){}; d(){};
~d(){}; ~d(){};
}; };

View file

@ -1,25 +1,25 @@
//#include "StdAfx.h" //#include "StdAfx.h"
#include "DocumentManager.h" #include "DocumentManager.h"
CDocumentManager::CDocumentManager(void) CDocumentManager::CDocumentManager(void)
{ {
} }
CDocumentManager::~CDocumentManager(void) CDocumentManager::~CDocumentManager(void)
{ {
} }
void CDocumentManager::addToControlMap(UINT threadID, IUnknown * theControl) void CDocumentManager::addToControlMap(UINT threadID, IUnknown * theControl)
{ {
_controlMap.insert(MUL2IUnk_Pair(threadID,theControl)); _controlMap.insert(MUL2IUnk_Pair(threadID,theControl));
} }
void CDocumentManager::getControl(ULONG threadID, IUnknown ** theControl) void CDocumentManager::getControl(ULONG threadID, IUnknown ** theControl)
{ {
if (_controlMap.find(threadID) != _controlMap.end()) if (_controlMap.find(threadID) != _controlMap.end())
{ {
theControl = &_controlMap[threadID]; theControl = &_controlMap[threadID];
} }
} }

View file

@ -1,112 +1,112 @@
#include <iostream.h> #include <iostream.h>
#include <stdlib.h> #include <stdlib.h>
#include <alloc.h> #include <alloc.h>
#include <iomanip.h> #include <iomanip.h>
#define PRINT(a,b) cout<<(a)<<(b) #define PRINT(a,b) cout<<(a)<<(b)
#define CASE break;case #define CASE break;case
#define MAX(a,b) (((a)>(b))?(a):(b)) #define MAX(a,b) (((a)>(b))?(a):(b))
typedef int int32; typedef int int32;
static void doSomething(); static void doSomething();
namespace Z{ namespace Z{
int x; int x;
namespace X{ namespace X{
namespace Y{ namespace Y{
enum test{cool,hi,bye,why}; enum test{cool,hi,bye,why};
class Mail class Mail
{ {
public: public:
Mail(){} Mail(){}
virtual void print()=0; //Pure Virtual Function, forces redefinition virtual void print()=0; //Pure Virtual Function, forces redefinition
protected: protected:
float postage; float postage;
char *type; char *type;
friend ostream& operator << (ostream& os, Mail *m); friend ostream& operator << (ostream& os, Mail *m);
}; };
class postcard : public Mail class postcard : public Mail
{ {
public: public:
postcard(): Mail(){postage = 0.20; type = "Postcard";} postcard(): Mail(){postage = 0.20; type = "Postcard";}
void print(){cout << type << ": $" << setiosflags(ios::fixed) void print(){cout << type << ": $" << setiosflags(ios::fixed)
<<setprecision(2) << postage <<endl;} <<setprecision(2) << postage <<endl;}
}; };
class first_class : public Mail class first_class : public Mail
{ {
public: public:
first_class() : Mail(){postage = 0.32; type = "First Class";} first_class() : Mail(){postage = 0.32; type = "First Class";}
void print(){cout << type << ": $" <<setiosflags(ios::fixed) void print(){cout << type << ": $" <<setiosflags(ios::fixed)
<< setprecision(2) << postage <<endl;} << setprecision(2) << postage <<endl;}
}; };
class Unknown : public postcard, first_class // ??? Multiple Inheritance class Unknown : public postcard, first_class // ??? Multiple Inheritance
{ {
public: public:
Unknown(): postcard(), first_class() Unknown(): postcard(), first_class()
{ {
postcard::postage = 1.50; // MUST disambiguate postcard::postage = 1.50; // MUST disambiguate
postcard::type = "Unknown"; postcard::type = "Unknown";
} }
void print(){cout << postcard::type << ": $" <<setiosflags(ios::fixed) void print(){cout << postcard::type << ": $" <<setiosflags(ios::fixed)
<<setprecision(2)<<postcard::postage <<endl;} <<setprecision(2)<<postcard::postage <<endl;}
}; };
class container class container
{ {
private: private:
Mail **array; Mail **array;
int index; int index;
int sz; int sz;
public: public:
container(){array = 0;} container(){array = 0;}
~container(){ ~container(){
for(int x = 0; x <sz; x++) for(int x = 0; x <sz; x++)
delete array[x]; delete array[x];
free(array); free(array);
} }
int size() {return sz;} int size() {return sz;}
Mail* operator[](int index); Mail* operator[](int index);
Mail* operator = (Mail* mail); Mail* operator = (Mail* mail);
}; };
main() main()
{ {
container PO_Box; container PO_Box;
PO_Box = new postcard; PO_Box = new postcard;
PO_Box = new first_class; PO_Box = new first_class;
PO_Box = new parcel_Post; PO_Box = new parcel_Post;
//PO_Box = new Unknown; //PO_Box = new Unknown;
//one way of printing information //one way of printing information
for(int x =0; x <3; x++){ for(int x =0; x <3; x++){
PO_Box[x]->print(); PO_Box[x]->print();
} }
//Overloaded << //Overloaded <<
for(int x =0; x <PO_Box.size(); x++){ for(int x =0; x <PO_Box.size(); x++){
cout << PO_Box[x]; cout << PO_Box[x];
} }
} }
ostream& operator << (ostream &os, Mail *m) ostream& operator << (ostream &os, Mail *m)
{ {
os <<setiosflags(ios::fixed) << setprecision(2)<< m->type os <<setiosflags(ios::fixed) << setprecision(2)<< m->type
<< ": $" << m->postage <<endl; << ": $" << m->postage <<endl;
return os; return os;
} }
Mail* container::operator[](int index) {return array[index];} Mail* container::operator[](int index) {return array[index];}
Mail* container::operator = (Mail* mail) Mail* container::operator = (Mail* mail)
{ {
int size = sizeof(Mail*) * (++sz); int size = sizeof(Mail*) * (++sz);
int temp = sz -1; int temp = sz -1;
array = (Mail**)realloc(array, size); array = (Mail**)realloc(array, size);
array[temp] = mail; array[temp] = mail;
return 0; return 0;
} }
} }
} }
} }

View file

@ -1,22 +1,22 @@
namespace A namespace A
{ {
class ForwardA; class ForwardA;
ForwardA * tmp; ForwardA * tmp;
int something(void); int something(void);
namespace B namespace B
{ {
enum e1{dude1,dude2}; enum e1{dude1,dude2};
int x; int x;
class C class C
{ static int y = 5; { static int y = 5;
static int bar(void); static int bar(void);
}; };
} }
} }
using namespace A::B; using namespace A::B;
using A::B::x; using A::B::x;
using A::B::C; using A::B::C;
using A::B::C::y; using A::B::C::y;
using A::B::C::bar; using A::B::C::bar;
using A::something; using A::something;
using A::B::e1; using A::B::e1;

View file

@ -1,43 +1,43 @@
#include <Simple.h> #include <Simple.h>
const SimpleStruct simpleStruct = const SimpleStruct simpleStruct =
{ {
1 1
, "mySimple" , "mySimple"
, 0.1232 , 0.1232
}; };
#define SIZEOF( A, B ) sizeof( A.B ) #define SIZEOF( A, B ) sizeof( A.B )
const OtherStruct array[] = const OtherStruct array[] =
{ {
{ {
#if FOO #if FOO
"foo" "foo"
#else #else
"bar" "bar"
#endif #endif
, SIZEOF( simpleStruct, num ) , SIZEOF( simpleStruct, num )
, &t_int , &t_int
, 0 , 0
} }
, { , {
"name" "name"
, SIZEOF( simpleStruct, floatnum ) , SIZEOF( simpleStruct, floatnum )
, &t_float , &t_float
, 1 , 1
} }
}; };
void SimpleStruct_construct( struct SimpleStruct * const this ) void SimpleStruct_construct( struct SimpleStruct * const this )
{ {
this->num = 1; this->num = 1;
this->name = "boo"; this->name = "boo";
this->floatNum = 1.5; this->floatNum = 1.5;
} }
int ConnectParams_doSomething( const struct SimpleStruct * const this ) int ConnectParams_doSomething( const struct SimpleStruct * const this )
{ {
return 1; return 1;
} }

View file

@ -1,17 +1,17 @@
#ifndef SIMPLE_H #ifndef SIMPLE_H
#define SIMPLE_H #define SIMPLE_H
struct SimpleStruct struct SimpleStruct
{ {
int num; int num;
char name[ ]; char name[ ];
float floatNum; float floatNum;
}; };
void SimpleStruct_construct( struct SimpleStruct * const this ); void SimpleStruct_construct( struct SimpleStruct * const this );
int SimpleStruct_doSomething( const struct SimpleStruct * const this ); int SimpleStruct_doSomething( const struct SimpleStruct * const this );
#endif /* SIMPLE_H */ #endif /* SIMPLE_H */

View file

@ -1,37 +1,37 @@
#include <Simple.h> #include <Simple.h>
#include <iostream> #include <iostream>
#define NULL (void *)0 #define NULL (void *)0
SimpleClass::SimpleClass( void ) SimpleClass::SimpleClass( void )
{ {
init( NULL ); init( NULL );
} }
SimpleClass::~SimpleClass( void ) SimpleClass::~SimpleClass( void )
{ {
} }
SimpleClass::SimpleClass( const SimpleClass & arg ) SimpleClass::SimpleClass( const SimpleClass & arg )
{ {
//TODO: copy constructor //TODO: copy constructor
} }
SimpleClass & SimpleClass::operator=( const SimpleClass & arg ) SimpleClass & SimpleClass::operator=( const SimpleClass & arg )
{ {
if( this != &arg ) if( this != &arg )
{ {
} }
return *this; return *this;
} }
void SimpleClass::init( void * foo) void SimpleClass::init( void * foo)
{ {
} }
InnerStruct & SimpleClass::getInner( void ) InnerStruct & SimpleClass::getInner( void )
{ {
return inner; return inner;
} }

View file

@ -1,32 +1,32 @@
#ifndef SIMPLE_H #ifndef SIMPLE_H
#define SIMPLE_H #define SIMPLE_H
class OtherClass; class OtherClass;
class SimpleClass class SimpleClass
{ {
public: public:
SimpleClass( void ); SimpleClass( void );
SimpleClass( const SimpleClass & arg ); SimpleClass( const SimpleClass & arg );
virtual ~SimpleClass( void ); virtual ~SimpleClass( void );
SimpleClass & operator=( const SimpleClass & arg ); SimpleClass & operator=( const SimpleClass & arg );
private: private:
struct InnerStruct struct InnerStruct
{ {
inline InnerStruct( int a ){ _a = a; } inline InnerStruct( int a ){ _a = a; }
inline ~InnerStruct( void ){} inline ~InnerStruct( void ){}
unsigned int _a; unsigned int _a;
}; };
InnerStruct inner; InnerStruct inner;
void init( void * ); void init( void * );
public: public:
InnerStruct & getInner( void ); InnerStruct & getInner( void );
}; };
#endif /* SIMPLE_H */ #endif /* SIMPLE_H */

View file

@ -1,43 +1,43 @@
// inclusion begins and ends on line 2 // inclusion begins and ends on line 2
#include <stdio.h> #include <stdio.h>
// simple macro begins and ends on line 5; ANOTHER on line 6 // simple macro begins and ends on line 5; ANOTHER on line 6
#define SIMPLE_MACRO simple #define SIMPLE_MACRO simple
#define ANOTHER #define ANOTHER
// namespace begins on line 7, ends on line 22 // namespace begins on line 7, ends on line 22
namespace MyPackage{ namespace MyPackage{
// class specification begins on line 10, ends on line 21 // class specification begins on line 10, ends on line 21
class Hello{ class Hello{
protected: protected:
// simple declaration begins and ends on line 13 // simple declaration begins and ends on line 13
int x; int x;
// simple declaration begins and ends on line 15 // simple declaration begins and ends on line 15
void setX(int X); void setX(int X);
public: public:
// simple declaration begins on line 18 and ends on line 20 // simple declaration begins on line 18 and ends on line 20
Hello( void ) : x Hello( void ) : x
( 5 ) { ( 5 ) {
} }
}; };
} }
// simple declaration begins on line 25 and ends on line 27 // simple declaration begins on line 25 and ends on line 27
int * int *
y = y =
0; 0;
// complex macro begins on line 30 and ends on line 31 // complex macro begins on line 30 and ends on line 31
#define COMPLEX_MACRO 33 \ #define COMPLEX_MACRO 33 \
+ 44 + 44
// template declaration begins on line 34 and ends on line 35 // template declaration begins on line 34 and ends on line 35
template <class A > template <class A >
A createA( void ); A createA( void );
// enumeration begins on line 38 and ends on line 43 // enumeration begins on line 38 and ends on line 43
enum { enum {
one, // enumerator begins and ends on line 39 one, // enumerator begins and ends on line 39
two, // enumerator begins and ends on line 40 two, // enumerator begins and ends on line 40
three // enumerator begins on line 41, ends on line 42 three // enumerator begins on line 41, ends on line 42
= 4 = 4
}; };

View file

@ -1,102 +1,102 @@
#include "include.h" #include "include.h"
#define FOO bar #define FOO bar
class Heal{}; class Heal{};
class A { class A {
A() {} A() {}
~A(){} ~A(){}
class B { class B {
void f( A ); void f( A );
void f( A & ); void f( A & );
void f( A* ); void f( A* );
void f( int &, const char [], A ** ); void f( int &, const char [], A ** );
}; };
}; };
namespace NS { namespace NS {
namespace NS2{ namespace NS2{
struct a{}; struct a{};
} }
class B: public A { class B: public A {
public: public:
struct AA {}; struct AA {};
enum e { enum e {
One, One,
Two, Two,
Three Three
}; };
void f(){ void f(){
using namespace NS2; using namespace NS2;
a aStruct; a aStruct;
} }
AA anotherStruct; AA anotherStruct;
}; };
union u{ } ; union u{ } ;
} }
namespace NS3{ namespace NS3{
class C : public NS::B { class C : public NS::B {
e eE = One; e eE = One;
}; };
} }
A::B b1; A::B b1;
typedef NS::B NS_B; typedef NS::B NS_B;
NS_B b2; NS_B b2;
union u{ union u{
}; };
class AClassForFoo {}; class AClassForFoo {};
AClassForFoo foo( AClassForFoo ){ AClassForFoo foo( AClassForFoo ){
AClassForFoo b; AClassForFoo b;
return b; return b;
} }
Head * Head::operator *= ( int index ){ Head * Head::operator *= ( int index ){
return array[ index ]; return array[ index ];
} }
Head * Head::operator += ( int index ){ Head * Head::operator += ( int index ){
return array[ index ]; return array[ index ];
} }
extern int externalInt; extern int externalInt;
extern int externalIntWithInitializer = 2; extern int externalIntWithInitializer = 2;
extern "C" int externCInt; extern "C" int externCInt;
extern "C" int externCIntWithInitializer = 3; extern "C" int externCIntWithInitializer = 3;
void forwardFunction() { } void forwardFunction() { }
void normalFunction() { } void normalFunction() { }
void DeclsAndDefns::forwardMethod(){ } void DeclsAndDefns::forwardMethod(){ }
int DeclsAndDefns::staticField = 5; int DeclsAndDefns::staticField = 5;
namespace bug68235{ namespace bug68235{
struct xTag { struct xTag {
int x; int x;
}; };
typedef xTag xType; typedef xTag xType;
typedef struct yTag { typedef struct yTag {
int x; int x;
} yType; } yType;
class C1{ class C1{
public: public:
xType x; xType x;
yType y; yType y;
C1(); C1();
~C1(); ~C1();
}; };
} }

View file

@ -1,36 +1,36 @@
#ifndef INCLUDE_H #ifndef INCLUDE_H
#define INCLUDE_H #define INCLUDE_H
class Head { class Head {
Head ** array; Head ** array;
Head * operator *= ( int index ); Head * operator *= ( int index );
Head * operator * ( int index ){ return array[ index ]; } Head * operator * ( int index ){ return array[ index ]; }
Head * operator += ( int index ); Head * operator += ( int index );
operator const short & (); operator const short & ();
operator short (); operator short ();
operator short int (); operator short int ();
}; };
class DeclsAndDefns{ class DeclsAndDefns{
static int staticField; static int staticField;
int nonStaticField; int nonStaticField;
void forwardMethod(); void forwardMethod();
void inlineMethod() {} void inlineMethod() {}
}; };
void forwardFunction(); void forwardFunction();
class Direction{ class Direction{
void turn(); void turn();
void turn(int); void turn(int);
void turnAgain(void); void turnAgain(void);
}; };
class Right : public Direction { class Right : public Direction {
void turn() { } void turn() { }
}; };
#endif #endif

View file

@ -1,496 +1,496 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2010, 2012 Andrew Gvozdev and others. * Copyright (c) 2010, 2012 Andrew Gvozdev and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* Andrew Gvozdev - Initial API and implementation * Andrew Gvozdev - Initial API and implementation
*******************************************************************************/ *******************************************************************************/
package org.eclipse.cdt.core.testplugin; package org.eclipse.cdt.core.testplugin;
import java.util.Map; import java.util.Map;
import org.eclipse.cdt.core.cdtvariables.ICdtVariablesContributor; import org.eclipse.cdt.core.cdtvariables.ICdtVariablesContributor;
import org.eclipse.cdt.core.settings.model.CConfigurationStatus; import org.eclipse.cdt.core.settings.model.CConfigurationStatus;
import org.eclipse.cdt.core.settings.model.ICBuildSetting; import org.eclipse.cdt.core.settings.model.ICBuildSetting;
import org.eclipse.cdt.core.settings.model.ICConfigExtensionReference; import org.eclipse.cdt.core.settings.model.ICConfigExtensionReference;
import org.eclipse.cdt.core.settings.model.ICConfigurationDescription; import org.eclipse.cdt.core.settings.model.ICConfigurationDescription;
import org.eclipse.cdt.core.settings.model.ICExternalSetting; import org.eclipse.cdt.core.settings.model.ICExternalSetting;
import org.eclipse.cdt.core.settings.model.ICFileDescription; import org.eclipse.cdt.core.settings.model.ICFileDescription;
import org.eclipse.cdt.core.settings.model.ICFolderDescription; import org.eclipse.cdt.core.settings.model.ICFolderDescription;
import org.eclipse.cdt.core.settings.model.ICLanguageSetting; import org.eclipse.cdt.core.settings.model.ICLanguageSetting;
import org.eclipse.cdt.core.settings.model.ICProjectDescription; import org.eclipse.cdt.core.settings.model.ICProjectDescription;
import org.eclipse.cdt.core.settings.model.ICResourceDescription; import org.eclipse.cdt.core.settings.model.ICResourceDescription;
import org.eclipse.cdt.core.settings.model.ICSettingContainer; import org.eclipse.cdt.core.settings.model.ICSettingContainer;
import org.eclipse.cdt.core.settings.model.ICSettingEntry; import org.eclipse.cdt.core.settings.model.ICSettingEntry;
import org.eclipse.cdt.core.settings.model.ICSettingObject; import org.eclipse.cdt.core.settings.model.ICSettingObject;
import org.eclipse.cdt.core.settings.model.ICSourceEntry; import org.eclipse.cdt.core.settings.model.ICSourceEntry;
import org.eclipse.cdt.core.settings.model.ICStorageElement; import org.eclipse.cdt.core.settings.model.ICStorageElement;
import org.eclipse.cdt.core.settings.model.ICTargetPlatformSetting; import org.eclipse.cdt.core.settings.model.ICTargetPlatformSetting;
import org.eclipse.cdt.core.settings.model.WriteAccessException; import org.eclipse.cdt.core.settings.model.WriteAccessException;
import org.eclipse.cdt.core.settings.model.extension.CConfigurationData; import org.eclipse.cdt.core.settings.model.extension.CConfigurationData;
import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.QualifiedName; import org.eclipse.core.runtime.QualifiedName;
/** /**
* Collection of mock classes for testing * Collection of mock classes for testing
*/ */
public class CModelMock { public class CModelMock {
/** /**
* Dummy implementation of ICProjectDescription for testing. * Dummy implementation of ICProjectDescription for testing.
* Feel free to override the methods you are interested to mock. * Feel free to override the methods you are interested to mock.
*/ */
public static class DummyCProjectDescription implements ICProjectDescription { public static class DummyCProjectDescription implements ICProjectDescription {
@Override @Override
public ICSettingObject[] getChildSettings() { public ICSettingObject[] getChildSettings() {
return null; return null;
} }
@Override @Override
public String getId() { public String getId() {
return null; return null;
} }
@Override @Override
public String getName() { public String getName() {
return null; return null;
} }
@Override @Override
public int getType() { public int getType() {
return 0; return 0;
} }
@Override @Override
public boolean isValid() { public boolean isValid() {
return false; return false;
} }
@Override @Override
public ICConfigurationDescription getConfiguration() { public ICConfigurationDescription getConfiguration() {
return null; return null;
} }
@Override @Override
public ICSettingContainer getParent() { public ICSettingContainer getParent() {
return null; return null;
} }
@Override @Override
public boolean isReadOnly() { public boolean isReadOnly() {
return false; return false;
} }
@Override @Override
public ICStorageElement getStorage(String id, boolean create) public ICStorageElement getStorage(String id, boolean create)
throws CoreException { throws CoreException {
return null; return null;
} }
@Override @Override
public void removeStorage(String id) throws CoreException { public void removeStorage(String id) throws CoreException {
} }
@Override @Override
public ICStorageElement importStorage(String id, ICStorageElement el) public ICStorageElement importStorage(String id, ICStorageElement el)
throws UnsupportedOperationException, CoreException { throws UnsupportedOperationException, CoreException {
return null; return null;
} }
@Override @Override
public void setReadOnly(boolean readOnly, boolean keepModify) { public void setReadOnly(boolean readOnly, boolean keepModify) {
} }
@Override @Override
public int getConfigurationRelations() { public int getConfigurationRelations() {
return 0; return 0;
} }
@Override @Override
public void setConfigurationRelations(int status) { public void setConfigurationRelations(int status) {
} }
@Override @Override
public void useDefaultConfigurationRelations() { public void useDefaultConfigurationRelations() {
} }
@Override @Override
public boolean isDefaultConfigurationRelations() { public boolean isDefaultConfigurationRelations() {
return false; return false;
} }
@Override @Override
public ICConfigurationDescription[] getConfigurations() { public ICConfigurationDescription[] getConfigurations() {
return null; return null;
} }
@Override @Override
public ICConfigurationDescription getActiveConfiguration() { public ICConfigurationDescription getActiveConfiguration() {
return null; return null;
} }
@Override @Override
public void setActiveConfiguration(ICConfigurationDescription cfg) public void setActiveConfiguration(ICConfigurationDescription cfg)
throws WriteAccessException { throws WriteAccessException {
} }
@Override @Override
public ICConfigurationDescription createConfiguration(String id, public ICConfigurationDescription createConfiguration(String id,
String name, ICConfigurationDescription base) String name, ICConfigurationDescription base)
throws CoreException, WriteAccessException { throws CoreException, WriteAccessException {
return null; return null;
} }
@Override @Override
public ICConfigurationDescription createConfiguration( public ICConfigurationDescription createConfiguration(
String buildSystemId, CConfigurationData data) String buildSystemId, CConfigurationData data)
throws CoreException, WriteAccessException { throws CoreException, WriteAccessException {
return null; return null;
} }
@Override @Override
public ICConfigurationDescription getConfigurationByName(String name) { public ICConfigurationDescription getConfigurationByName(String name) {
return null; return null;
} }
@Override @Override
public ICConfigurationDescription getConfigurationById(String id) { public ICConfigurationDescription getConfigurationById(String id) {
return null; return null;
} }
@Override @Override
public void removeConfiguration(String name) public void removeConfiguration(String name)
throws WriteAccessException { throws WriteAccessException {
} }
@Override @Override
public void removeConfiguration(ICConfigurationDescription cfg) public void removeConfiguration(ICConfigurationDescription cfg)
throws WriteAccessException { throws WriteAccessException {
} }
@Override @Override
public IProject getProject() { public IProject getProject() {
return null; return null;
} }
@Override @Override
public boolean isModified() { public boolean isModified() {
return false; return false;
} }
@Override @Override
public Object getSessionProperty(QualifiedName name) { public Object getSessionProperty(QualifiedName name) {
return null; return null;
} }
@Override @Override
public void setSessionProperty(QualifiedName name, Object value) { public void setSessionProperty(QualifiedName name, Object value) {
} }
@Override @Override
public ICConfigurationDescription getDefaultSettingConfiguration() { public ICConfigurationDescription getDefaultSettingConfiguration() {
return null; return null;
} }
@Override @Override
public void setDefaultSettingConfiguration( public void setDefaultSettingConfiguration(
ICConfigurationDescription cfg) { ICConfigurationDescription cfg) {
} }
@Override @Override
public boolean isCdtProjectCreating() { public boolean isCdtProjectCreating() {
return false; return false;
} }
@Override @Override
public void setCdtProjectCreated() { public void setCdtProjectCreated() {
} }
} }
/** /**
* Dummy implementation of ICConfigurationDescription for testing. * Dummy implementation of ICConfigurationDescription for testing.
* Feel free to override the methods you are interested to mock. * Feel free to override the methods you are interested to mock.
*/ */
public static class DummyCConfigurationDescription implements ICConfigurationDescription { public static class DummyCConfigurationDescription implements ICConfigurationDescription {
private String id; private String id;
private ICProjectDescription projectDescription; private ICProjectDescription projectDescription;
public DummyCConfigurationDescription(String id) { public DummyCConfigurationDescription(String id) {
this.id = id; this.id = id;
this.projectDescription = new DummyCProjectDescription(); this.projectDescription = new DummyCProjectDescription();
} }
@Override @Override
public ICSettingObject[] getChildSettings() { public ICSettingObject[] getChildSettings() {
return null; return null;
} }
@Override @Override
public String getId() { public String getId() {
return id; return id;
} }
@Override @Override
public String getName() { public String getName() {
return null; return null;
} }
@Override @Override
public int getType() { public int getType() {
return 0; return 0;
} }
@Override @Override
public boolean isValid() { public boolean isValid() {
return false; return false;
} }
@Override @Override
public ICConfigurationDescription getConfiguration() { public ICConfigurationDescription getConfiguration() {
return null; return null;
} }
@Override @Override
public ICSettingContainer getParent() { public ICSettingContainer getParent() {
return null; return null;
} }
@Override @Override
public boolean isReadOnly() { public boolean isReadOnly() {
return false; return false;
} }
@Override @Override
public ICStorageElement getStorage(String id, boolean create) public ICStorageElement getStorage(String id, boolean create)
throws CoreException { throws CoreException {
return null; return null;
} }
@Override @Override
public void removeStorage(String id) throws CoreException { public void removeStorage(String id) throws CoreException {
} }
@Override @Override
public ICStorageElement importStorage(String id, ICStorageElement el) public ICStorageElement importStorage(String id, ICStorageElement el)
throws UnsupportedOperationException, CoreException { throws UnsupportedOperationException, CoreException {
return null; return null;
} }
@Override @Override
public void setReadOnly(boolean readOnly, boolean keepModify) { public void setReadOnly(boolean readOnly, boolean keepModify) {
} }
@Override @Override
public boolean isActive() { public boolean isActive() {
return false; return false;
} }
@Override @Override
public String getDescription() { public String getDescription() {
return null; return null;
} }
@Override @Override
public void setDescription(String des) throws WriteAccessException { public void setDescription(String des) throws WriteAccessException {
} }
@Override @Override
public ICProjectDescription getProjectDescription() { public ICProjectDescription getProjectDescription() {
return projectDescription; return projectDescription;
} }
@Override @Override
public ICFolderDescription getRootFolderDescription() { public ICFolderDescription getRootFolderDescription() {
return null; return null;
} }
@Override @Override
public ICFolderDescription[] getFolderDescriptions() { public ICFolderDescription[] getFolderDescriptions() {
return null; return null;
} }
@Override @Override
public ICFileDescription[] getFileDescriptions() { public ICFileDescription[] getFileDescriptions() {
return null; return null;
} }
@Override @Override
public ICResourceDescription[] getResourceDescriptions() { public ICResourceDescription[] getResourceDescriptions() {
return null; return null;
} }
@Override @Override
public ICResourceDescription getResourceDescription(IPath path, public ICResourceDescription getResourceDescription(IPath path,
boolean exactPath) { boolean exactPath) {
return null; return null;
} }
@Override @Override
public void removeResourceDescription(ICResourceDescription des) public void removeResourceDescription(ICResourceDescription des)
throws CoreException, WriteAccessException { throws CoreException, WriteAccessException {
} }
@Override @Override
public ICFileDescription createFileDescription(IPath path, public ICFileDescription createFileDescription(IPath path,
ICResourceDescription base) throws CoreException, ICResourceDescription base) throws CoreException,
WriteAccessException { WriteAccessException {
return null; return null;
} }
@Override @Override
public ICFolderDescription createFolderDescription(IPath path, public ICFolderDescription createFolderDescription(IPath path,
ICFolderDescription base) throws CoreException, ICFolderDescription base) throws CoreException,
WriteAccessException { WriteAccessException {
return null; return null;
} }
@Override @Override
public String getBuildSystemId() { public String getBuildSystemId() {
return null; return null;
} }
@Override @Override
public CConfigurationData getConfigurationData() { public CConfigurationData getConfigurationData() {
return null; return null;
} }
@Override @Override
public void setActive() throws WriteAccessException { public void setActive() throws WriteAccessException {
} }
@Override @Override
public void setConfigurationData(String buildSystemId, CConfigurationData data) throws WriteAccessException { public void setConfigurationData(String buildSystemId, CConfigurationData data) throws WriteAccessException {
} }
@Override @Override
public boolean isModified() { public boolean isModified() {
return false; return false;
} }
@Override @Override
public ICTargetPlatformSetting getTargetPlatformSetting() { public ICTargetPlatformSetting getTargetPlatformSetting() {
return null; return null;
} }
@Override @Override
public ICSourceEntry[] getSourceEntries() { public ICSourceEntry[] getSourceEntries() {
return null; return null;
} }
@Override @Override
public ICSourceEntry[] getResolvedSourceEntries() { public ICSourceEntry[] getResolvedSourceEntries() {
return null; return null;
} }
@Override @Override
public void setSourceEntries(ICSourceEntry[] entries) throws CoreException, WriteAccessException { public void setSourceEntries(ICSourceEntry[] entries) throws CoreException, WriteAccessException {
} }
@Override @Override
public Map<String, String> getReferenceInfo() { public Map<String, String> getReferenceInfo() {
return null; return null;
} }
@Override @Override
public void setReferenceInfo(Map<String, String> refs) throws WriteAccessException { public void setReferenceInfo(Map<String, String> refs) throws WriteAccessException {
} }
@Override @Override
public ICExternalSetting[] getExternalSettings() { public ICExternalSetting[] getExternalSettings() {
return null; return null;
} }
@Override @Override
public ICExternalSetting createExternalSetting(String[] languageIDs, public ICExternalSetting createExternalSetting(String[] languageIDs,
String[] contentTypeIds, String[] extensions, String[] contentTypeIds, String[] extensions,
ICSettingEntry[] entries) throws WriteAccessException { ICSettingEntry[] entries) throws WriteAccessException {
return null; return null;
} }
@Override @Override
public void removeExternalSetting(ICExternalSetting setting) throws WriteAccessException { public void removeExternalSetting(ICExternalSetting setting) throws WriteAccessException {
} }
@Override @Override
public void removeExternalSettings() throws WriteAccessException { public void removeExternalSettings() throws WriteAccessException {
} }
@Override @Override
public ICBuildSetting getBuildSetting() { public ICBuildSetting getBuildSetting() {
return null; return null;
} }
@Override @Override
public ICdtVariablesContributor getBuildVariablesContributor() { public ICdtVariablesContributor getBuildVariablesContributor() {
return null; return null;
} }
@Override @Override
public Object getSessionProperty(QualifiedName name) { public Object getSessionProperty(QualifiedName name) {
return null; return null;
} }
@Override @Override
public void setSessionProperty(QualifiedName name, Object value) { public void setSessionProperty(QualifiedName name, Object value) {
} }
@Override @Override
public void setName(String name) throws WriteAccessException { public void setName(String name) throws WriteAccessException {
} }
@Override @Override
public ICConfigExtensionReference[] get(String extensionPointID) { public ICConfigExtensionReference[] get(String extensionPointID) {
return null; return null;
} }
@Override @Override
public ICConfigExtensionReference create(String extensionPoint, String extension) throws CoreException { public ICConfigExtensionReference create(String extensionPoint, String extension) throws CoreException {
return null; return null;
} }
@Override @Override
public void remove(ICConfigExtensionReference ext) throws CoreException { public void remove(ICConfigExtensionReference ext) throws CoreException {
} }
@Override @Override
public void remove(String extensionPoint) throws CoreException { public void remove(String extensionPoint) throws CoreException {
} }
@Override @Override
public boolean isPreferenceConfiguration() { public boolean isPreferenceConfiguration() {
return false; return false;
} }
@Override @Override
public ICLanguageSetting getLanguageSettingForFile(IPath path, boolean ignoreExludeStatus) { public ICLanguageSetting getLanguageSettingForFile(IPath path, boolean ignoreExludeStatus) {
return null; return null;
} }
@Override @Override
public void setExternalSettingsProviderIds(String[] ids) { public void setExternalSettingsProviderIds(String[] ids) {
} }
@Override @Override
public String[] getExternalSettingsProviderIds() { public String[] getExternalSettingsProviderIds() {
return null; return null;
} }
@Override @Override
public void updateExternalSettingsProviders(String[] ids) throws WriteAccessException { public void updateExternalSettingsProviders(String[] ids) throws WriteAccessException {
} }
@Override @Override
public CConfigurationStatus getConfigurationStatus() { public CConfigurationStatus getConfigurationStatus() {
return null; return null;
} }
} }
} }

View file

@ -1,22 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>org.eclipse.cdt.core.win32.x86</name> <name>org.eclipse.cdt.core.win32.x86</name>
<comment></comment> <comment></comment>
<projects> <projects>
</projects> </projects>
<buildSpec> <buildSpec>
<buildCommand> <buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name> <name>org.eclipse.pde.ManifestBuilder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name> <name>org.eclipse.pde.SchemaBuilder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
</buildSpec> </buildSpec>
<natures> <natures>
<nature>org.eclipse.pde.PluginNature</nature> <nature>org.eclipse.pde.PluginNature</nature>
</natures> </natures>
</projectDescription> </projectDescription>

View file

@ -1,24 +1,24 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head> <html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>About</title></head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>About</title></head>
<body lang="EN-US"> <body lang="EN-US">
<h2>About This Content</h2> <h2>About This Content</h2>
<p>June 22, 2007</p> <p>June 22, 2007</p>
<h3>License</h3> <h3>License</h3>
<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise <p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
indicated below, the Content is provided to you under the terms and conditions of the indicated below, the Content is provided to you under the terms and conditions of the
Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, "Program" will mean the Content.</p> For purposes of the EPL, "Program" will mean the Content.</p>
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is <p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
being redistributed by another party ("Redistributor") and different terms and conditions may being redistributed by another party ("Redistributor") and different terms and conditions may
apply to your use of any object code in the Content. Check the Redistributor's license that was apply to your use of any object code in the Content. Check the Redistributor's license that was
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply to any source code in the Content indicated below, the terms and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
</body></html> </body></html>

View file

@ -1,15 +1,15 @@
############################################################################### ###############################################################################
# Copyright (c) 2011 Marc-Andre Laperle and others. # Copyright (c) 2011 Marc-Andre Laperle and others.
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0 # are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at # which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html # http://www.eclipse.org/legal/epl-v10.html
# #
# Contributors: # Contributors:
# Marc-Andre Laperle - initial API and implementation # Marc-Andre Laperle - initial API and implementation
############################################################################### ###############################################################################
bin.includes = META-INF/,\ bin.includes = META-INF/,\
os/,\ os/,\
about.html,\ about.html,\
plugin.properties plugin.properties
src.includes = about.html src.includes = about.html

View file

@ -1,22 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<projectDescription> <projectDescription>
<name>org.eclipse.cdt.core.win32.x86_64</name> <name>org.eclipse.cdt.core.win32.x86_64</name>
<comment></comment> <comment></comment>
<projects> <projects>
</projects> </projects>
<buildSpec> <buildSpec>
<buildCommand> <buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name> <name>org.eclipse.pde.ManifestBuilder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
<buildCommand> <buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name> <name>org.eclipse.pde.SchemaBuilder</name>
<arguments> <arguments>
</arguments> </arguments>
</buildCommand> </buildCommand>
</buildSpec> </buildSpec>
<natures> <natures>
<nature>org.eclipse.pde.PluginNature</nature> <nature>org.eclipse.pde.PluginNature</nature>
</natures> </natures>
</projectDescription> </projectDescription>

View file

@ -1,24 +1,24 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head> <html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>About</title></head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>About</title></head>
<body lang="EN-US"> <body lang="EN-US">
<h2>About This Content</h2> <h2>About This Content</h2>
<p>June 22, 2007</p> <p>June 22, 2007</p>
<h3>License</h3> <h3>License</h3>
<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise <p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise
indicated below, the Content is provided to you under the terms and conditions of the indicated below, the Content is provided to you under the terms and conditions of the
Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, "Program" will mean the Content.</p> For purposes of the EPL, "Program" will mean the Content.</p>
<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is <p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
being redistributed by another party ("Redistributor") and different terms and conditions may being redistributed by another party ("Redistributor") and different terms and conditions may
apply to your use of any object code in the Content. Check the Redistributor's license that was apply to your use of any object code in the Content. Check the Redistributor's license that was
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply to any source code in the Content indicated below, the terms and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
</body></html> </body></html>

View file

@ -1,15 +1,15 @@
############################################################################### ###############################################################################
# Copyright (c) 2011 Marc-Andre Laperle and others. # Copyright (c) 2011 Marc-Andre Laperle and others.
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0 # are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at # which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html # http://www.eclipse.org/legal/epl-v10.html
# #
# Contributors: # Contributors:
# Marc-Andre Laperle - initial API and implementation # Marc-Andre Laperle - initial API and implementation
############################################################################### ###############################################################################
bin.includes = META-INF/,\ bin.includes = META-INF/,\
os/,\ os/,\
about.html,\ about.html,\
plugin.properties plugin.properties
src.includes = about.html src.includes = about.html

View file

@ -1,73 +1,73 @@
#******************************************************************************* #*******************************************************************************
# Copyright (c) 2011 Marc-Andre Laperle # Copyright (c) 2011 Marc-Andre Laperle
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0 # are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at # which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html # http://www.eclipse.org/legal/epl-v10.html
# #
# Contributors: # Contributors:
# Marc-Andre Laperle - initial API and implementation # Marc-Andre Laperle - initial API and implementation
#******************************************************************************* #*******************************************************************************
# Makefile (nmake) for Core fragment on Windows x86_64 # Makefile (nmake) for Core fragment on Windows x86_64
OS = win32 OS = win32
ARCH = x86_64 ARCH = x86_64
JDK_INCLUDES= "$(JAVA_HOME)\include" JDK_INCLUDES= "$(JAVA_HOME)\include"
JDK_OS_INCLUDES= "$(JAVA_HOME)\include/$(OS)" JDK_OS_INCLUDES= "$(JAVA_HOME)\include/$(OS)"
CC=cl CC=cl
DEBUG_FLAGS = -DDEBUG_MONITOR -DREAD_REPORT DEBUG_FLAGS = -DDEBUG_MONITOR -DREAD_REPORT
CFLAGS = /TP /I$(JDK_INCLUDES) /I$(JDK_OS_INCLUDES) /EHs /nologo CFLAGS = /TP /I$(JDK_INCLUDES) /I$(JDK_OS_INCLUDES) /EHs /nologo
CFLAGS_UNICODE = /D "_UNICODE" /D "UNICODE" $(CFLAGS) CFLAGS_UNICODE = /D "_UNICODE" /D "UNICODE" $(CFLAGS)
INSTALL_DIR = ..\..\org.eclipse.cdt.core.$(OS).$(ARCH)\os\$(OS)\$(ARCH) INSTALL_DIR = ..\..\org.eclipse.cdt.core.$(OS).$(ARCH)\os\$(OS)\$(ARCH)
DLL_SPAWNER = spawner.dll DLL_SPAWNER = spawner.dll
OBJS_SPAWNER=StdAfx.obj Win32ProcessEx.obj iostream.obj raise.obj spawner.obj OBJS_SPAWNER=StdAfx.obj Win32ProcessEx.obj iostream.obj raise.obj spawner.obj
DLL_WINREG = winreg.dll DLL_WINREG = winreg.dll
OBJS_WINREG=winreg/winreg.obj OBJS_WINREG=winreg/winreg.obj
EXE_STARTER = starter.exe EXE_STARTER = starter.exe
OBJS_STARTER=starter/starter.obj OBJS_STARTER=starter/starter.obj
EXE_LISTTASKS = listtasks.exe EXE_LISTTASKS = listtasks.exe
OBJS_LISTTASKS=listtasks/listtasks.obj listtasks/StdAfx.obj OBJS_LISTTASKS=listtasks/listtasks.obj listtasks/StdAfx.obj
.c.obj: .c.obj:
cl /c $(CFLAGS_UNICODE) $*.c /Fo$@ cl /c $(CFLAGS_UNICODE) $*.c /Fo$@
.cpp.obj: .cpp.obj:
cl /c $(CFLAGS_UNICODE) $*.cpp /Fo$@ cl /c $(CFLAGS_UNICODE) $*.cpp /Fo$@
#TODO: Use unicode for listtasks, see bug 353460 #TODO: Use unicode for listtasks, see bug 353460
listtasks/listtasks.obj: listtasks/listtasks.obj:
cl /c $(CFLAGS) $*.cpp /Fo$@ cl /c $(CFLAGS) $*.cpp /Fo$@
spawner: $(OBJS_SPAWNER) spawner: $(OBJS_SPAWNER)
link /dll /nologo /out:$(DLL_SPAWNER) $(OBJS_SPAWNER) User32.lib link /dll /nologo /out:$(DLL_SPAWNER) $(OBJS_SPAWNER) User32.lib
winreg: $(OBJS_WINREG) winreg: $(OBJS_WINREG)
link /dll /nologo /out:$(DLL_WINREG) $(OBJS_WINREG) Advapi32.lib link /dll /nologo /out:$(DLL_WINREG) $(OBJS_WINREG) Advapi32.lib
starter: $(OBJS_STARTER) starter: $(OBJS_STARTER)
link /nologo /out:$(EXE_STARTER) $(OBJS_STARTER) Psapi.Lib Shell32.lib link /nologo /out:$(EXE_STARTER) $(OBJS_STARTER) Psapi.Lib Shell32.lib
listtasks: $(OBJS_LISTTASKS) listtasks: $(OBJS_LISTTASKS)
link /nologo /out:$(EXE_LISTTASKS) $(OBJS_LISTTASKS) Psapi.Lib link /nologo /out:$(EXE_LISTTASKS) $(OBJS_LISTTASKS) Psapi.Lib
all: spawner winreg starter listtasks all: spawner winreg starter listtasks
clean: clean:
del *.obj *.lib *.exp *.exe *.dll winreg\*.obj starter\*.obj listtasks\*.obj del *.obj *.lib *.exp *.exe *.dll winreg\*.obj starter\*.obj listtasks\*.obj
rebuild: clean all rebuild: clean all
install: all install: all
copy *.dll $(INSTALL_DIR) copy *.dll $(INSTALL_DIR)
copy *.exe $(INSTALL_DIR) copy *.exe $(INSTALL_DIR)
uninstall: uninstall:
del $(INSTALL_DIR)\*.dll $(INSTALL_DIR)\*.exe del $(INSTALL_DIR)\*.dll $(INSTALL_DIR)\*.exe

View file

@ -1,23 +1,23 @@
#******************************************************************************* #*******************************************************************************
# Copyright (c) 2011 Marc-Andre Laperle # Copyright (c) 2011 Marc-Andre Laperle
# All rights reserved. This program and the accompanying materials # All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0 # are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at # which accompanies this distribution, and is available at
# http://www.eclipse.org/legal/epl-v10.html # http://www.eclipse.org/legal/epl-v10.html
# #
# Contributors: # Contributors:
# Marc-Andre Laperle - initial API and implementation # Marc-Andre Laperle - initial API and implementation
#******************************************************************************* #*******************************************************************************
How to build the Win32 x86_64 core fragment: How to build the Win32 x86_64 core fragment:
1. Prerequisites 1. Prerequisites
- Install Windows SDK 7.1. If the SDK is not installed in the default location or if you want to try a different SDK, modify setenv64.bat accordingly. - Install Windows SDK 7.1. If the SDK is not installed in the default location or if you want to try a different SDK, modify setenv64.bat accordingly.
- Make sure your JAVA_HOME environment variable is set and points to a 64 bit JDK (C:\Program Files\Java\jdkX.X.X not C:\Program Files (x86)\Java\jdkX.X.X ) - Make sure your JAVA_HOME environment variable is set and points to a 64 bit JDK (C:\Program Files\Java\jdkX.X.X not C:\Program Files (x86)\Java\jdkX.X.X )
2. Build and install 2. Build and install
- In a command prompt, execute setenv64.bat. - In a command prompt, execute setenv64.bat.
The command prompt should turn to a different color and print a message about targeting x64. The command prompt should turn to a different color and print a message about targeting x64.
- Execute build64.bat - Execute build64.bat
This will build the dlls and executables, copy them to org.eclipse.cdt.core.win32.x86_64\os\win32\x86_64 then clean the build directories. This will build the dlls and executables, copy them to org.eclipse.cdt.core.win32.x86_64\os\win32\x86_64 then clean the build directories.
Optionally, you can use nmake /f Makefile_x86_64.mk TARGET directly. Refer to Makefile_x86_64.mk for valid targets. Optionally, you can use nmake /f Makefile_x86_64.mk TARGET directly. Refer to Makefile_x86_64.mk for valid targets.

View file

@ -1,12 +1,12 @@
@rem *************************************************************************** @rem ***************************************************************************
@rem Copyright (c) 2011 Marc-Andre Laperle and others. @rem Copyright (c) 2011 Marc-Andre Laperle and others.
@rem All rights reserved. This program and the accompanying materials @rem All rights reserved. This program and the accompanying materials
@rem are made available under the terms of the Eclipse Public License v1.0 @rem are made available under the terms of the Eclipse Public License v1.0
@rem which accompanies this distribution, and is available at @rem which accompanies this distribution, and is available at
@rem http://www.eclipse.org/legal/epl-v10.html @rem http://www.eclipse.org/legal/epl-v10.html
@rem @rem
@rem Contributors: @rem Contributors:
@rem Marc-Andre Laperle - initial API and implementation @rem Marc-Andre Laperle - initial API and implementation
@rem *************************************************************************** @rem ***************************************************************************
nmake /f Makefile_x86_64.mk /NOLOGO install clean nmake /f Makefile_x86_64.mk /NOLOGO install clean

View file

@ -1,33 +1,33 @@

Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013 # Visual Studio 2013
VisualStudioVersion = 12.0.31101.0 VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1 MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winreg", "winreg\winreg.vcxproj", "{4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winreg", "winreg\winreg.vcxproj", "{4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Mixed Platforms = Debug|Mixed Platforms Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|Win32 = Debug|Win32 Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64 Debug|x64 = Debug|x64
Release|Mixed Platforms = Release|Mixed Platforms Release|Mixed Platforms = Release|Mixed Platforms
Release|Win32 = Release|Win32 Release|Win32 = Release|Win32
Release|x64 = Release|x64 Release|x64 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Debug|Mixed Platforms.Build.0 = Debug|Win32 {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Debug|Win32.ActiveCfg = Debug|Win32 {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Debug|Win32.ActiveCfg = Debug|Win32
{4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Debug|Win32.Build.0 = Debug|Win32 {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Debug|Win32.Build.0 = Debug|Win32
{4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Debug|x64.ActiveCfg = Debug|Win32 {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Debug|x64.ActiveCfg = Debug|Win32
{4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|Mixed Platforms.ActiveCfg = Release|Win32 {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|Mixed Platforms.Build.0 = Release|Win32 {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|Mixed Platforms.Build.0 = Release|Win32
{4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|Win32.ActiveCfg = Release|Win32 {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|Win32.ActiveCfg = Release|Win32
{4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|Win32.Build.0 = Release|Win32 {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|Win32.Build.0 = Release|Win32
{4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|x64.ActiveCfg = Release|x64 {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|x64.ActiveCfg = Release|x64
{4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|x64.Build.0 = Release|x64 {4CA57EA3-42F2-4CC1-8E95-5C707A8E7363}.Release|x64.Build.0 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View file

@ -1,18 +1,18 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2002 - 2005 QNX Software Systems and others. * Copyright (c) 2002 - 2005 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* QNX Software Systems - initial API and implementation * QNX Software Systems - initial API and implementation
*******************************************************************************/ *******************************************************************************/
// stdafx.cpp : source file that includes just the standard includes // stdafx.cpp : source file that includes just the standard includes
// ProcList.pch will be the pre-compiled header // ProcList.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information // stdafx.obj will contain the pre-compiled type information
#include "stdafx.h" #include "stdafx.h"
// TODO: reference any additional headers you need in STDAFX.H // TODO: reference any additional headers you need in STDAFX.H
// and not in this file // and not in this file

View file

@ -1,29 +1,29 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2002 - 2005 QNX Software Systems and others. * Copyright (c) 2002 - 2005 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* QNX Software Systems - initial API and implementation * QNX Software Systems - initial API and implementation
*******************************************************************************/ *******************************************************************************/
// stdafx.h : include file for standard system include files, // stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but // or project specific include files that are used frequently, but
// are changed infrequently // are changed infrequently
// //
#if !defined(AFX_STDAFX_H__CB3B970F_AA1A_4B59_9F98_DDBEA28470AF__INCLUDED_) #if !defined(AFX_STDAFX_H__CB3B970F_AA1A_4B59_9F98_DDBEA28470AF__INCLUDED_)
#define AFX_STDAFX_H__CB3B970F_AA1A_4B59_9F98_DDBEA28470AF__INCLUDED_ #define AFX_STDAFX_H__CB3B970F_AA1A_4B59_9F98_DDBEA28470AF__INCLUDED_
#if _MSC_VER > 1000 #if _MSC_VER > 1000
#pragma once #pragma once
#endif // _MSC_VER > 1000 #endif // _MSC_VER > 1000
// TODO: reference additional headers your program requires here // TODO: reference additional headers your program requires here
//{{AFX_INSERT_LOCATION}} //{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__CB3B970F_AA1A_4B59_9F98_DDBEA28470AF__INCLUDED_) #endif // !defined(AFX_STDAFX_H__CB3B970F_AA1A_4B59_9F98_DDBEA28470AF__INCLUDED_)

View file

@ -1,346 +1,346 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2002, 2011 QNX Software Systems and others. * Copyright (c) 2002, 2011 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* QNX Software Systems - initial API and implementation * QNX Software Systems - initial API and implementation
*******************************************************************************/ *******************************************************************************/
// ProcList.cpp : Defines the entry point for the console application. // ProcList.cpp : Defines the entry point for the console application.
// //
#include "stdafx.h" #include "stdafx.h"
#include "listtasks.h" #include "listtasks.h"
#include <tlhelp32.h> #include <tlhelp32.h>
#include <vdmdbg.h> #include <vdmdbg.h>
#include <iostream> #include <iostream>
#include <iomanip> #include <iomanip>
using namespace std; using namespace std;
typedef struct typedef struct
{ {
DWORD dwPID ; DWORD dwPID ;
PROCENUMPROC lpProc ; PROCENUMPROC lpProc ;
DWORD lParam ; DWORD lParam ;
BOOL bEnd ; BOOL bEnd ;
} EnumInfoStruct ; } EnumInfoStruct ;
BOOL WINAPI Enum16( DWORD dwThreadId, WORD hMod16, WORD hTask16, BOOL WINAPI Enum16( DWORD dwThreadId, WORD hMod16, WORD hTask16,
PSZ pszModName, PSZ pszFileName, LPARAM lpUserDefined ) ; PSZ pszModName, PSZ pszFileName, LPARAM lpUserDefined ) ;
BOOL CALLBACK OutProcInfo( DWORD pid, WORD, LPSTR procName, LPARAM ) ; BOOL CALLBACK OutProcInfo( DWORD pid, WORD, LPSTR procName, LPARAM ) ;
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
EnumProcs(OutProcInfo, 0); EnumProcs(OutProcInfo, 0);
return 0; return 0;
} }
/********************* /*********************
EnumProc.cpp EnumProc.cpp
*********************/ *********************/
// The EnumProcs function takes a pointer to a callback function // The EnumProcs function takes a pointer to a callback function
// that will be called once per process in the system providing // that will be called once per process in the system providing
// process EXE filename and process ID. // process EXE filename and process ID.
// Callback function definition: // Callback function definition:
// BOOL CALLBACK Proc( DWORD dw, LPCSTR lpstr, LPARAM lParam ) ; // BOOL CALLBACK Proc( DWORD dw, LPCSTR lpstr, LPARAM lParam ) ;
// //
// lpProc -- Address of callback routine. // lpProc -- Address of callback routine.
// //
// lParam -- A user-defined LPARAM value to be passed to // lParam -- A user-defined LPARAM value to be passed to
// the callback routine. // the callback routine.
BOOL WINAPI EnumProcs( PROCENUMPROC lpProc, LPARAM lParam ) BOOL WINAPI EnumProcs( PROCENUMPROC lpProc, LPARAM lParam )
{ {
OSVERSIONINFO osver ; OSVERSIONINFO osver ;
HINSTANCE hInstLib ; HINSTANCE hInstLib ;
HINSTANCE hInstLib2 ; HINSTANCE hInstLib2 ;
HANDLE hSnapShot ; HANDLE hSnapShot ;
PROCESSENTRY32 procentry ; PROCESSENTRY32 procentry ;
BOOL bFlag ; BOOL bFlag ;
LPDWORD lpdwPIDs ; LPDWORD lpdwPIDs ;
DWORD dwSize, dwSize2, dwIndex ; DWORD dwSize, dwSize2, dwIndex ;
HMODULE hMod ; HMODULE hMod ;
HANDLE hProcess ; HANDLE hProcess ;
char szFileName[ MAX_PATH ] ; char szFileName[ MAX_PATH ] ;
EnumInfoStruct sInfo ; EnumInfoStruct sInfo ;
// ToolHelp Function Pointers. // ToolHelp Function Pointers.
HANDLE (WINAPI *lpfCreateToolhelp32Snapshot)(DWORD,DWORD) ; HANDLE (WINAPI *lpfCreateToolhelp32Snapshot)(DWORD,DWORD) ;
BOOL (WINAPI *lpfProcess32First)(HANDLE,LPPROCESSENTRY32) ; BOOL (WINAPI *lpfProcess32First)(HANDLE,LPPROCESSENTRY32) ;
BOOL (WINAPI *lpfProcess32Next)(HANDLE,LPPROCESSENTRY32) ; BOOL (WINAPI *lpfProcess32Next)(HANDLE,LPPROCESSENTRY32) ;
// PSAPI Function Pointers. // PSAPI Function Pointers.
BOOL (WINAPI *lpfEnumProcesses)( DWORD *, DWORD cb, DWORD * ); BOOL (WINAPI *lpfEnumProcesses)( DWORD *, DWORD cb, DWORD * );
BOOL (WINAPI *lpfEnumProcessModules)( HANDLE, HMODULE *, BOOL (WINAPI *lpfEnumProcessModules)( HANDLE, HMODULE *,
DWORD, LPDWORD ); DWORD, LPDWORD );
DWORD (WINAPI *lpfGetModuleFileNameEx)( HANDLE, HMODULE, DWORD (WINAPI *lpfGetModuleFileNameEx)( HANDLE, HMODULE,
LPTSTR, DWORD ); LPTSTR, DWORD );
// VDMDBG Function Pointers. // VDMDBG Function Pointers.
INT (WINAPI *lpfVDMEnumTaskWOWEx)( DWORD, INT (WINAPI *lpfVDMEnumTaskWOWEx)( DWORD,
TASKENUMPROCEX fp, LPARAM ); TASKENUMPROCEX fp, LPARAM );
// Check to see if were running under Windows95 or // Check to see if were running under Windows95 or
// Windows NT. // Windows NT.
osver.dwOSVersionInfoSize = sizeof( osver ) ; osver.dwOSVersionInfoSize = sizeof( osver ) ;
if( !GetVersionEx( &osver ) ) if( !GetVersionEx( &osver ) )
{ {
return FALSE ; return FALSE ;
} }
// If Windows NT: // If Windows NT:
if( osver.dwPlatformId == VER_PLATFORM_WIN32_NT ) if( osver.dwPlatformId == VER_PLATFORM_WIN32_NT )
{ {
// Load library and get the procedures explicitly. We do // Load library and get the procedures explicitly. We do
// this so that we don't have to worry about modules using // this so that we don't have to worry about modules using
// this code failing to load under Windows 95, because // this code failing to load under Windows 95, because
// it can't resolve references to the PSAPI.DLL. // it can't resolve references to the PSAPI.DLL.
hInstLib = LoadLibraryA( "PSAPI.DLL" ) ; hInstLib = LoadLibraryA( "PSAPI.DLL" ) ;
if( hInstLib == NULL ) if( hInstLib == NULL )
return FALSE ; return FALSE ;
SYSTEM_INFO systemInfo; SYSTEM_INFO systemInfo;
GetSystemInfo(&systemInfo); GetSystemInfo(&systemInfo);
bool isWin64 = systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64; bool isWin64 = systemInfo.wProcessorArchitecture == PROCESSOR_ARCHITECTURE_AMD64;
if(!isWin64) if(!isWin64)
{ {
hInstLib2 = LoadLibraryA( "VDMDBG.DLL" ) ; hInstLib2 = LoadLibraryA( "VDMDBG.DLL" ) ;
if( hInstLib2 == NULL ) if( hInstLib2 == NULL )
return FALSE ; return FALSE ;
} }
// Get procedure addresses. // Get procedure addresses.
lpfEnumProcesses = (BOOL(WINAPI *)(DWORD *,DWORD,DWORD*)) lpfEnumProcesses = (BOOL(WINAPI *)(DWORD *,DWORD,DWORD*))
GetProcAddress( hInstLib, "EnumProcesses" ) ; GetProcAddress( hInstLib, "EnumProcesses" ) ;
lpfEnumProcessModules = (BOOL(WINAPI *)(HANDLE, HMODULE *, lpfEnumProcessModules = (BOOL(WINAPI *)(HANDLE, HMODULE *,
DWORD, LPDWORD)) GetProcAddress( hInstLib, DWORD, LPDWORD)) GetProcAddress( hInstLib,
"EnumProcessModules" ) ; "EnumProcessModules" ) ;
lpfGetModuleFileNameEx =(DWORD (WINAPI *)(HANDLE, HMODULE, lpfGetModuleFileNameEx =(DWORD (WINAPI *)(HANDLE, HMODULE,
LPTSTR, DWORD )) GetProcAddress( hInstLib, LPTSTR, DWORD )) GetProcAddress( hInstLib,
"GetModuleFileNameExA" ) ; "GetModuleFileNameExA" ) ;
if(!isWin64) if(!isWin64)
{ {
lpfVDMEnumTaskWOWEx =(INT(WINAPI *)( DWORD, TASKENUMPROCEX, lpfVDMEnumTaskWOWEx =(INT(WINAPI *)( DWORD, TASKENUMPROCEX,
LPARAM))GetProcAddress( hInstLib2, "VDMEnumTaskWOWEx" ); LPARAM))GetProcAddress( hInstLib2, "VDMEnumTaskWOWEx" );
} }
if( lpfEnumProcesses == NULL || if( lpfEnumProcesses == NULL ||
lpfEnumProcessModules == NULL || lpfEnumProcessModules == NULL ||
lpfGetModuleFileNameEx == NULL || lpfGetModuleFileNameEx == NULL ||
(!isWin64 && lpfVDMEnumTaskWOWEx == NULL)) (!isWin64 && lpfVDMEnumTaskWOWEx == NULL))
{ {
FreeLibrary( hInstLib ) ; FreeLibrary( hInstLib ) ;
if(!isWin64) if(!isWin64)
{ {
FreeLibrary( hInstLib2 ) ; FreeLibrary( hInstLib2 ) ;
} }
return FALSE ; return FALSE ;
} }
// Call the PSAPI function EnumProcesses to get all of the // Call the PSAPI function EnumProcesses to get all of the
// ProcID's currently in the system. // ProcID's currently in the system.
// NOTE: In the documentation, the third parameter of // NOTE: In the documentation, the third parameter of
// EnumProcesses is named cbNeeded, which implies that you // EnumProcesses is named cbNeeded, which implies that you
// can call the function once to find out how much space to // can call the function once to find out how much space to
// allocate for a buffer and again to fill the buffer. // allocate for a buffer and again to fill the buffer.
// This is not the case. The cbNeeded parameter returns // This is not the case. The cbNeeded parameter returns
// the number of PIDs returned, so if your buffer size is // the number of PIDs returned, so if your buffer size is
// zero cbNeeded returns zero. // zero cbNeeded returns zero.
// NOTE: The "HeapAlloc" loop here ensures that we // NOTE: The "HeapAlloc" loop here ensures that we
// actually allocate a buffer large enough for all the // actually allocate a buffer large enough for all the
// PIDs in the system. // PIDs in the system.
dwSize2 = 256 * sizeof( DWORD ) ; dwSize2 = 256 * sizeof( DWORD ) ;
lpdwPIDs = NULL ; lpdwPIDs = NULL ;
do do
{ {
if( lpdwPIDs ) if( lpdwPIDs )
{ {
HeapFree( GetProcessHeap(), 0, lpdwPIDs ) ; HeapFree( GetProcessHeap(), 0, lpdwPIDs ) ;
dwSize2 *= 2 ; dwSize2 *= 2 ;
} }
lpdwPIDs = (LPDWORD)HeapAlloc( GetProcessHeap(), 0, dwSize2 ); lpdwPIDs = (LPDWORD)HeapAlloc( GetProcessHeap(), 0, dwSize2 );
if( lpdwPIDs == NULL ) if( lpdwPIDs == NULL )
{ {
FreeLibrary( hInstLib ) ; FreeLibrary( hInstLib ) ;
if(!isWin64) if(!isWin64)
{ {
FreeLibrary( hInstLib2 ) ; FreeLibrary( hInstLib2 ) ;
} }
return FALSE ; return FALSE ;
} }
if( !lpfEnumProcesses( lpdwPIDs, dwSize2, &dwSize ) ) if( !lpfEnumProcesses( lpdwPIDs, dwSize2, &dwSize ) )
{ {
HeapFree( GetProcessHeap(), 0, lpdwPIDs ) ; HeapFree( GetProcessHeap(), 0, lpdwPIDs ) ;
FreeLibrary( hInstLib ) ; FreeLibrary( hInstLib ) ;
if(!isWin64) if(!isWin64)
{ {
FreeLibrary( hInstLib2 ) ; FreeLibrary( hInstLib2 ) ;
} }
return FALSE ; return FALSE ;
} }
}while( dwSize == dwSize2 ) ; }while( dwSize == dwSize2 ) ;
// How many ProcID's did we get? // How many ProcID's did we get?
dwSize /= sizeof( DWORD ) ; dwSize /= sizeof( DWORD ) ;
// Loop through each ProcID. // Loop through each ProcID.
for( dwIndex = 0 ; dwIndex < dwSize ; dwIndex++ ) for( dwIndex = 0 ; dwIndex < dwSize ; dwIndex++ )
{ {
szFileName[0] = 0 ; szFileName[0] = 0 ;
// Open the process (if we can... security does not // Open the process (if we can... security does not
// permit every process in the system). // permit every process in the system).
hProcess = OpenProcess( hProcess = OpenProcess(
PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, PROCESS_QUERY_INFORMATION | PROCESS_VM_READ,
FALSE, lpdwPIDs[ dwIndex ] ) ; FALSE, lpdwPIDs[ dwIndex ] ) ;
if( hProcess != NULL ) if( hProcess != NULL )
{ {
// Here we call EnumProcessModules to get only the // Here we call EnumProcessModules to get only the
// first module in the process this is important, // first module in the process this is important,
// because this will be the .EXE module for which we // because this will be the .EXE module for which we
// will retrieve the full path name in a second. // will retrieve the full path name in a second.
if( lpfEnumProcessModules( hProcess, &hMod, if( lpfEnumProcessModules( hProcess, &hMod,
sizeof( hMod ), &dwSize2 ) ) sizeof( hMod ), &dwSize2 ) )
{ {
// Get Full pathname: // Get Full pathname:
if( !lpfGetModuleFileNameEx( hProcess, hMod, if( !lpfGetModuleFileNameEx( hProcess, hMod,
szFileName, sizeof( szFileName ) ) ) szFileName, sizeof( szFileName ) ) )
{ {
szFileName[0] = 0 ; szFileName[0] = 0 ;
} }
} }
CloseHandle( hProcess ) ; CloseHandle( hProcess ) ;
} }
// Regardless of OpenProcess success or failure, we // Regardless of OpenProcess success or failure, we
// still call the enum func with the ProcID. // still call the enum func with the ProcID.
if(!lpProc( lpdwPIDs[dwIndex], 0, szFileName, lParam)) if(!lpProc( lpdwPIDs[dwIndex], 0, szFileName, lParam))
break ; break ;
// Did we just bump into an NTVDM? // Did we just bump into an NTVDM?
if(!isWin64 && _stricmp( szFileName+(strlen(szFileName)-9), if(!isWin64 && _stricmp( szFileName+(strlen(szFileName)-9),
"NTVDM.EXE")==0) "NTVDM.EXE")==0)
{ {
// Fill in some info for the 16-bit enum proc. // Fill in some info for the 16-bit enum proc.
sInfo.dwPID = lpdwPIDs[dwIndex] ; sInfo.dwPID = lpdwPIDs[dwIndex] ;
sInfo.lpProc = lpProc ; sInfo.lpProc = lpProc ;
sInfo.lParam = lParam ; sInfo.lParam = lParam ;
sInfo.bEnd = FALSE ; sInfo.bEnd = FALSE ;
// Enum the 16-bit stuff. // Enum the 16-bit stuff.
lpfVDMEnumTaskWOWEx( lpdwPIDs[dwIndex], lpfVDMEnumTaskWOWEx( lpdwPIDs[dwIndex],
(TASKENUMPROCEX) Enum16, (TASKENUMPROCEX) Enum16,
(LPARAM) &sInfo); (LPARAM) &sInfo);
// Did our main enum func say quit? // Did our main enum func say quit?
if(sInfo.bEnd) if(sInfo.bEnd)
break ; break ;
} }
} }
HeapFree( GetProcessHeap(), 0, lpdwPIDs ) ; HeapFree( GetProcessHeap(), 0, lpdwPIDs ) ;
if(!isWin64) if(!isWin64)
{ {
FreeLibrary( hInstLib2 ) ; FreeLibrary( hInstLib2 ) ;
} }
// If Windows 95: // If Windows 95:
}else if( osver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ) }else if( osver.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS )
{ {
hInstLib = LoadLibraryA( "Kernel32.DLL" ) ; hInstLib = LoadLibraryA( "Kernel32.DLL" ) ;
if( hInstLib == NULL ) if( hInstLib == NULL )
return FALSE ; return FALSE ;
// Get procedure addresses. // Get procedure addresses.
// We are linking to these functions of Kernel32 // We are linking to these functions of Kernel32
// explicitly, because otherwise a module using // explicitly, because otherwise a module using
// this code would fail to load under Windows NT, // this code would fail to load under Windows NT,
// which does not have the Toolhelp32 // which does not have the Toolhelp32
// functions in the Kernel 32. // functions in the Kernel 32.
lpfCreateToolhelp32Snapshot= lpfCreateToolhelp32Snapshot=
(HANDLE(WINAPI *)(DWORD,DWORD)) (HANDLE(WINAPI *)(DWORD,DWORD))
GetProcAddress( hInstLib, GetProcAddress( hInstLib,
"CreateToolhelp32Snapshot" ) ; "CreateToolhelp32Snapshot" ) ;
lpfProcess32First= lpfProcess32First=
(BOOL(WINAPI *)(HANDLE,LPPROCESSENTRY32)) (BOOL(WINAPI *)(HANDLE,LPPROCESSENTRY32))
GetProcAddress( hInstLib, "Process32First" ) ; GetProcAddress( hInstLib, "Process32First" ) ;
lpfProcess32Next= lpfProcess32Next=
(BOOL(WINAPI *)(HANDLE,LPPROCESSENTRY32)) (BOOL(WINAPI *)(HANDLE,LPPROCESSENTRY32))
GetProcAddress( hInstLib, "Process32Next" ) ; GetProcAddress( hInstLib, "Process32Next" ) ;
if( lpfProcess32Next == NULL || if( lpfProcess32Next == NULL ||
lpfProcess32First == NULL || lpfProcess32First == NULL ||
lpfCreateToolhelp32Snapshot == NULL ) lpfCreateToolhelp32Snapshot == NULL )
{ {
FreeLibrary( hInstLib ) ; FreeLibrary( hInstLib ) ;
return FALSE ; return FALSE ;
} }
// Get a handle to a Toolhelp snapshot of the systems // Get a handle to a Toolhelp snapshot of the systems
// processes. // processes.
hSnapShot = lpfCreateToolhelp32Snapshot( hSnapShot = lpfCreateToolhelp32Snapshot(
TH32CS_SNAPPROCESS, 0 ) ; TH32CS_SNAPPROCESS, 0 ) ;
if( hSnapShot == INVALID_HANDLE_VALUE ) if( hSnapShot == INVALID_HANDLE_VALUE )
{ {
FreeLibrary( hInstLib ) ; FreeLibrary( hInstLib ) ;
return FALSE ; return FALSE ;
} }
// Get the first process' information. // Get the first process' information.
procentry.dwSize = sizeof(PROCESSENTRY32) ; procentry.dwSize = sizeof(PROCESSENTRY32) ;
bFlag = lpfProcess32First( hSnapShot, &procentry ) ; bFlag = lpfProcess32First( hSnapShot, &procentry ) ;
// While there are processes, keep looping. // While there are processes, keep looping.
while( bFlag ) while( bFlag )
{ {
// Call the enum func with the filename and ProcID. // Call the enum func with the filename and ProcID.
if(lpProc( procentry.th32ProcessID, 0, if(lpProc( procentry.th32ProcessID, 0,
procentry.szExeFile, lParam )) procentry.szExeFile, lParam ))
{ {
procentry.dwSize = sizeof(PROCESSENTRY32) ; procentry.dwSize = sizeof(PROCESSENTRY32) ;
bFlag = lpfProcess32Next( hSnapShot, &procentry ); bFlag = lpfProcess32Next( hSnapShot, &procentry );
}else }else
bFlag = FALSE ; bFlag = FALSE ;
} }
}else }else
return FALSE ; return FALSE ;
// Free the library. // Free the library.
FreeLibrary( hInstLib ) ; FreeLibrary( hInstLib ) ;
return TRUE ; return TRUE ;
} }
BOOL WINAPI Enum16( DWORD dwThreadId, WORD hMod16, WORD hTask16, BOOL WINAPI Enum16( DWORD dwThreadId, WORD hMod16, WORD hTask16,
PSZ pszModName, PSZ pszFileName, LPARAM lpUserDefined ) PSZ pszModName, PSZ pszFileName, LPARAM lpUserDefined )
{ {
BOOL bRet ; BOOL bRet ;
EnumInfoStruct *psInfo = (EnumInfoStruct *)lpUserDefined ; EnumInfoStruct *psInfo = (EnumInfoStruct *)lpUserDefined ;
bRet = psInfo->lpProc( psInfo->dwPID, hTask16, pszFileName, bRet = psInfo->lpProc( psInfo->dwPID, hTask16, pszFileName,
psInfo->lParam ) ; psInfo->lParam ) ;
if(!bRet) if(!bRet)
{ {
psInfo->bEnd = TRUE ; psInfo->bEnd = TRUE ;
} }
return !bRet; return !bRet;
} }
BOOL CALLBACK OutProcInfo( DWORD pid, WORD, LPSTR procName, LPARAM ) BOOL CALLBACK OutProcInfo( DWORD pid, WORD, LPSTR procName, LPARAM )
{ {
cout << setw(10) << pid << '\t' << procName << '\n'; cout << setw(10) << pid << '\t' << procName << '\n';
return TRUE; return TRUE;
} }

View file

@ -1,117 +1,117 @@
# Microsoft Developer Studio Project File - Name="listtasks" - Package Owner=<4> # Microsoft Developer Studio Project File - Name="listtasks" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00 # Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT ** # ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Console Application" 0x0103 # TARGTYPE "Win32 (x86) Console Application" 0x0103
CFG=listtasks - Win32 Debug CFG=listtasks - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE, !MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run !MESSAGE use the Export Makefile command and run
!MESSAGE !MESSAGE
!MESSAGE NMAKE /f "listtasks.mak". !MESSAGE NMAKE /f "listtasks.mak".
!MESSAGE !MESSAGE
!MESSAGE You can specify a configuration when running NMAKE !MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example: !MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE !MESSAGE
!MESSAGE NMAKE /f "listtasks.mak" CFG="listtasks - Win32 Debug" !MESSAGE NMAKE /f "listtasks.mak" CFG="listtasks - Win32 Debug"
!MESSAGE !MESSAGE
!MESSAGE Possible choices for configuration are: !MESSAGE Possible choices for configuration are:
!MESSAGE !MESSAGE
!MESSAGE "listtasks - Win32 Release" (based on "Win32 (x86) Console Application") !MESSAGE "listtasks - Win32 Release" (based on "Win32 (x86) Console Application")
!MESSAGE "listtasks - Win32 Debug" (based on "Win32 (x86) Console Application") !MESSAGE "listtasks - Win32 Debug" (based on "Win32 (x86) Console Application")
!MESSAGE !MESSAGE
# Begin Project # Begin Project
# PROP AllowPerConfigDependencies 0 # PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName "" # PROP Scc_ProjName ""
# PROP Scc_LocalPath "" # PROP Scc_LocalPath ""
CPP=cl.exe CPP=cl.exe
RSC=rc.exe RSC=rc.exe
!IF "$(CFG)" == "listtasks - Win32 Release" !IF "$(CFG)" == "listtasks - Win32 Release"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0 # PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release" # PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release" # PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir "" # PROP BASE Target_Dir ""
# PROP Use_MFC 0 # PROP Use_MFC 0
# PROP Use_Debug_Libraries 0 # PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release" # PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release" # PROP Intermediate_Dir "Release"
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG" # ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG" # ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe BSC32=bscmake.exe
# ADD BASE BSC32 /nologo # ADD BASE BSC32 /nologo
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
!ELSEIF "$(CFG)" == "listtasks - Win32 Debug" !ELSEIF "$(CFG)" == "listtasks - Win32 Debug"
# PROP BASE Use_MFC 0 # PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1 # PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug" # PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug" # PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir "" # PROP BASE Target_Dir ""
# PROP Use_MFC 0 # PROP Use_MFC 0
# PROP Use_Debug_Libraries 1 # PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug" # PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug" # PROP Intermediate_Dir "Debug"
# PROP Target_Dir "" # PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c # ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
# ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Yu"stdafx.h" /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG" # ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG" # ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe BSC32=bscmake.exe
# ADD BASE BSC32 /nologo # ADD BASE BSC32 /nologo
# ADD BSC32 /nologo # ADD BSC32 /nologo
LINK32=link.exe LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
!ENDIF !ENDIF
# Begin Target # Begin Target
# Name "listtasks - Win32 Release" # Name "listtasks - Win32 Release"
# Name "listtasks - Win32 Debug" # Name "listtasks - Win32 Debug"
# Begin Group "Source Files" # Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File # Begin Source File
SOURCE=.\listtasks.cpp SOURCE=.\listtasks.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\StdAfx.cpp SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h" # ADD CPP /Yc"stdafx.h"
# End Source File # End Source File
# End Group # End Group
# Begin Group "Header Files" # Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl" # PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File # Begin Source File
SOURCE=.\listtasks.h SOURCE=.\listtasks.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\StdAfx.h SOURCE=.\StdAfx.h
# End Source File # End Source File
# End Group # End Group
# Begin Group "Resource Files" # Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group # End Group
# Begin Source File # Begin Source File
SOURCE=.\ReadMe.txt SOURCE=.\ReadMe.txt
# End Source File # End Source File
# End Target # End Target
# End Project # End Project

View file

@ -1,29 +1,29 @@
Microsoft Developer Studio Workspace File, Format Version 6.00 Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
############################################################################### ###############################################################################
Project: "listtasks"=.\listtasks.dsp - Package Owner=<4> Project: "listtasks"=.\listtasks.dsp - Package Owner=<4>
Package=<5> Package=<5>
{{{ {{{
}}} }}}
Package=<4> Package=<4>
{{{ {{{
}}} }}}
############################################################################### ###############################################################################
Global: Global:
Package=<5> Package=<5>
{{{ {{{
}}} }}}
Package=<3> Package=<3>
{{{ {{{
}}} }}}
############################################################################### ###############################################################################

View file

@ -1,22 +1,22 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2002 - 2005 QNX Software Systems and others. * Copyright (c) 2002 - 2005 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html * http://www.eclipse.org/legal/epl-v10.html
* *
* Contributors: * Contributors:
* QNX Software Systems - initial API and implementation * QNX Software Systems - initial API and implementation
*******************************************************************************/ *******************************************************************************/
#include <windows.h> #include <windows.h>
#ifndef __LISTTASKS_H #ifndef __LISTTASKS_H
#define __LISTTASKS_H #define __LISTTASKS_H
typedef BOOL (CALLBACK *PROCENUMPROC)( DWORD, WORD, LPSTR, typedef BOOL (CALLBACK *PROCENUMPROC)( DWORD, WORD, LPSTR,
LPARAM ) ; LPARAM ) ;
BOOL WINAPI EnumProcs( PROCENUMPROC lpProc, LPARAM lParam ) ; BOOL WINAPI EnumProcs( PROCENUMPROC lpProc, LPARAM lParam ) ;
#endif #endif

View file

@ -1,45 +1,45 @@
/* DO NOT EDIT THIS FILE - it is machine generated */ /* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h> #include <jni.h>
/* Header for class org_eclipse_cdt_utils_pty_PTY */ /* Header for class org_eclipse_cdt_utils_pty_PTY */
#ifndef _Included_org_eclipse_cdt_utils_pty_PTY #ifndef _Included_org_eclipse_cdt_utils_pty_PTY
#define _Included_org_eclipse_cdt_utils_pty_PTY #define _Included_org_eclipse_cdt_utils_pty_PTY
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* /*
* Class: org_eclipse_cdt_utils_pty_PTY * Class: org_eclipse_cdt_utils_pty_PTY
* Method: openMaster * Method: openMaster
* Signature: (Z)Ljava/lang/String; * Signature: (Z)Ljava/lang/String;
*/ */
JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_pty_PTY_openMaster JNIEXPORT jstring JNICALL Java_org_eclipse_cdt_utils_pty_PTY_openMaster
(JNIEnv *, jobject, jboolean); (JNIEnv *, jobject, jboolean);
/* /*
* Class: org_eclipse_cdt_utils_pty_PTY * Class: org_eclipse_cdt_utils_pty_PTY
* Method: change_window_size * Method: change_window_size
* Signature: (III)I * Signature: (III)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_change_1window_1size JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_change_1window_1size
(JNIEnv *, jobject, jint, jint, jint); (JNIEnv *, jobject, jint, jint, jint);
/* /*
* Class: org_eclipse_cdt_utils_pty_PTY * Class: org_eclipse_cdt_utils_pty_PTY
* Method: exec2 * Method: exec2
* Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[ILjava/lang/String;IZ)I * Signature: ([Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;[ILjava/lang/String;IZ)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_exec2 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_exec2
(JNIEnv *, jobject, jobjectArray, jobjectArray, jstring, jintArray, jstring, jint, jboolean); (JNIEnv *, jobject, jobjectArray, jobjectArray, jstring, jintArray, jstring, jint, jboolean);
/* /*
* Class: org_eclipse_cdt_utils_pty_PTY * Class: org_eclipse_cdt_utils_pty_PTY
* Method: waitFor * Method: waitFor
* Signature: (II)I * Signature: (II)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_waitFor JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTY_waitFor
(JNIEnv *, jobject, jint, jint); (JNIEnv *, jobject, jint, jint);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif

View file

@ -1,31 +1,31 @@
/* DO NOT EDIT THIS FILE - it is machine generated */ /* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h> #include <jni.h>
/* Header for class org_eclipse_cdt_utils_pty_PTYInputStream */ /* Header for class org_eclipse_cdt_utils_pty_PTYInputStream */
#ifndef _Included_org_eclipse_cdt_utils_pty_PTYInputStream #ifndef _Included_org_eclipse_cdt_utils_pty_PTYInputStream
#define _Included_org_eclipse_cdt_utils_pty_PTYInputStream #define _Included_org_eclipse_cdt_utils_pty_PTYInputStream
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#undef org_eclipse_cdt_utils_pty_PTYInputStream_MAX_SKIP_BUFFER_SIZE #undef org_eclipse_cdt_utils_pty_PTYInputStream_MAX_SKIP_BUFFER_SIZE
#define org_eclipse_cdt_utils_pty_PTYInputStream_MAX_SKIP_BUFFER_SIZE 2048L #define org_eclipse_cdt_utils_pty_PTYInputStream_MAX_SKIP_BUFFER_SIZE 2048L
/* /*
* Class: org_eclipse_cdt_utils_pty_PTYInputStream * Class: org_eclipse_cdt_utils_pty_PTYInputStream
* Method: read0 * Method: read0
* Signature: (I[BI)I * Signature: (I[BI)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_read0 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_read0
(JNIEnv *, jobject, jint, jbyteArray, jint); (JNIEnv *, jobject, jint, jbyteArray, jint);
/* /*
* Class: org_eclipse_cdt_utils_pty_PTYInputStream * Class: org_eclipse_cdt_utils_pty_PTYInputStream
* Method: close0 * Method: close0
* Signature: (I)I * Signature: (I)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_close0 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYInputStream_close0
(JNIEnv *, jobject, jint); (JNIEnv *, jobject, jint);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif

View file

@ -1,29 +1,29 @@
/* DO NOT EDIT THIS FILE - it is machine generated */ /* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h> #include <jni.h>
/* Header for class org_eclipse_cdt_utils_pty_PTYOutputStream */ /* Header for class org_eclipse_cdt_utils_pty_PTYOutputStream */
#ifndef _Included_org_eclipse_cdt_utils_pty_PTYOutputStream #ifndef _Included_org_eclipse_cdt_utils_pty_PTYOutputStream
#define _Included_org_eclipse_cdt_utils_pty_PTYOutputStream #define _Included_org_eclipse_cdt_utils_pty_PTYOutputStream
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* /*
* Class: org_eclipse_cdt_utils_pty_PTYOutputStream * Class: org_eclipse_cdt_utils_pty_PTYOutputStream
* Method: write0 * Method: write0
* Signature: (I[BI)I * Signature: (I[BI)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_write0 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_write0
(JNIEnv *, jobject, jint, jbyteArray, jint); (JNIEnv *, jobject, jint, jbyteArray, jint);
/* /*
* Class: org_eclipse_cdt_utils_pty_PTYOutputStream * Class: org_eclipse_cdt_utils_pty_PTYOutputStream
* Method: close0 * Method: close0
* Signature: (I)I * Signature: (I)I
*/ */
JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_close0 JNIEXPORT jint JNICALL Java_org_eclipse_cdt_utils_pty_PTYOutputStream_close0
(JNIEnv *, jobject, jint); (JNIEnv *, jobject, jint);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif

View file

@ -1,46 +1,46 @@

Microsoft Visual Studio Solution File, Format Version 11.00 Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C++ Express 2010 # Visual C++ Express 2010
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pty", "pty.vcxproj", "{5589D515-1C56-4641-97CF-3C4561109258}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pty", "pty.vcxproj", "{5589D515-1C56-4641-97CF-3C4561109258}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winpty", "winpty.vcxproj", "{D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winpty", "winpty.vcxproj", "{D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}"
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winpty-agent", "winpty-agent.vcxproj", "{E7A42398-12E7-4BC1-B72B-5D62B71E9816}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winpty-agent", "winpty-agent.vcxproj", "{E7A42398-12E7-4BC1-B72B-5D62B71E9816}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32 Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64 Debug|x64 = Debug|x64
Release|Win32 = Release|Win32 Release|Win32 = Release|Win32
Release|x64 = Release|x64 Release|x64 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5589D515-1C56-4641-97CF-3C4561109258}.Debug|Win32.ActiveCfg = Debug|Win32 {5589D515-1C56-4641-97CF-3C4561109258}.Debug|Win32.ActiveCfg = Debug|Win32
{5589D515-1C56-4641-97CF-3C4561109258}.Debug|Win32.Build.0 = Debug|Win32 {5589D515-1C56-4641-97CF-3C4561109258}.Debug|Win32.Build.0 = Debug|Win32
{5589D515-1C56-4641-97CF-3C4561109258}.Debug|x64.ActiveCfg = Debug|x64 {5589D515-1C56-4641-97CF-3C4561109258}.Debug|x64.ActiveCfg = Debug|x64
{5589D515-1C56-4641-97CF-3C4561109258}.Debug|x64.Build.0 = Debug|x64 {5589D515-1C56-4641-97CF-3C4561109258}.Debug|x64.Build.0 = Debug|x64
{5589D515-1C56-4641-97CF-3C4561109258}.Release|Win32.ActiveCfg = Release|Win32 {5589D515-1C56-4641-97CF-3C4561109258}.Release|Win32.ActiveCfg = Release|Win32
{5589D515-1C56-4641-97CF-3C4561109258}.Release|Win32.Build.0 = Release|Win32 {5589D515-1C56-4641-97CF-3C4561109258}.Release|Win32.Build.0 = Release|Win32
{5589D515-1C56-4641-97CF-3C4561109258}.Release|x64.ActiveCfg = Release|x64 {5589D515-1C56-4641-97CF-3C4561109258}.Release|x64.ActiveCfg = Release|x64
{5589D515-1C56-4641-97CF-3C4561109258}.Release|x64.Build.0 = Release|x64 {5589D515-1C56-4641-97CF-3C4561109258}.Release|x64.Build.0 = Release|x64
{D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Debug|Win32.ActiveCfg = Debug|Win32 {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Debug|Win32.ActiveCfg = Debug|Win32
{D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Debug|Win32.Build.0 = Debug|Win32 {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Debug|Win32.Build.0 = Debug|Win32
{D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Debug|x64.ActiveCfg = Debug|x64 {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Debug|x64.ActiveCfg = Debug|x64
{D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Debug|x64.Build.0 = Debug|x64 {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Debug|x64.Build.0 = Debug|x64
{D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Release|Win32.ActiveCfg = Release|Win32 {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Release|Win32.ActiveCfg = Release|Win32
{D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Release|Win32.Build.0 = Release|Win32 {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Release|Win32.Build.0 = Release|Win32
{D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Release|x64.ActiveCfg = Release|x64 {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Release|x64.ActiveCfg = Release|x64
{D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Release|x64.Build.0 = Release|x64 {D7BFF73A-A86A-47FF-AD2B-CC2EFCAD5ABD}.Release|x64.Build.0 = Release|x64
{E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Debug|Win32.ActiveCfg = Debug|Win32 {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Debug|Win32.ActiveCfg = Debug|Win32
{E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Debug|Win32.Build.0 = Debug|Win32 {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Debug|Win32.Build.0 = Debug|Win32
{E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Debug|x64.ActiveCfg = Debug|x64 {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Debug|x64.ActiveCfg = Debug|x64
{E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Debug|x64.Build.0 = Debug|x64 {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Debug|x64.Build.0 = Debug|x64
{E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Release|Win32.ActiveCfg = Release|Win32 {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Release|Win32.ActiveCfg = Release|Win32
{E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Release|Win32.Build.0 = Release|Win32 {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Release|Win32.Build.0 = Release|Win32
{E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Release|x64.ActiveCfg = Release|x64 {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Release|x64.ActiveCfg = Release|x64
{E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Release|x64.Build.0 = Release|x64 {E7A42398-12E7-4BC1-B72B-5D62B71E9816}.Release|x64.Build.0 = Release|x64
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
EndGlobalSection EndGlobalSection
EndGlobal EndGlobal

View file

@ -1,177 +1,177 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32"> <ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64"> <ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32"> <ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release|x64"> <ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{5589D515-1C56-4641-97CF-3C4561109258}</ProjectGuid> <ProjectGuid>{5589D515-1C56-4641-97CF-3C4561109258}</ProjectGuid>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<RootNamespace>pty</RootNamespace> <RootNamespace>pty</RootNamespace>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset> <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset> <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset> <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType> <ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset> <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir> <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
<IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir> <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir> <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir> <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>./jni/include;C:\NoScan\Apps\Java\jdk1.6.0_31\include;C:\NoScan\Apps\Java\jdk1.6.0_31\include\win32;..\winpty\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>./jni/include;C:\NoScan\Apps\Java\jdk1.6.0_31\include;C:\NoScan\Apps\Java\jdk1.6.0_31\include\win32;..\winpty\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>DelayImp.lib;winpty.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>DelayImp.lib;winpty.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
<DelayLoadDLLs>winpty.dll;%(DelayLoadDLLs)</DelayLoadDLLs> <DelayLoadDLLs>winpty.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile> <ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>./jni/include;C:\NoScan\Apps\Java\jdk1.6.0_31\include;C:\NoScan\Apps\Java\jdk1.6.0_31\include\win32;..\winpty\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>./jni/include;C:\NoScan\Apps\Java\jdk1.6.0_31\include;C:\NoScan\Apps\Java\jdk1.6.0_31\include\win32;..\winpty\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>DelayImp.lib;winpty.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>DelayImp.lib;winpty.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
<DelayLoadDLLs>winpty.dll;%(DelayLoadDLLs)</DelayLoadDLLs> <DelayLoadDLLs>winpty.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<PrecompiledHeader> <PrecompiledHeader>
</PrecompiledHeader> </PrecompiledHeader>
<Optimization>MaxSpeed</Optimization> <Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>./jni/include;C:\NoScan\Apps\Java\jdk1.6.0_31\include;C:\NoScan\Apps\Java\jdk1.6.0_31\include\win32;..\winpty\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>./jni/include;C:\NoScan\Apps\Java\jdk1.6.0_31\include;C:\NoScan\Apps\Java\jdk1.6.0_31\include\win32;..\winpty\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>DelayImp.lib;winpty.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>DelayImp.lib;winpty.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
<DelayLoadDLLs>winpty.dll;%(DelayLoadDLLs)</DelayLoadDLLs> <DelayLoadDLLs>winpty.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<PrecompiledHeader> <PrecompiledHeader>
</PrecompiledHeader> </PrecompiledHeader>
<Optimization>MaxSpeed</Optimization> <Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>./jni/include;C:\NoScan\Apps\Java\jdk1.6.0_31\include;C:\NoScan\Apps\Java\jdk1.6.0_31\include\win32;..\winpty\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>./jni/include;C:\NoScan\Apps\Java\jdk1.6.0_31\include;C:\NoScan\Apps\Java\jdk1.6.0_31\include\win32;..\winpty\include;.;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Windows</SubSystem> <SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>DelayImp.lib;winpty.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>DelayImp.lib;winpty.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>$(SolutionDir)$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>
<DelayLoadDLLs>winpty.dll;%(DelayLoadDLLs)</DelayLoadDLLs> <DelayLoadDLLs>winpty.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="jni\include\PTY.h" /> <ClInclude Include="jni\include\PTY.h" />
<ClInclude Include="jni\include\PTYInputStream.h" /> <ClInclude Include="jni\include\PTYInputStream.h" />
<ClInclude Include="jni\include\PTYOutputStream.h" /> <ClInclude Include="jni\include\PTYOutputStream.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="jni\src\dllmain.cpp" /> <ClCompile Include="jni\src\dllmain.cpp" />
<ClCompile Include="jni\src\pty.cpp" /> <ClCompile Include="jni\src\pty.cpp" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>
</Project> </Project>

View file

@ -1,30 +1,30 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup> <ItemGroup>
<Filter Include="include"> <Filter Include="include">
<UniqueIdentifier>{679c3039-d4a8-48db-9a3b-33f73f3b44c0}</UniqueIdentifier> <UniqueIdentifier>{679c3039-d4a8-48db-9a3b-33f73f3b44c0}</UniqueIdentifier>
</Filter> </Filter>
<Filter Include="src"> <Filter Include="src">
<UniqueIdentifier>{b7f98685-8f42-40d2-bd2b-65bcbac17645}</UniqueIdentifier> <UniqueIdentifier>{b7f98685-8f42-40d2-bd2b-65bcbac17645}</UniqueIdentifier>
</Filter> </Filter>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="jni\include\PTY.h"> <ClInclude Include="jni\include\PTY.h">
<Filter>include</Filter> <Filter>include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="jni\include\PTYInputStream.h"> <ClInclude Include="jni\include\PTYInputStream.h">
<Filter>include</Filter> <Filter>include</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="jni\include\PTYOutputStream.h"> <ClInclude Include="jni\include\PTYOutputStream.h">
<Filter>include</Filter> <Filter>include</Filter>
</ClInclude> </ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="jni\src\pty.cpp"> <ClCompile Include="jni\src\pty.cpp">
<Filter>src</Filter> <Filter>src</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="jni\src\dllmain.cpp"> <ClCompile Include="jni\src\dllmain.cpp">
<Filter>src</Filter> <Filter>src</Filter>
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
</Project> </Project>

View file

@ -1,185 +1,185 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32"> <ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64"> <ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration> <Configuration>Debug</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32"> <ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
</ProjectConfiguration> </ProjectConfiguration>
<ProjectConfiguration Include="Release|x64"> <ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration> <Configuration>Release</Configuration>
<Platform>x64</Platform> <Platform>x64</Platform>
</ProjectConfiguration> </ProjectConfiguration>
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{E7A42398-12E7-4BC1-B72B-5D62B71E9816}</ProjectGuid> <ProjectGuid>{E7A42398-12E7-4BC1-B72B-5D62B71E9816}</ProjectGuid>
<Keyword>Win32Proj</Keyword> <Keyword>Win32Proj</Keyword>
<RootNamespace>winptyagent</RootNamespace> <RootNamespace>winptyagent</RootNamespace>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset> <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset> <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset> <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType> <ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries> <UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
<PlatformToolset>Windows7.1SDK</PlatformToolset> <PlatformToolset>Windows7.1SDK</PlatformToolset>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings"> <ImportGroup Label="ExtensionSettings">
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir> <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental> <LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir> <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir> <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental> <LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir> <OutDir>$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir> <IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile> <ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_WINDOWS;NOMINMAX;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_WINDOWS;NOMINMAX;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile> <ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_WINDOWS;NOMINMAX;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_WINDOWS;NOMINMAX;_DEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization> <Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;_WINDOWS;NOMINMAX;NDEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_WINDOWS;NOMINMAX;NDEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation> <GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile> <ClCompile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
<Optimization>MaxSpeed</Optimization> <Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;_WINDOWS;NOMINMAX;NDEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_WINDOWS;NOMINMAX;NDEBUG;_CONSOLE;_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>..\winpty\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary> <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile> </ClCompile>
<Link> <Link>
<SubSystem>Console</SubSystem> <SubSystem>Console</SubSystem>
<GenerateDebugInformation>false</GenerateDebugInformation> <GenerateDebugInformation>false</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
</Link> </Link>
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\winpty\agent\Agent.h" /> <ClInclude Include="..\winpty\agent\Agent.h" />
<ClInclude Include="..\winpty\agent\AgentAssert.h" /> <ClInclude Include="..\winpty\agent\AgentAssert.h" />
<ClInclude Include="..\winpty\agent\ConsoleInput.h" /> <ClInclude Include="..\winpty\agent\ConsoleInput.h" />
<ClInclude Include="..\winpty\agent\Coord.h" /> <ClInclude Include="..\winpty\agent\Coord.h" />
<ClInclude Include="..\winpty\agent\DsrSender.h" /> <ClInclude Include="..\winpty\agent\DsrSender.h" />
<ClInclude Include="..\winpty\agent\EventLoop.h" /> <ClInclude Include="..\winpty\agent\EventLoop.h" />
<ClInclude Include="..\winpty\agent\NamedPipe.h" /> <ClInclude Include="..\winpty\agent\NamedPipe.h" />
<ClInclude Include="..\winpty\agent\SmallRect.h" /> <ClInclude Include="..\winpty\agent\SmallRect.h" />
<ClInclude Include="..\winpty\agent\Terminal.h" /> <ClInclude Include="..\winpty\agent\Terminal.h" />
<ClInclude Include="..\winpty\agent\Win32Console.h" /> <ClInclude Include="..\winpty\agent\Win32Console.h" />
<ClInclude Include="..\winpty\shared\AgentMsg.h" /> <ClInclude Include="..\winpty\shared\AgentMsg.h" />
<ClInclude Include="..\winpty\shared\Buffer.h" /> <ClInclude Include="..\winpty\shared\Buffer.h" />
<ClInclude Include="..\winpty\shared\c99_snprintf.h" /> <ClInclude Include="..\winpty\shared\c99_snprintf.h" />
<ClInclude Include="..\winpty\shared\DebugClient.h" /> <ClInclude Include="..\winpty\shared\DebugClient.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClCompile Include="..\winpty\agent\Agent.cc" /> <ClCompile Include="..\winpty\agent\Agent.cc" />
<ClCompile Include="..\winpty\agent\AgentAssert.cc" /> <ClCompile Include="..\winpty\agent\AgentAssert.cc" />
<ClCompile Include="..\winpty\agent\ConsoleInput.cc" /> <ClCompile Include="..\winpty\agent\ConsoleInput.cc" />
<ClCompile Include="..\winpty\agent\Coord.cc" /> <ClCompile Include="..\winpty\agent\Coord.cc" />
<ClCompile Include="..\winpty\agent\EventLoop.cc" /> <ClCompile Include="..\winpty\agent\EventLoop.cc" />
<ClCompile Include="..\winpty\agent\main.cc" /> <ClCompile Include="..\winpty\agent\main.cc" />
<ClCompile Include="..\winpty\agent\NamedPipe.cc" /> <ClCompile Include="..\winpty\agent\NamedPipe.cc" />
<ClCompile Include="..\winpty\agent\SmallRect.cc" /> <ClCompile Include="..\winpty\agent\SmallRect.cc" />
<ClCompile Include="..\winpty\agent\Terminal.cc" /> <ClCompile Include="..\winpty\agent\Terminal.cc" />
<ClCompile Include="..\winpty\agent\Win32Console.cc" /> <ClCompile Include="..\winpty\agent\Win32Console.cc" />
<ClCompile Include="..\winpty\shared\DebugClient.cc" /> <ClCompile Include="..\winpty\shared\DebugClient.cc" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
</ImportGroup> </ImportGroup>
</Project> </Project>

Some files were not shown because too many files have changed in this diff Show more