Adding libToffee as a remote project reference

Hi,
I added libToffee as a remote project reference

LastConsoleApplication 2.zip (641.3 KB)

and when I build I get
Project ‘libToffee-macOS’ built successfully.
E: Fatal Error: “Toffee-OS X” is not valid XmlElement name
D: | at RemObjects.Elements.RTL.XmlElement.SetLocalName (System.String aValue) [0x0005e] in :0
D: | at RemObjects.Elements.RTL.XmlElement.set_LocalName (System.String value) [0x0000e] in :0
D: | at RemObjects.Elements.RTL.XmlElement.AddElement (System.String aName, RemObjects.Elements.RTL.XmlNamespace aNamespace, System.String aValue) [0x0002b] in :0
D: | at RemObjects.EBuild.EBuildProject.ToXml () [0x001c2] in <4e073e7a31c0412799a88eefe7638fb8>:0
D: | at RemObjects.EBuild.EBuildProject.SaveResolvedProject (System.String aFilename) [0x0000e] in <4e073e7a31c0412799a88eefe7638fb8>:0
D: | at RemObjects.EBuild.BuildSolution+<>c__DisplayClass1.b__0 (RemObjects.EBuild.EBuildProject p, System.Nullable`1[T] i, System.Boolean lIsParallel) [0x0039c] in <4e073e7a31c0412799a88eefe7638fb8>:0

Cheers,
John

Known bug in 2519 and already fixed; the workaround is rtf change the SubMode/SDK from the legacy “OS X” to “macOS”. I’ll do that for libToffee now…

Side note, I recommend referencing libToffee.elements instead of libToffee-macOS.elements, as I’m moving libTopffee towards the single multi-target project, and will eventually drop the single-target ones…

Ok thanks. I wanted to test the fix to last and it occurred to me I could use a remote reference, its the first time Ive done that for libToffee

As a side Q, what’s the goal with linking this as a remote project ref from our repo, when the local binary we ship is usually zip top date and we dont changes this much? or are you using local fork?

And while I type this…

ah yes, that makes sense ;).

“macOS” fix is pushed.

BTW, this was one of like 387 regressions/side effects of the simple change I made to handle <Mode>Island vs <Import Toffee.targets. Its been worth if, because its much cleaner now, but you would not believe how long that innocent change has kept me busy last week (including almost failing the build, coz Fire failed with the same error — but then I figured, “f**k that, I’ll just fix Fire.elements locally and not worry about shipping that regression this week” and fixed its post :wink:

For my own projects I have all references as remote. The 2 things I dont are things that ones that ship in the Zip and shared projects. I did wonder what the experience would be like if everything was a remote reference. Its nice being able to have the source locally and be able to debug. Its also easier to push a fix to the remote repo and everything is updated when I build.
For the shared projects I have multiple of the same repo in several folders and I forget to sync everything.

Does this look ok ?
LastConsoleApplication 3.zip (640.2 KB)
It seems to still be referencing the old version, even though

Package project ‘github.com/remobjects/libToffee/Source/libToffee-macOS.elements:*’ referenced from ‘LastConsoleApplication’, at ‘/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Packages/EBuild/github.com.remobjects.libToffee/Source/libToffee-macOS.elements’.

Has your changes.

Compiles fine for me (but of course my Ebuild has the actual fix). You’re still getting the same error? Did you try a rebuild, to force a pull?

Sorry I meant when you run it.

Yeah, strange. SO’s for me too, but on the line that is fixed…

Oh, I know why. because LD is stupid :wink:

LD takes set of names to link AND a set of folders. separate. it looks for the library by name, in all the folders. So it still links the libToffee.a we deploy because it finds in the folder that is passed because libElements is in it. Only fix is to delete that copy of libToffee.a manually.

Happens to me all the time as well, with libElements.a itself ;), when I work in Fire and need a custom local libElements build…

1 Like

I didnt know about multi target projects. I saw what you did with libToffee so Im converting my shared projects to be multi target libraries. That way I can have a remote reference in every project and one repo on my computer instead of one repo per project using the shared library.

Yeah, they are very lightly documented for now, because the IDE support really isn’t there yet (Fire/Water can handle them, but don’t let you create new targets or configure the individual targets yet; VS doesn’t handle them at all yet).

It’s on my list to change that, and the rect refactoring for Fire/Water and VS to all sue the same shared “Common project System” is a first step in that direction, so hopefully I’ll find time to do the actual UI work sometime soon, now.

Cool. let me know of you have any Qs not answers by the docs topic above yet, or have any other suggestions or feedback (aside from “let me do this in the IDE”, which, yeah ;).

I have a static library building for Nougat - watchos, macos and ios and then Island Linux

My references look like this

  <ItemGroup>

     <Reference Include="CoreGraphics">
      <Target>iOS</Target>
    </Reference>
    <Reference Include="CoreGraphics">
      <Target>macOS</Target>
    </Reference>
    <Reference Include="CoreGraphics">
      <Target>watchOS</Target>
    </Reference>

     <Reference Include="Foundation">
      <Target>iOS</Target>
    </Reference>
    <Reference Include="Foundation">
      <Target>macOS</Target>
    </Reference>
    <Reference Include="Foundation">
      <Target>watchOS</Target>
    </Reference>
   
   <Reference Include="libToffee">
      <Target>iOS</Target>
    </Reference>
    <Reference Include="libToffee">
      <Target>macOS</Target>
    </Reference>
    <Reference Include="libToffee">
      <Target>watchOS</Target>
    </Reference>

    <Reference Include="rtl" />
    <Reference Include="libElements" />

    <Reference Include="SystemConfiguration">
      <Target>iOS</Target>
    </Reference>
    <Reference Include="SystemConfiguration">
      <Target>macOS</Target>
    </Reference>
  </ItemGroup>

There are some references that are applicable to Nougat all platforms and others common to everything. Then some just for one platform and Target.

Is there a better way of organizing this or would it be possible to specify Target at the ItemGroup level ?

not at this stage, but something I can look at.

pro tip: <Reference Include="#"> gives yo all the “standard” references for each platform.

Thanks, logged as bugs://84516

Actually, looks like this is already supported, at least in EBuild; you can have the same kind of Condition tag on an ItemGroup as on a PropertyGroup. Not sure what the IDE will make of that though, there’s a chance it’ll f’ them up on saves it doesnt know about the Condition, and it does try to merge items into three specific ghroiups, for references, folders and the rest. SO I’ll look at improving that as part of the above issue.

1 Like

It builds with that change. When do you plan adding proper Fire support for this and remote project references ?
These days I also have the elements file open in a text editor because I’ve made heavy use of remoteproject references and now this.

Remote Project References, work, except for adding them, right? As in, the IDE preservers them ok?

As for target groups: I’m just about done with the code changes to let the IDEs preserve them; in fact I;'m thinking of auto-cleaning projects to use them, when saved from the IDE; here’s what RTL2 would looks afterwards: (this is post .2525)

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build" ToolsVersion="4.0">
  <PropertyGroup>
    <ProductVersion>3.5</ProductVersion>
    <RootNamespace>RemObjects.Elements.RTL</RootNamespace>
    <ProjectGuid>{6F89F939-4116-4B8B-B0A8-71E6F56ED4BD}</ProjectGuid>
    <BinaryName>Elements</BinaryName>
    <AllowGlobals>False</AllowGlobals>
    <AllowLegacyWith>False</AllowLegacyWith>
    <AllowLegacyOutParams>False</AllowLegacyOutParams>
    <AllowLegacyCreate>False</AllowLegacyCreate>
    <AllowUnsafeCode>False</AllowUnsafeCode>
    <Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
    <Platform Condition="'$(Platform)' == ''">AnyCPU</Platform>
    <CrossPlatform>True</CrossPlatform>
    <MangleTypeNames>True</MangleTypeNames>
    <GenerateDebugInfo>True</GenerateDebugInfo>
    <GeneratePDB>True</GeneratePDB>
    <GenerateMDB>True</GenerateMDB>
    <OutputPathUsesModes>True</OutputPathUsesModes>
    <OutputPathUsesSubModes>True</OutputPathUsesSubModes>
    <OutputType>StaticLibrary</OutputType>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Target)' == 'Echoes.Full' ">
    <Mode>Echoes</Mode>
    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
    <DefaultUses>System.Linq;System.Net;System.Xml.Linq</DefaultUses>
    <OutputType>Library</OutputType>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Target)' == 'Echoes.Standard' ">
    <Mode>Echoes</Mode>
    <TargetFramework>.NETStandard2.0</TargetFramework>
    <DefaultUses>System.Linq;System.Net;System.Xml.Linq</DefaultUses>
    <ConditionalDefines>NETSTANDARD</ConditionalDefines>
    <OutputType>Library</OutputType>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Target)' == 'Cooper' ">
    <Mode>Cooper</Mode>
    <SubMode>Java</SubMode>
    <DefaultUses>com.remobjects.elements.linq</DefaultUses>
    <BinaryName>elements</BinaryName>
    <OutputType>Library</OutputType>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Target)' == 'Island.Windows' ">
    <Mode>Island</Mode>
    <SubMode>Windows</SubMode>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Target)' == 'Island.Linux' ">
    <Mode>Island</Mode>
    <SubMode>Linux</SubMode>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Target)' == 'Island.Darwin.macOS' ">
    <Mode>Island</Mode>
    <SubMode>Darwin</SubMode>
    <SDK>macOS</SDK>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Target)' == 'Island.Darwin.iOS' ">
    <Mode>Island</Mode>
    <SubMode>Darwin</SubMode>
    <SDK>iOS</SDK>
    <SupportUIKitForMac>True</SupportUIKitForMac>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Target)' == 'Island.Darwin.tvOS' ">
    <Mode>Island</Mode>
    <SubMode>Darwin</SubMode>
    <SDK>tvOS</SDK>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Target)' == 'Island.Darwin.watchOS' ">
    <Mode>Island</Mode>
    <SubMode>Darwin</SubMode>
    <SDK>watchOS</SDK>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Target)' == 'Island.Android' ">
    <Mode>Island</Mode>
    <SubMode>Android</SubMode>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Target)' == 'Toffee.iOS' ">
    <Mode>Toffee</Mode>
    <SDK>iOS</SDK>
    <SupportUIKitForMac>True</SupportUIKitForMac>
    <DefaultUses>Foundation;RemObjects.Elements.Linq</DefaultUses>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Target)' == 'Toffee.macOS' ">
    <Mode>Toffee</Mode>
    <SDK>macOS</SDK>
    <DefaultUses>Foundation;RemObjects.Elements.Linq</DefaultUses>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Target)' == 'ToffeeV2.macOS' ">
    <Mode>Toffee</Mode>
    <SDK>macOS</SDK>
    <DefaultUses>Foundation;RemObjects.Elements.Linq</DefaultUses>
    <UseLegacyToffeeMode>False</UseLegacyToffeeMode>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Target)' == 'Toffee.tvOS' ">
    <Mode>Toffee</Mode>
    <SDK>tvOS</SDK>
    <DefaultUses>Foundation;RemObjects.Elements.Linq</DefaultUses>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Target)' == 'Toffee.watchOS' ">
    <Mode>Toffee</Mode>
    <SDK>watchOS</SDK>
    <DefaultUses>Foundation;RemObjects.Elements.Linq</DefaultUses>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
    <Optimize>false</Optimize>
    <OutputPath>.\bin\Debug</OutputPath>
    <DefineConstants>DEBUG;TRACE;</DefineConstants>
    <EnableAsserts>True</EnableAsserts>
    <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
    <CaptureConsoleOutput>False</CaptureConsoleOutput>
    <StartMode>Project</StartMode>
    <RegisterForComInterop>False</RegisterForComInterop>
    <CpuType>anycpu</CpuType>
    <RuntimeVersion>v25</RuntimeVersion>
    <XmlDoc>False</XmlDoc>
    <XmlDocWarningLevel>WarningOnPublicMembers</XmlDocWarningLevel>
    <EnableUnmanagedDebugging>False</EnableUnmanagedDebugging>
    <WarnOnCaseMismatch>True</WarnOnCaseMismatch>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Configuration)' == 'Release'">
    <Optimize>true</Optimize>
    <OutputPath>.\bin\Release</OutputPath>
    <GeneratePDB>False</GeneratePDB>
    <GenerateMDB>False</GenerateMDB>
    <EnableAsserts>False</EnableAsserts>
    <TreatWarningsAsErrors>False</TreatWarningsAsErrors>
    <CaptureConsoleOutput>False</CaptureConsoleOutput>
    <StartMode>Project</StartMode>
    <RegisterForComInterop>False</RegisterForComInterop>
    <XmlDoc>False</XmlDoc>
    <XmlDocWarningLevel>WarningOnPublicMembers</XmlDocWarningLevel>
    <EnableUnmanagedDebugging>False</EnableUnmanagedDebugging>
    <WarnOnCaseMismatch>True</WarnOnCaseMismatch>
  </PropertyGroup>
  <ItemGroup></ItemGroup>
  <ItemGroup></ItemGroup>
  <ItemGroup Condition="'$(Target)' == 'Cooper'">
    <Compile Include="Cooper\EnumerationSequence.pas"></Compile>
    <Compile Include="Cooper\LocaleUtils.pas"></Compile>
    <Reference Include="rt"></Reference>
    <Reference Include="cooper">
      <Private>True</Private>
    </Reference>
  </ItemGroup>
  <ItemGroup Condition="'$(Target)' == 'Echoes'">
    <Compile Include="Properties\AssemblyInfo.pas"></Compile>
    <EmbeddedResource Include="Properties\Resources.resx">
      <Generator>ResXFileCodeGenerator</Generator>
    </EmbeddedResource>
    <Compile Include="Properties\Resources.Designer.pas"></Compile>
    <None Include="Properties\Settings.settings">
      <Generator>SettingsSingleFileGenerator</Generator>
    </None>
    <Compile Include="Properties\Settings.Designer.pas"></Compile>
  </ItemGroup>
  <ItemGroup Condition="'$(Target)' == 'Echoes.Full'">
    <Reference Include="mscorlib"></Reference>
    <Reference Include="System"></Reference>
    <Reference Include="System.Core"></Reference>
    <Reference Include="System.Xml.Linq"></Reference>
    <Reference Include="System.Web"></Reference>
  </ItemGroup>
  <ItemGroup Condition="'$(Target)' == 'Echoes.Standard'">
    <NuGetReference Include="NETStandard.Library:2.0.0"></NuGetReference>
  </ItemGroup>
  <ItemGroup Condition="'$(Target)' == 'Toffee.iOS'">
    <Reference Include="Foundation"></Reference>
    <Reference Include="CoreFoundation"></Reference>
    <Reference Include="UIKit"></Reference>
    <Reference Include="libToffee"></Reference>
    <Reference Include="rtl"></Reference>
  </ItemGroup>
  <ItemGroup Condition="'$(Target)' == 'Toffee.macOS'">
    <Reference Include="Foundation"></Reference>
    <Reference Include="AppKit"></Reference>
    <Reference Include="CoreFoundation"></Reference>
    <Reference Include="libToffee"></Reference>
    <Reference Include="rtl"></Reference>
  </ItemGroup>
  <ItemGroup Condition="'$(Target)' == 'Toffee.tvOS'">
    <Reference Include="Foundation"></Reference>
    <Reference Include="CoreFoundation"></Reference>
    <Reference Include="UIKit"></Reference>
    <Reference Include="libToffee"></Reference>
    <Reference Include="rtl"></Reference>
  </ItemGroup>
  <ItemGroup Condition="'$(Target)' == 'Toffee.watchOS'">
    <Reference Include="Foundation"></Reference>
    <Reference Include="CoreFoundation"></Reference>
    <Reference Include="UIKit"></Reference>
    <Reference Include="WatchKit"></Reference>
    <Reference Include="libToffee"></Reference>
    <Reference Include="rtl"></Reference>
  </ItemGroup>
  <ItemGroup Condition="'$(Target)' == 'Island.Windows'">
    <Reference Include="rtl"></Reference>
    <Reference Include="gc"></Reference>
    <Reference Include="Island"></Reference>
  </ItemGroup>
  <ItemGroup Condition="'$(Target)' == 'Island.Linux'">
    <Reference Include="rtl"></Reference>
    <Reference Include="gc"></Reference>
    <Reference Include="Island"></Reference>
  </ItemGroup>
  <ItemGroup Condition="'$(Target)' == 'Island.Darwin.macOS'">
    <Reference Include="Island"></Reference>
    <Reference Include="rtl"></Reference>
    <Reference Include="gc"></Reference>
  </ItemGroup>
  <ItemGroup Condition="'$(Target)' == 'ToffeeV2.macOS'">
    <Reference Include="Foundation"></Reference>
    <Reference Include="CoreFoundation"></Reference>
    <Reference Include="AppKit"></Reference>
    <Reference Include="Island"></Reference>
    <Reference Include="rtl"></Reference>
    <Reference Include="gc"></Reference>
  </ItemGroup>
  <ItemGroup Condition="'$(Target)' == 'Island.Darwin.iOS'">
    <Reference Include="Island"></Reference>
    <Reference Include="rtl"></Reference>
    <Reference Include="gc"></Reference>
  </ItemGroup>
  <ItemGroup Condition="'$(Target)' == 'Island.Darwin.tvOS'">
    <Reference Include="Island"></Reference>
    <Reference Include="rtl"></Reference>
    <Reference Include="gc"></Reference>
  </ItemGroup>
  <ItemGroup Condition="'$(Target)' == 'Island.Darwin.watchOS'">
    <Reference Include="Island"></Reference>
    <Reference Include="rtl"></Reference>
    <Reference Include="gc"></Reference>
  </ItemGroup>
  <ItemGroup Condition="'$(Target)' == 'Island.Android'">
    <Reference Include="rtl"></Reference>
    <Reference Include="gc"></Reference>
    <Reference Include="Island"></Reference>
  </ItemGroup>
  <Import Project="$(MSBuildExtensionsPath)\RemObjects Software\Elements\RemObjects.Elements.targets" />
  <Import Project="Elements.RTL.Shared.projitems" Label="Shared" />
</Project>

As for exposing all the capabilities of administering targets in the IDE ‚ it’s on my list, and the new Common project System refactoring added recently was a big step towards enabling it, but its a good chunk of work and I cant say yet when I’ll get around to that…