2700 (self projectTypeIsLibrary or:[self hasStartupClassSelected]) ifFalse:[ |
2700 (self projectTypeIsLibrary or:[self hasStartupClassSelected]) ifFalse:[ |
2701 self infoHolder value:'Must be either library or have a startup class'. |
2701 self infoHolder value:'Must be either library or have a startup class'. |
2702 ^ false |
2702 ^ false |
2703 ]. |
2703 ]. |
2704 prj := self selectedProjectDefinition. |
2704 prj := self selectedProjectDefinition. |
2705 ([prj startupClassName] on:Error do:nil) notNil ifFalse:[ |
2705 prj isLibraryDefinition ifFalse:[ |
2706 self infoHolder value:'Must have a startup class'. |
2706 ([prj startupClassName] on:Error do:nil) notNil ifFalse:[ |
2707 ^ false |
2707 self infoHolder value:'Must have a startup class'. |
2708 ]. |
|
2709 ([prj startupSelector] on:Error do:nil) notNil ifFalse:[ |
|
2710 self infoHolder value:'Must have a startup selector'. |
|
2711 ^ false |
|
2712 ]. |
|
2713 (prj class compiledMethodAt:#startupSelector) isNil ifTrue:[ |
|
2714 self infoHolder value:('Inherited startup selector is "%1"' bindWith:prj startupSelector). |
|
2715 impl := prj class whichClassImplements:#startupSelector. |
|
2716 impl isNil ifTrue:[ |
|
2717 self infoHolder value:('Inherited startup selector (%1) not implemented in %2' |
|
2718 bindWith:prj startupSelector |
|
2719 with:prj class name). |
|
2720 ^ false |
2708 ^ false |
2721 ]. |
2709 ]. |
2722 ]. |
2710 ([prj startupSelector] on:Error do:nil) notNil ifFalse:[ |
2723 (mthd := prj class compiledMethodAt:#startupClassName) package == prj package ifFalse:[ |
2711 self infoHolder value:'Must have a startup selector'. |
2724 mthd package == PackageId noProjectID ifFalse:[ |
|
2725 self infoHolder value:('Startup class method (#startupClassName) of %3 must be in package "%1" (is in "%2")' |
|
2726 bindWith:prj package |
|
2727 with:(prj class compiledMethodAt:#startupClassName) package |
|
2728 with:prj class name). |
|
2729 ^ false |
2712 ^ false |
2730 ]. |
2713 ]. |
2731 ]. |
2714 (prj class compiledMethodAt:#startupSelector) isNil ifTrue:[ |
2732 (mthd := prj class compiledMethodAt:#startupSelector) notNil ifTrue:[ |
2715 self infoHolder value:('Inherited startup selector is "%1"' bindWith:prj startupSelector). |
2733 mthd package == prj package ifFalse:[ |
2716 impl := prj class whichClassImplements:#startupSelector. |
|
2717 impl isNil ifTrue:[ |
|
2718 self infoHolder value:('Inherited startup selector (%1) not implemented in %2' |
|
2719 bindWith:prj startupSelector |
|
2720 with:prj class name). |
|
2721 ^ false |
|
2722 ]. |
|
2723 ]. |
|
2724 (mthd := prj class compiledMethodAt:#startupClassName) package == prj package ifFalse:[ |
2734 mthd package == PackageId noProjectID ifFalse:[ |
2725 mthd package == PackageId noProjectID ifFalse:[ |
2735 self infoHolder value:('Startup class method (#startupSelector) of %3 must be in package "%1" (is in "%2")' |
2726 self infoHolder value:('Startup class method (#startupClassName) of %3 must be in package "%1" (is in "%2")' |
2736 bindWith:prj package |
2727 bindWith:prj package |
2737 with:mthd package |
2728 with:(prj class compiledMethodAt:#startupClassName) package |
2738 with:prj class name). |
2729 with:prj class name). |
2739 ^ false |
2730 ^ false |
2740 ] |
2731 ]. |
2741 ]. |
2732 ]. |
2742 ]. |
2733 (mthd := prj class compiledMethodAt:#startupSelector) notNil ifTrue:[ |
2743 cls := Smalltalk classNamed:prj startupClassName. |
2734 mthd package == prj package ifFalse:[ |
2744 cls isNil ifTrue:[ |
2735 mthd package == PackageId noProjectID ifFalse:[ |
2745 self infoHolder value:('Startup class "%1" does not exist' bindWith:prj startupClassName). |
2736 self infoHolder value:('Startup class method (#startupSelector) of %3 must be in package "%1" (is in "%2")' |
2746 ^ false. |
2737 bindWith:prj package |
2747 ]. |
2738 with:mthd package |
2748 (cls implements:(prj startupSelector)) ifFalse:[ |
2739 with:prj class name). |
2749 (cls respondsTo:(prj startupSelector)) ifFalse:[ |
2740 ^ false |
2750 self infoHolder value:('Startup class "%1" does not implement startup selector "%2"' |
2741 ] |
2751 bindWith:cls name |
2742 ]. |
2752 with:prj startupSelector). |
2743 ]. |
2753 ^ false |
2744 cls := Smalltalk classNamed:prj startupClassName. |
|
2745 cls isNil ifTrue:[ |
|
2746 self infoHolder value:('Startup class "%1" does not exist' bindWith:prj startupClassName). |
|
2747 ^ false. |
|
2748 ]. |
|
2749 (cls implements:(prj startupSelector)) ifFalse:[ |
|
2750 (cls respondsTo:(prj startupSelector)) ifFalse:[ |
|
2751 self infoHolder value:('Startup class "%1" does not implement startup selector "%2"' |
|
2752 bindWith:cls name |
|
2753 with:prj startupSelector). |
|
2754 ^ false |
|
2755 ]. |
2754 ]. |
2756 ]. |
2755 ]. |
2757 ]. |
2756 self infoHolder value:nil. |
2758 self infoHolder value:nil. |
2757 ^ true. |
2759 ^ true. |
2758 |
2760 |