-
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
+
}
// Created: Mon Mar 22 17:10:16 1999
// Author: Arnaud BOUZY
// <adn>
-
-#include <Standard_NotImplemented.hxx>
+// Modification: Eugeny PLOTNIKOV <e-plotnikov@minsk.matra-dtv.fr> (ClassFile.cfg generation)
#include <Standard_ProgramError.hxx>
#include <WOKUtils_Path.hxx>
#include <MS.hxx>
+#include <MS_Client.hxx>
+#include <MS_Interface.hxx>
+#include <MS_Package.hxx>
#include <WOKBuilder_MSJiniExtractor.hxx>
#include <WOKBuilder_MSActionID.hxx>
#include <WOKStep_JiniExtract.ixx>
+#include <OSD_File.hxx>
+#include <OSD_Protection.hxx>
+#include <OSD_Environment.hxx>
//=======================================================================
//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
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))
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