From 44e7ab81c117fc224558bdceb651c7588576e390 Mon Sep 17 00:00:00 2001 From: cas Date: Fri, 9 Jun 2000 14:09:51 +0000 Subject: [PATCH] No comments --- src/WOKStep/WOKStep_Compile.cxx | 4 +- src/WOKStep/WOKStep_ComputeLinkList.cxx | 5 +- src/WOKStep/WOKStep_ExtractExecList.cxx | 1 + src/WOKStep/WOKStep_JavaCompile.tcl | 155 ++++-- src/WOKStep/WOKStep_JavaHeader.tcl | 138 ++++-- src/WOKStep/WOKStep_JiniExtract.cxx | 633 +++++++++++++++++------- src/WOKStep/WOKStep_LibLimit.cxx | 1 + src/WOKStep/WOKStep_LinkList.cxx | 35 +- src/WOKStep/WOKStep_ProcessStep.cxx | 8 +- src/WOKStep/WOKStep_WNTK.cxx | 4 +- src/WOKStep/WOKStep_WNTLibrary.cxx | 6 +- src/WOKStep/WOKStep_WNTLink.cxx | 10 +- 12 files changed, 690 insertions(+), 310 deletions(-) diff --git a/src/WOKStep/WOKStep_Compile.cxx b/src/WOKStep/WOKStep_Compile.cxx index b0a8984..6ad38ec 100755 --- a/src/WOKStep/WOKStep_Compile.cxx +++ b/src/WOKStep/WOKStep_Compile.cxx @@ -333,7 +333,9 @@ _TEST_BREAK(); stadm -> GetPath (); - OSD_Path p ( stadm -> Path () -> Name () -> ToCString () ); +// OSD_Path p ( stadm -> Path () -> Name () -> ToCString () ); + TCollection_AsciiString atstr = stadm -> Path () -> Name () -> ToCString () ; + OSD_Path p ( atstr ); OSD_File f ( p ); f.Build ( diff --git a/src/WOKStep/WOKStep_ComputeLinkList.cxx b/src/WOKStep/WOKStep_ComputeLinkList.cxx index e2f2de1..f28361d 100755 --- a/src/WOKStep/WOKStep_ComputeLinkList.cxx +++ b/src/WOKStep/WOKStep_ComputeLinkList.cxx @@ -250,8 +250,9 @@ void WOKStep_ComputeLinkList::Execute(const Handle(WOKMake_HSequenceOfInputFile) AddExecDepItem(infile, outfile, Standard_True); else { - SetFailed(); - return; +// cout << "WOKStep_ComputeLinkList::Execute GetUnitLibrary returns outfile.IsNull() ==> SetFailed()/return was suppressed(JR)" << endl ; +// SetFailed(); +// return; } } } diff --git a/src/WOKStep/WOKStep_ExtractExecList.cxx b/src/WOKStep/WOKStep_ExtractExecList.cxx index 968bb15..0019a12 100755 --- a/src/WOKStep/WOKStep_ExtractExecList.cxx +++ b/src/WOKStep/WOKStep_ExtractExecList.cxx @@ -126,6 +126,7 @@ _TEST_BREAK(); outfile->SetPhysicFlag(Standard_False); outfile->SetStepID(Standard_True); +// cout << "WOKStep_ExtractExecList::Execute -> GetAndAddStep" << endl ; Handle(WOKMake_Step) astep = BuildProcess()->GetAndAddStep(Unit(), Code(), bent->Name()); astep->DoExecute(); diff --git a/src/WOKStep/WOKStep_JavaCompile.tcl b/src/WOKStep/WOKStep_JavaCompile.tcl index c32bb6d..a79ff52 100755 --- a/src/WOKStep/WOKStep_JavaCompile.tcl +++ b/src/WOKStep/WOKStep_JavaCompile.tcl @@ -1,77 +1,126 @@ - proc WOKStep_JavaCompile:AdmFileType {} { - return dbadmfile; + return dbadmfile; + } proc WOKStep_JavaCompile:OutputDirTypeName {} { - return dbtmpdir; + + return dbtmpdir; + } proc WOKStep_JavaCompile:HandleInputFile { ID } { - scan $ID "%\[^:\]:%\[^:\]:%\[^:\]" unit type name + scan $ID "%\[^:\]:%\[^:\]:%\[^:\]" unit type name - if {[file extension $name] == ".java"} { - return 1; - } - return 0; + if { [file extension $name] == ".java" } { + + return 1; + + } + + return 0; + } proc WOKStep_JavaCompile:ComputeIncludeDir { unit } { + + global env + global tcl_platform + + if { $tcl_platform(platform) == "windows" } { + set ps "\\;" + } else { + set ps ":" + } + + set fJava [info exists env(WOK_USE_JAVA_DIRECTORY)] - set allwb [w_info -A $unit] - set unitname [wokinfo -n $unit] - set result "" + set allwb [w_info -A $unit] + set unitname [wokinfo -n $unit] + set result "" - set themax [llength $allwb] + set themax [llength $allwb] - for {set i $themax} {[expr $i != 0]} {incr i -1} { - set awb [lindex $allwb [expr $i - 1]] - if {![wokinfo -x ${awb}:$unitname]} { - set pseudounit [lindex [w_info -l $awb] 0] - set addinc [wokinfo -p derivated:.. ${awb}:$pseudounit] - set result ${addinc}:$result - } else { - set addinc [wokinfo -p derivated:.. ${awb}:$unitname] - set result ${addinc}:$result - set addinc [wokinfo -p source:. ${awb}:$unitname] - set result ${addinc}:$result - } - } - return $result + for { set i $themax } { [expr $i != 0] } { incr i -1 } { + + set awb [lindex $allwb [expr $i - 1]] + + if { $fJava } { + set addinc [UNC [wokparam -e WOKEntity_javadir ${awb}]] + } else { + set addinc [UNC [wokparam -e WOKEntity_drvdir ${awb}]] + } + + set result ${addinc}$ps$result + + } + + set result $env(WOKHOME)$ps$result + + return $result + } proc WOKStep_JavaCompile:Execute { theunit args } { + + global env + global tcl_platform - msgprint -i -c "WOKStep_JavaCompile::Execute" "Processing unit : $theunit" - msgprint -i -c "WOKStep_JavaCompile::Execute" + msgprint -i -c "WOKStep_JavaCompile:Execute" "Processing unit : $theunit" + msgprint -i -c "WOKStep_JavaCompile:Execute" - set unitname [wokinfo -n $theunit] - set failed 0 - set incdir [WOKStep_JavaCompile:ComputeIncludeDir $theunit] - wokparam -s%IncludeDir=$incdir - set outdir [wokinfo -p derivated:.. $theunit] - wokparam -s%OutDir=$outdir - - foreach ID $args { - scan $ID "%\[^:\]:%\[^:\]:%\[^:\]" unit type name - set infile [woklocate -p $ID] - wokparam -s%Source=$infile - set thecommand [wokparam -e JAVA_Compiler] - - set outfileid [file rootname $name] - set outfileid ${outfileid}.class + set fJava [info exists env(WOK_USE_JAVA_DIRECTORY)] + + set unitname [wokinfo -n $theunit] + set failed 0 + set incdir [WOKStep_JavaCompile:ComputeIncludeDir $theunit] + wokparam -s%IncludeDir=$incdir + + if { $fJava } { + set outdir [UNC [wokparam -e WOKEntity_javadir [wokinfo -w]]] + } else { + set outdir [UNC [wokparam -e WOKEntity_drvdir [wokinfo -w]]] + } + + wokparam -s%OutDir=$outdir + + foreach ID $args { + + scan $ID "%\[^:\]:%\[^:\]:%\[^:\]" unit type name + set infile [UNC [woklocate -p $ID]] + + if { $tcl_platform(platform) == "windows" } { + regsub -all "/" $infile "\\\\\\" infile + } + + wokparam -s%Source=$infile + set thecommand [wokparam -e JAVA_Compiler] + set outfileid [file rootname $name] + set outfileid ${outfileid}.class - msgprint -i -c "WOKStep_JavaCompile::Execute" "Compiling $name" - if {[catch {eval exec [lindex $thecommand 0]} res]} { - msgprint -e -c "WOKStep_JavaCompile::Execute" $res - set failed 1 - } else { - stepoutputadd $unitname:derivated:$outfileid - stepaddexecdepitem $ID $unitname:derivated:$outfileid - } - } + msgprint -i -c "WOKStep_JavaCompile:Execute" "Compiling $name" + + if { [catch {eval exec [lindex $thecommand 0]} res] } { + + msgprint -e -c "WOKStep_JavaCompile:Execute" $res + set failed 1 + + } else { + + if { $fJava } { + stepoutputadd $unitname:javafile:$outfileid + stepaddexecdepitem $ID $unitname:javafile:$outfileid + } else { + stepoutputadd $unitname:derivated:$outfileid + stepaddexecdepitem $ID $unitname:derivated:$outfileid + } + + } + + } - return $failed + return $failed + } diff --git a/src/WOKStep/WOKStep_JavaHeader.tcl b/src/WOKStep/WOKStep_JavaHeader.tcl index 0e76fc2..2cac194 100755 --- a/src/WOKStep/WOKStep_JavaHeader.tcl +++ b/src/WOKStep/WOKStep_JavaHeader.tcl @@ -1,76 +1,114 @@ - proc WOKStep_JavaHeader:AdmFileType {} { - return dbadmfile; + return dbadmfile; + } proc WOKStep_JavaHeader:OutputDirTypeName {} { - return dbtmpdir; + + return dbtmpdir; + } proc WOKStep_JavaHeader:HandleInputFile { ID } { - scan $ID "%\[^:\]:%\[^:\]:%\[^:\]" unit type name + scan $ID "%\[^:\]:%\[^:\]:%\[^:\]" unit type name - if {[file extension $name] == ".java"} { - return 1; - } - return 0; + if { [file extension $name] == ".java" } { + + return 1; + + } + + return 0; + } proc WOKStep_JavaHeader:ComputeIncludeDir { unit } { - set allwb [w_info -A $unit] - set unitname [wokinfo -n $unit] - set result "" - - set themax [llength $allwb] + global env + global tcl_platform + + set fJava [info exists env(WOK_USE_JAVA_DIRECTORY)] + + if { $tcl_platform(platform) == "windows" } { + set ps "\\;" + } else { + set ps ":" + } + + set allwb [w_info -A $unit] + set unitname [wokinfo -n $unit] + set result "" + set themax [llength $allwb] - for {set i $themax} {[expr $i != 0]} {incr i -1} { - set awb [lindex $allwb [expr $i - 1]] - if {![wokinfo -x ${awb}:$unitname]} { - set pseudounit [lindex [w_info -l $awb] 0] - set addinc [wokinfo -p derivated:.. ${awb}:$pseudounit] - set result ${addinc}:$result - } else { - set addinc [wokinfo -p derivated:.. ${awb}:$unitname] - set result ${addinc}:$result - } - } - return $result + for {set i $themax} {[expr $i != 0]} {incr i -1} { + + set awb [lindex $allwb [expr $i - 1]] + + if { $fJava != 0 } { + set addinc [UNC [wokparam -e WOKEntity_javadir ${awb}]] + } else { + set addinc [UNC [wokparam -e WOKEntity_drvdir ${awb}]] + } + + set result ${addinc}$ps$result + + } + + return $env(WOKHOME)$ps$result + } proc WOKStep_JavaHeader:Execute { theunit args } { - msgprint -i -c "WOKStep_JavaHeader::Execute" "Processing unit : $theunit" - msgprint -i -c "WOKStep_JavaHeader::Execute" + global tcl_platform + + msgprint -i -c "WOKStep_JavaHeader:Execute" "Processing unit : $theunit" + msgprint -i -c "WOKStep_JavaHeader:Execute" - set unitname [wokinfo -n $theunit] - set failed 0 - set incdir [WOKStep_JavaHeader:ComputeIncludeDir $theunit] - wokparam -s%IncludeDir=$incdir + set unitname [wokinfo -n $theunit] + set failed 0 + set incdir [WOKStep_JavaHeader:ComputeIncludeDir $theunit] + wokparam -s%IncludeDir=$incdir - foreach ID $args { - scan $ID "%\[^:\]:%\[^:\]:%\[^:\]" unit type name - set infile [woklocate -p $ID] + foreach ID $args { + + scan $ID "%\[^:\]:%\[^:\]:%\[^:\]" unit type name + set infile [UNC [woklocate -p $ID]] - set outfileid [file rootname $name] - wokparam -s%Class=${unitname}.$outfileid - set outfileid ${unitname}_${outfileid}.h - set outfile [wokinfo -p pubinclude:$outfileid $theunit] - wokparam -s%OutFile=$outfile + if { $tcl_platform(platform) == "windows" } { + regsub -all "/" $infile "\\\\\\" infile + } + + set outfileid [file rootname $name] + wokparam -s%Class=${unitname}.$outfileid + + set nameid ${unitname} + regsub -all "\\." $nameid "_" nameid + set outfileid ${nameid}_${outfileid}.h + + set outfile [UNC [wokinfo -p pubinclude:$outfileid $theunit]] + wokparam -s%OutFile=$outfile - set thecommand [wokparam -e JAVA_Header] + set thecommand [wokparam -e JAVA_Header] - msgprint -i -c "WOKStep_JavaCompile::Execute" "Building header $outfileid" - if {[catch {eval exec [lindex $thecommand 0]} res]} { - msgprint -e -c "WOKStep_JavaCompile::Execute" $res - set failed 1 - } else { - stepoutputadd $unitname:pubinclude:$outfileid - stepaddexecdepitem $ID $unitname:pubinclude:$outfileid - } - } + msgprint -i -c "WOKStep_JavaCompile:Execute" "Building header $outfileid" + + if { [catch {eval exec [lindex $thecommand 0]} res] } { + + msgprint -e -c "WOKStep_JavaCompile:Execute" $res + set failed 1 + + } else { + + stepoutputadd $unitname:pubinclude:$outfileid + stepaddexecdepitem $ID $unitname:pubinclude:$outfileid + + } + + } - return $failed + return $failed + } diff --git a/src/WOKStep/WOKStep_JiniExtract.cxx b/src/WOKStep/WOKStep_JiniExtract.cxx index 2c43e01..6d64af8 100755 --- a/src/WOKStep/WOKStep_JiniExtract.cxx +++ b/src/WOKStep/WOKStep_JiniExtract.cxx @@ -3,8 +3,7 @@ // Created: Mon Mar 22 17:10:16 1999 // Author: Arnaud BOUZY // - -#include +// Modification: Eugeny PLOTNIKOV (ClassFile.cfg generation) #include @@ -15,6 +14,9 @@ #include #include +#include +#include +#include #include #include @@ -33,56 +35,85 @@ #include +#include +#include +#include //======================================================================= //function : WOKStep_JiniExtract //purpose : //======================================================================= -WOKStep_JiniExtract::WOKStep_JiniExtract(const Handle(WOKMake_BuildProcess)& abp, - const Handle(WOKernel_DevUnit)& aunit, - const Handle(TCollection_HAsciiString)& acode, - const Standard_Boolean checked, - const Standard_Boolean hidden) -: WOKStep_Extract(abp, aunit, acode, checked, hidden) -{ - Handle(WOKBuilder_MSJiniExtractor) anextractor = new WOKBuilder_MSJiniExtractor(Unit()->Params()); - anextractor->SetMSchema(WOKBuilder_MSTool::GetMSchema()); - SetExtractor(anextractor); -} +WOKStep_JiniExtract :: WOKStep_JiniExtract ( + const Handle( WOKMake_BuildProcess)& abp, + const Handle( WOKernel_DevUnit)& aunit, + const Handle( TCollection_HAsciiString )& acode, + const Standard_Boolean checked, + const Standard_Boolean hidden + ) : WOKStep_Extract ( abp, aunit, acode, checked, hidden ) { + + Handle( WOKBuilder_MSJiniExtractor ) anextractor = + new WOKBuilder_MSJiniExtractor ( Unit () -> Params () ); + + anextractor -> SetMSchema ( WOKBuilder_MSTool :: GetMSchema () ); + SetExtractor ( anextractor ); +} // end WOKStep_JiniExtract :: WOKStep_JiniExtract //======================================================================= //function : HandleInputFile //purpose : //======================================================================= -Standard_Boolean WOKStep_JiniExtract::HandleInputFile(const Handle(WOKMake_InputFile)& infile) -{ - if(!infile->IsPhysic()) - { - if(!strcmp("CPPJini_COMPLETE", infile->ID()->Token(":",2)->ToCString())) - { - infile->SetDirectFlag(Standard_True); - infile->SetBuilderEntity(new WOKBuilder_MSEntity(infile->ID()->Token(":",3))); - return Standard_True; - } - if(!strcmp("CPPJini_INCOMPLETE", infile->ID()->Token(":",2)->ToCString())) - { - infile->SetDirectFlag(Standard_True); - infile->SetBuilderEntity(new WOKBuilder_MSEntity(infile->ID()->Token(":",3))); - return Standard_True; - } - if(!strcmp("CPPJini_SEMICOMPLETE", infile->ID()->Token(":",2)->ToCString())) - { - infile->SetDirectFlag(Standard_True); - infile->SetBuilderEntity(new WOKBuilder_MSEntity(infile->ID()->Token(":",3))); - return Standard_True; - } +Standard_Boolean WOKStep_JiniExtract :: HandleInputFile ( + const Handle( WOKMake_InputFile )& infile + ) { +//JR ) const { + + if ( !infile -> IsPhysic () ) { + + if ( !strcmp ( + "CPPJini_COMPLETE", infile -> ID () -> Token ( ":", 2 ) -> ToCString () + ) + ) { + + infile -> SetDirectFlag ( Standard_True ); + infile -> SetBuilderEntity ( + new WOKBuilder_MSEntity ( infile -> ID () -> Token ( ":", 3 ) ) + ); + return Standard_True; + + } // end if + + if ( !strcmp ( + "CPPJini_INCOMPLETE", infile -> ID () -> Token ( ":", 2 ) -> ToCString () + ) + ) { + + infile -> SetDirectFlag ( Standard_True ); + infile -> SetBuilderEntity ( + new WOKBuilder_MSEntity ( infile -> ID () -> Token ( ":", 3 ) ) + ); + return Standard_True; + + } // end if + + if ( !strcmp ( + "CPPJini_SEMICOMPLETE", infile -> ID () -> Token ( ":", 2 ) -> ToCString () + ) + ) { + + infile -> SetDirectFlag ( Standard_True ); + infile -> SetBuilderEntity ( + new WOKBuilder_MSEntity ( infile -> ID () -> Token ( ":", 3 ) ) + ); + return Standard_True; + + } // end if - } - return Standard_False; - -} + } // end if + return Standard_False; + +} // end WOKStep_JiniExtract :: HandleInputFile //======================================================================= //Author : Jean Gautier (jga) //function : Init @@ -206,8 +237,16 @@ Handle(WOKMake_HSequenceOfInputFile) WOKStep_JiniExtract::OutOfDateEntities() return result; } + Handle( TCollection_HAsciiString ) aName = + new TCollection_HAsciiString ( anent -> Name () ); + + aName -> AssignCat ( "@" ); + aName -> AssignCat ( Unit () -> Name () ); +#if 0 WOKBuilder_MSActionID anid(anent->Name(), Extractor()->ExtractorID()); - +#else + WOKBuilder_MSActionID anid ( aName, Extractor () -> ExtractorID () ); +#endif Handle(WOKBuilder_MSAction) anaction = ameta->GetAction(anid); switch(Extractor()->ExtractionStatus(anaction)) @@ -226,172 +265,392 @@ Handle(WOKMake_HSequenceOfInputFile) WOKStep_JiniExtract::OutOfDateEntities() return result; } - - //======================================================================= //function : Execute //purpose : //======================================================================= -void WOKStep_JiniExtract::Execute(const Handle(WOKMake_HSequenceOfInputFile)& tobuild) -{ - Standard_Integer i,j; +void WOKStep_JiniExtract :: Execute ( const Handle( WOKMake_HSequenceOfInputFile )& tobuild ) { - // Used Types - Handle(WOKernel_FileType) sourcetype = Unit()->GetFileType("source"); - Handle(WOKernel_FileType) privincludetype = Unit()->GetFileType("privinclude"); - Handle(WOKernel_FileType) pubincludetype = Unit()->GetFileType("pubinclude"); - Handle(WOKernel_FileType) derivatedtype = Unit()->GetFileType("derivated"); - Handle(WOKernel_FileType) englispfiletype = Unit()->GetFileType("englisp"); + Standard_Boolean secondPass = Standard_False; + Standard_Integer i, j, k, l; - Handle(WOKBuilder_Command) acmd = new WOKBuilder_Command(new TCollection_HAsciiString("COMMAND"), Unit()->Params()); - Handle(WOKUtils_Shell) ashell = Shell(); + Handle( WOKernel_FileType ) sourcetype = Unit () -> GetFileType ( "source" ); + Handle( WOKernel_FileType ) privincludetype = Unit () -> GetFileType ( "privinclude" ); + Handle( WOKernel_FileType ) pubincludetype = Unit () -> GetFileType ( "pubinclude" ); + Handle( WOKernel_FileType ) derivatedtype = Unit () -> GetFileType ( "derivated" ); + Handle( WOKernel_FileType ) englispfiletype = Unit () -> GetFileType ( "englisp" ); + Handle( WOKernel_FileType ) javatype; - ashell->Lock(); - acmd->SetShell(ashell); + OSD_Environment env ( "WOK_USE_JAVA_DIRECTORY" ); - Handle(WOKernel_File) outfile, basefile; - Extractor()->Load(); - Extractor()->SetOutputDir(OutputDir()); + javatype = env.Value ().IsEmpty () ? Unit () -> GetFileType ( "derivated" ) + : Unit () -> GetFileType ( "javafile" ); - WOKBuilder_MSExtractorIterator anit(WOKBuilder_MSTool::GetMSchema(), Extractor()); - - for(j=1; j<=tobuild->Length(); j++) - { - - Handle(WOKBuilder_MSEntity) entity = Handle(WOKBuilder_MSEntity)::DownCast(tobuild->Value(j)->BuilderEntity()); - Handle(TCollection_HAsciiString) amode = tobuild->Value(j)->ID()->Token(":", 2); + Handle( TCollection_HAsciiString ) str; + + Handle( WOKMake_HSequenceOfInputFile ) buildSeq = tobuild; + Handle( WOKMake_HSequenceOfInputFile ) aPackSeq = new WOKMake_HSequenceOfInputFile (); + + Handle( WOKBuilder_Command ) acmd = + new WOKBuilder_Command ( new TCollection_HAsciiString ( "COMMAND" ), Unit () -> Params () ); + Handle( WOKUtils_Shell ) ashell = Shell (); + + ashell -> Lock (); + acmd -> SetShell ( ashell ); + + Handle( WOKernel_File ) outfile, basefile; + Extractor () -> Load (); + Extractor () -> SetOutputDir ( OutputDir () ); + + WOKBuilder_MSExtractorIterator anit ( WOKBuilder_MSTool :: GetMSchema (), Extractor () ); +nextPass: + for ( j = 1; j <= buildSeq -> Length (); ++j ) { + + Handle( WOKBuilder_MSEntity ) entity = + Handle( WOKBuilder_MSEntity ) :: DownCast ( buildSeq -> Value ( j ) -> BuilderEntity () ); + Handle( TCollection_HAsciiString ) amode = buildSeq -> Value ( j ) -> ID () -> Token ( ":", 2 ); + + if ( !secondPass && + Extractor () -> MSchema () -> MetaSchema () -> IsPackage ( entity -> Name () ) + ) { + + aPackSeq -> Append ( buildSeq -> Value ( j ) ); + continue; + + } // end if - switch(anit.Execute(entity, amode->ToCString())) - { - case WOKBuilder_Success: - { + switch ( anit.Execute ( entity, amode -> ToCString () ) ) { + + case WOKBuilder_Success: { #ifdef WOK_VERBOSE - if(VerboseMsg("WOK_EXTRACT").IsSet()) - { - VerboseMsg("WOK_EXTRACT") << "WOKStep_Extract::Execute" << entity->Name() << " produces : " << endm; - for(i=1; i<=anit.Produces()->Length(); i++) - { - VerboseMsg("WOK_EXTRACT") << "WOKStep_Extract::Execute" - << "\t\t" << anit.Produces()->Value(i)->Path()->Name() << endm; - } - } -#endif - - WOKBuilder_MSActionID anid(entity->Name(), WOKBuilder_ClientExtract); - Handle(WOKBuilder_MSAction) anaction = Extractor()->MSchema()->GetAction(anid); - Handle(WOKBuilder_Entity) outent; - - Extractor()->MSchema()->ChangeAddAction(anid, Handle(WOKBuilder_Specification)()); - - for(i=1; i<=anit.Produces()->Length(); i++) - { - Standard_Boolean istemplate = Standard_False; - - outent = anit.Produces()->Value(i); - switch(outent->Path()->Extension()) - { - case WOKUtils_HXXFile: - // a .hxx file is a public include - outfile = new WOKernel_File(outent->Path()->FileName(), Unit(), pubincludetype); - break; - case WOKUtils_IXXFile: - case WOKUtils_JXXFile: - case WOKUtils_DDLFile: - // Private includes - outfile = new WOKernel_File(outent->Path()->FileName(), Unit(), privincludetype); - break; - case WOKUtils_CXXFile: - // Devivated Cxx file - outfile = new WOKernel_File(outent->Path()->FileName(), Unit(), derivatedtype); - break; - case WOKUtils_DATFile: - // Derivated datafile - outfile = new WOKernel_File(outent->Path()->FileName(), Unit(), derivatedtype); - break; - case WOKUtils_LispFile: - // Engine Lisp File - outfile = new WOKernel_File(outent->Path()->FileName(), Unit(), englispfiletype); - break; - case WOKUtils_TemplateFile: - outfile = new WOKernel_File(outent->Path()->FileName(), Unit(), sourcetype); - istemplate = Standard_True; - break; -#ifdef WNT - case WOKNT_UnknownFile: + if ( VerboseMsg ( "WOK_EXTRACT" ).IsSet () ) { + + VerboseMsg ( "WOK_EXTRACT" ) << "WOKStep_Extract::Execute" + << entity -> Name () + << " produces : " + << endm; + + for ( i = 1; i <= anit.Produces () -> Length (); ++i ) + + VerboseMsg ( "WOK_EXTRACT" ) << "WOKStep_Extract::Execute" + << "\t\t" + << anit.Produces () -> Value ( i ) -> Path () -> Name () + << endm; + } // end if +#endif // WOK_VERBOSE + str = new TCollection_HAsciiString ( entity -> Name () ); + + str -> AssignCat ( "@" ); + str -> AssignCat ( Unit () -> Name () ); +#if 0 + WOKBuilder_MSActionID anid ( entity -> Name (), WOKBuilder_ClientExtract ); #else - case WOKUnix_UnknownFile: + WOKBuilder_MSActionID anid ( str, WOKBuilder_ClientExtract ); #endif - if (!strcmp(outent->Path()->ExtensionName()->ToCString(),".java")) { - outfile = new WOKernel_File(outent->Path()->FileName(), Unit(), privincludetype); - } - break; - default: break; + Handle( WOKBuilder_MSAction ) anaction = Extractor () -> MSchema () -> GetAction ( anid ); + Handle( WOKBuilder_Entity ) outent; + + Extractor () -> MSchema () -> ChangeAddAction ( + anid, Handle( WOKBuilder_Specification ) () + ); + + for ( i = 1; i <= anit.Produces () -> Length (); ++i ) { + + Standard_Boolean istemplate = Standard_False; + + outent = anit.Produces () -> Value ( i ); + + switch ( outent -> Path () -> Extension () ) { + + case WOKUtils_HXXFile: + + outfile = new WOKernel_File ( outent -> Path () -> FileName (), Unit (), pubincludetype ); + + break; + + case WOKUtils_IXXFile: + case WOKUtils_JXXFile: + case WOKUtils_DDLFile: + + outfile = new WOKernel_File ( outent -> Path () -> FileName (), Unit (), privincludetype ); + + break; + + case WOKUtils_CXXFile: { + + TCollection_AsciiString name; + OSD_Path p ( outent -> Path () -> FileName () -> String () ); + + name = p.Name (); + name.ChangeAll ( '.', '_' ); + p.SetName ( name ); + p.SystemName ( name ); + + outfile = new WOKernel_File ( + new TCollection_HAsciiString ( name ), Unit (), derivatedtype + ); + + } break; + + case WOKUtils_DATFile: + + outfile = new WOKernel_File ( outent -> Path () -> FileName (), Unit (), derivatedtype ); - } + break; + + case WOKUtils_LispFile: + + outfile = new WOKernel_File(outent->Path()->FileName(), Unit(), englispfiletype); + + break; + + case WOKUtils_TemplateFile: + + outfile = new WOKernel_File ( outent -> Path () -> FileName (), Unit (), sourcetype ); + istemplate = Standard_True; + + break; + + case WOKUtils_UnknownFile: + + if ( !strcmp ( outent -> Path () -> ExtensionName () -> ToCString (), ".java" ) ) + + outfile = new WOKernel_File ( + outent -> Path () -> FileName (), Unit (), javatype + ); + + break; + + default: break; + + } // end switch - outfile->GetPath(); - basefile = Locator()->Locate(Unit()->Name(), outfile->TypeName(), outfile->Name()); + outfile -> GetPath (); + basefile = Locator () -> Locate ( + Unit () -> Name (), outfile -> TypeName (), outfile -> Name () + ); - WOKBuilder_BuildStatus astatus = WOKBuilder_Unbuilt; + WOKBuilder_BuildStatus astatus = WOKBuilder_Unbuilt; - if(basefile.IsNull()) - { - // pas encore de Fichier : Simply Move - astatus = acmd->Move(outent->Path(), outfile->Path()); - } - else - { - if(!outent->Path()->IsSameFile(basefile->Path())) - { - astatus = acmd->Move(outent->Path(), outfile->Path()); - } - //astatus = acmd->ReplaceIfChangedWith(outent->Path(), basefile->Path(), outfile->Path()); - } + if ( basefile.IsNull () ) + + astatus = acmd -> Move ( outent -> Path (), outfile -> Path () ); + + else if ( !outent -> Path () -> IsSameFile ( basefile -> Path () ) ) + + astatus = acmd -> Move ( outent -> Path (), outfile -> Path () ); + + else astatus = outent -> Path () -> RemoveFile () ? WOKBuilder_Unbuilt : WOKBuilder_Failed; - Handle(WOKMake_OutputFile) out; - - switch(astatus) - { - case WOKBuilder_Success: - outent->SetPath(outfile->Path()); - out = new WOKMake_OutputFile(outfile->LocatorName(), outfile, outent, outfile->Path()); - out->SetLocateFlag(Standard_True); - out->SetProduction(); - if(!istemplate) AddExecDepItem(tobuild->Value(j), out, Standard_True); - - InfoMsg << "WOKStep_Extract::Execute" << "File : " << outfile->Path()->Name() << " is modified" << endm; - break; - case WOKBuilder_Unbuilt: + Handle( WOKMake_OutputFile ) out; + + switch ( astatus ) { + + case WOKBuilder_Success: + + outent -> SetPath ( outfile -> Path () ); + out = new WOKMake_OutputFile ( + outfile -> LocatorName (), outfile, outent, outfile -> Path () + ); + out -> SetLocateFlag ( Standard_True ); + out -> SetProduction (); + + if ( !istemplate ) AddExecDepItem ( buildSeq -> Value ( j ), out, Standard_True ); + + InfoMsg << "WOKStep_Extract::Execute" + << "File : " + << outfile -> Path () -> Name () + << " is modified" + << endm; + + break; + + case WOKBuilder_Unbuilt: #ifdef WOK_VERBOSE - VerboseMsg("WOK_EXTRACT") << "WOKStep_Extract::Execute" - << "File : " << outfile->Path()->Name() << " is unchanged" << endm; -#endif - - outent->SetPath(basefile->Path()); - out = new WOKMake_OutputFile(basefile->LocatorName(), basefile, outent, basefile->Path()); - out->SetLocateFlag(Standard_True); - out->SetProduction(); - if(!istemplate) AddExecDepItem(tobuild->Value(j), out, Standard_True); - break; - case WOKBuilder_Failed: - SetFailed(); - ErrorMsg << "WOKStep_Extract::Execute" << "Failed : " << outfile->Name() << endm; - break; - default: break; - } - } - } - break; - case WOKBuilder_Failed: - ErrorMsg << "WOKStep_Extract::Execute" << "Failed : " << entity->Name() << endm; - break; - default: break; - } - } + VerboseMsg ( "WOK_EXTRACT" ) << "WOKStep_Extract::Execute" + << "File : " + << outfile -> Path () -> Name () + << " is unchanged" + << endm; +#endif // WOK_VERBOSE + outent -> SetPath ( basefile -> Path () ); + out = new WOKMake_OutputFile ( + basefile -> LocatorName (), basefile, outent, basefile -> Path () + ); + out -> SetLocateFlag ( Standard_True ); + out -> SetProduction (); - ashell->UnLock(); + if ( !istemplate ) AddExecDepItem ( buildSeq -> Value ( j ), out, Standard_True ); - if(Status() == WOKMake_Unprocessed) SetSucceeded(); - return; -} + break; + + case WOKBuilder_Failed: + + SetFailed (); + + ErrorMsg << "WOKStep_Extract::Execute" + << "Failed : " + << outfile -> Name () + << endm; + + break; + + default: break; + + } // end switch + + } // end for + + } break; + + case WOKBuilder_Failed: + + ErrorMsg << "WOKStep_Extract::Execute" + << "Failed : " + << entity -> Name () + << endm; + + break; + + default: break; + + } // end switch + + } // end for + + if ( !secondPass && aPackSeq -> Length () > 0 ) { + + secondPass = Standard_True; + buildSeq = aPackSeq; + goto nextPass; + + } // end if + + InfoMsg << "WOKStep_Extract::Execute" << "Generating ClassFile.cfg" << endm; +#ifdef WNT + Handle( TCollection_HAsciiString ) NL = new TCollection_HAsciiString ( "\r\n" ); +#else + Handle( TCollection_HAsciiString ) NL = new TCollection_HAsciiString ( "\n" ); +#endif // WNT + Handle( TCollection_HAsciiString ) cfg = new TCollection_HAsciiString ( "[base]" ); + Handle( MS_Client ) clt = Extractor() -> MSchema () -> MetaSchema () -> + GetClient ( Unit () -> Name () ); + Handle( TColStd_HSequenceOfHAsciiString ) cltSeq = new TColStd_HSequenceOfHAsciiString (); + WOKTools_MapOfHAsciiString map; + + cltSeq -> Append ( Unit () -> Name () ); + cfg -> AssignCat ( NL ); + str = new TCollection_HAsciiString( Unit () -> Name () ); + str -> ChangeAll ( '.', '/' ); + cfg -> AssignCat ( str ); + cfg -> AssignCat ( NL ); + + for ( i = 1; i <= clt -> Uses () -> Length (); ++i ) { + + str = new TCollection_HAsciiString ( clt -> Uses () -> Value ( i ) ); + str -> ChangeAll ( '.', '/' ); + cltSeq -> Append ( clt -> Uses () -> Value ( i ) ); + cfg -> AssignCat ( str ); + cfg -> AssignCat ( NL ); + + } // end for + + cfg -> AssignCat ( "[dependent]" ); + cfg -> AssignCat ( NL ); + + for ( i = 1; i <= cltSeq -> Length (); ++i ) { + + clt = Extractor () -> MSchema () -> MetaSchema () -> GetClient ( cltSeq -> Value ( i ) ); + + if ( !clt.IsNull () ) { + + str = new TCollection_HAsciiString ( clt -> Name () ); + str -> ChangeAll ( '.', '/' ); + cfg -> AssignCat ( str ); + cfg -> AssignCat ( NL ); + + Handle( TColStd_HSequenceOfHAsciiString ) intfSeq = clt -> Interfaces (); + Handle( TColStd_HSequenceOfHAsciiString ) clasSeq; + + for ( j = 1; j <= intfSeq -> Length (); ++j ) { + + Handle( MS_Interface ) intf = Extractor () -> MSchema () -> MetaSchema () -> + GetInterface ( intfSeq -> Value ( j ) ); + + if ( !intf.IsNull () ) { + + clasSeq = intf -> Classes (); + + for ( k = 1; k <= clasSeq -> Length (); ++k ) + + if ( !map.Contains ( clasSeq -> Value ( k ) ) ) { + + cfg -> AssignCat ( "/" ); + cfg -> AssignCat ( clasSeq -> Value ( k ) ); + cfg -> AssignCat ( NL ); + map.Add ( clasSeq -> Value ( k ) ); + + } // end if + + } // end if + + Handle( TColStd_HSequenceOfHAsciiString ) packSeq = intf -> Packages (); + + for ( k = 1; k <= packSeq -> Length (); ++k ) { + + Handle( MS_Package ) pack = Extractor () -> MSchema () -> MetaSchema () -> + GetPackage ( packSeq -> Value ( k ) ); + + if ( !pack.IsNull () ) { + + clasSeq = pack -> Classes (); + + for ( l = 1; l <= clasSeq -> Length (); ++l ) { + + str = new TCollection_HAsciiString ( pack -> Name () ); + + str -> AssignCat ( "_" ); + str -> AssignCat ( clasSeq -> Value ( l ) ); + + if ( !map.Contains ( str ) ) { + + cfg -> AssignCat ( "/" ); + cfg -> AssignCat ( str ); + cfg -> AssignCat ( NL ); + map.Add ( str ); + + } // end if + + } // end for + + } // end if + + } // end for + + } // end for + + } // end if + + } // end for + + outfile = new WOKernel_File ( + new TCollection_HAsciiString ( "ClassFile.cfg" ), Unit (), javatype + ); + outfile -> GetPath (); + + OSD_File f ( OSD_Path ( outfile -> Path () -> Name () -> String () ) ); + + f.Build ( OSD_WriteOnly, OSD_Protection ( OSD_RWXD, OSD_RWXD, OSD_R, OSD_R ) ); + + if ( !f.Failed () ) { + + f.Write ( cfg -> String (), cfg -> Length () ); + f.Close (); + + } // end if + + ashell -> UnLock (); + + if ( Status () == WOKMake_Unprocessed ) SetSucceeded (); +} // end WOKStep_JiniExtract :: Execute diff --git a/src/WOKStep/WOKStep_LibLimit.cxx b/src/WOKStep/WOKStep_LibLimit.cxx index 2f08e40..08abdb4 100755 --- a/src/WOKStep/WOKStep_LibLimit.cxx +++ b/src/WOKStep/WOKStep_LibLimit.cxx @@ -227,6 +227,7 @@ void WOKStep_LibLimit::Execute(const Handle(WOKMake_HSequenceOfInputFile)& execl outfile->SetPhysicFlag(Standard_False); outfile->SetStepID(Standard_True); +// cout << "WOKStep_LibLimit::Execute -> GetAndAddStep" << endl ; Handle(WOKMake_Step) astep = BuildProcess()->GetAndAddStep(Unit(), Code(), it.Key()); astep->DoExecute(); diff --git a/src/WOKStep/WOKStep_LinkList.cxx b/src/WOKStep/WOKStep_LinkList.cxx index fe40261..833eea6 100755 --- a/src/WOKStep/WOKStep_LinkList.cxx +++ b/src/WOKStep/WOKStep_LinkList.cxx @@ -196,14 +196,13 @@ Handle(WOKMake_OutputFile) WOKStep_LinkList::GetUnitLibrary(const Handle(WOKerne Standard_Boolean mustExist = aunit->SearchInFileList(Locator(),libname); if (mustExist) { -// ErrorMsg << "WOKStep_LinkList::GetUnitLibrary" -// << "No library (" << libname << ") found for unit " << aunit->Name() << endm; -// SetFailed(); + ErrorMsg << "WOKStep_LinkList::GetUnitLibrary" + << "No library (" << libname << ") found for unit " << aunit->Name() << endm; + SetFailed(); } - else { -// WarningMsg << "WOKStep_LinkList::GetUnitLibrary" -// << "No library (" << libname << ") in unit " << aunit->Name() << endm; - } + else + WarningMsg << "WOKStep_LinkList::GetUnitLibrary" + << "No library (" << libname << ") in unit " << aunit->Name() << endm; } else { @@ -354,13 +353,27 @@ void WOKStep_LinkList::AddWorkbenchUnitContribution(const Handle(WOKMake_InputFi << "Processing step " << step->UniqueName() << endm; //---> EUG4JR - if ( !strcmp ( DynamicType () -> Name (), "WOKStep_TransitiveLinkList" ) ) - - g_fForceLib = Standard_True; + if ( !strcmp ( DynamicType () -> Name (), "WOKStep_TransitiveLinkList" ) || + !strcmp ( DynamicType () -> Name (), "WOKStep_DirectLinkList" ) + ) g_fForceLib = Standard_True; //<--- EUG4JR Handle(WOKMake_HSequenceOfOutputFile) outfiles = step->OutputFileList(); //---> EUG4JR - if ( g_fForceLib ) g_fForceLib = Standard_False; + if ( g_fForceLib ) { + + if ( Unit () -> Params ().Value ( "%UseUnitLibraries" ).IsNull () && + outfiles.IsNull () + ) { + + outfiles = new WOKMake_HSequenceOfOutputFile (); + + outfiles -> Append ( GetUnitLibrary ( aunit ) ); + + } // end if + + g_fForceLib = Standard_False; + + } // end if //<--- EUG4JR if(outfiles.IsNull()) { diff --git a/src/WOKStep/WOKStep_ProcessStep.cxx b/src/WOKStep/WOKStep_ProcessStep.cxx index 46b5a7c..ede2a28 100755 --- a/src/WOKStep/WOKStep_ProcessStep.cxx +++ b/src/WOKStep/WOKStep_ProcessStep.cxx @@ -320,7 +320,9 @@ void WOKStep_ProcessStep::TreatOutput(const Handle(WOKMake_InputFile)& infile, c aoutfile->GetPath(); //-> EUG4YAN TCollection_AsciiString s; - OSD_Path p ( outent -> Path () -> Name () -> ToCString () ); +// OSD_Path p ( outent -> Path () -> Name () -> ToCString () ); + TCollection_AsciiString atstr = outent -> Path () -> Name () -> ToCString () ; + OSD_Path p ( atstr ); //<- EUG4YAN // je l'y deplace outent->Path()->MoveTo(aoutfile->Path()); @@ -336,7 +338,9 @@ void WOKStep_ProcessStep::TreatOutput(const Handle(WOKMake_InputFile)& infile, c if ( pp -> Exists () ) { - OSD_Path p ( aoutfile -> Path () -> Name () -> ToCString () ); +// OSD_Path p ( aoutfile -> Path () -> Name () -> ToCString () ); + TCollection_AsciiString atstr = aoutfile -> Path () -> Name () -> ToCString () ; + OSD_Path p ( atstr ); p.SetExtension ( ".d" ); p.SystemName ( s ); diff --git a/src/WOKStep/WOKStep_WNTK.cxx b/src/WOKStep/WOKStep_WNTK.cxx index ed875c0..ff6c9dd 100755 --- a/src/WOKStep/WOKStep_WNTK.cxx +++ b/src/WOKStep/WOKStep_WNTK.cxx @@ -99,7 +99,9 @@ void WOKStep_WNTK::Execute(const Handle(WOKMake_HSequenceOfInputFile)& anExecLis Handle(TColStd_HSequenceOfHAsciiString) unitSeq = aFile.Read(); - Unit()->Params().Set("%DebugMode",(char*)(Unit()->Session()->DebugMode() ? "True" : "False")); +//HP Unit()->Params().Set("%DebugMode",Unit()->Session()->DebugMode() ? "True" : "False"); + const char *TrFa = Unit()->Session()->DebugMode() ? "True" : "False" ; + Unit()->Params().Set("%DebugMode",(char *) TrFa); Handle(WOKernel_File) stubFile = new WOKernel_File(new TCollection_HAsciiString("__stub.c"), Unit(), Unit()->GetFileType("object")); diff --git a/src/WOKStep/WOKStep_WNTLibrary.cxx b/src/WOKStep/WOKStep_WNTLibrary.cxx index 37c1604..20c0ddb 100755 --- a/src/WOKStep/WOKStep_WNTLibrary.cxx +++ b/src/WOKStep/WOKStep_WNTLibrary.cxx @@ -63,7 +63,11 @@ void WOKStep_WNTLibrary::Execute (const Handle(WOKMake_HSequenceOfInputFile)& an Handle(TCollection_HAsciiString) target = OutputDir()->Name(); - target->AssignCat(Unit()->Name()); + Handle( TCollection_HAsciiString ) uName = new TCollection_HAsciiString ( Unit () -> Name () ); + + uName -> ChangeAll ( '.', '_' ); + + target -> AssignCat ( uName ); Handle(WOKBuilder_WNTLibrarian) tool = Handle(WOKBuilder_WNTLibrarian)::DownCast(ComputeTool()); diff --git a/src/WOKStep/WOKStep_WNTLink.cxx b/src/WOKStep/WOKStep_WNTLink.cxx index 55dcfb4..23627b9 100755 --- a/src/WOKStep/WOKStep_WNTLink.cxx +++ b/src/WOKStep/WOKStep_WNTLink.cxx @@ -188,8 +188,14 @@ void WOKStep_WNTLink::Execute(const Handle(WOKMake_HSequenceOfInputFile)& Handle(WOKBuilder_WNTLinker) tool = Handle(WOKBuilder_WNTLinker)::DownCast(ComputeTool()); myTarget = new TCollection_HAsciiString(OutputDir()->Name()); - - myTarget->AssignCat(SubCode().IsNull() ? Unit()->Name() : SubCode()); + + Handle( TCollection_HAsciiString ) uName = new TCollection_HAsciiString ( + SubCode ().IsNull () ? Unit () -> Name () + : SubCode () + ); + uName -> ChangeAll ( '.', '_' ); + + myTarget -> AssignCat ( uName ); tool->SetTargetName(myTarget); -- 2.39.5