Creating Cocoa Framework using Elements

How to create a .framework packages with Elements (C# or Oxygene)?

Thanks

Currently, you can only create static libraries.

Thanks Marc,
I am trying to build a Framework bundled with resources (xib files) to be used in a plugin-like library, I still can build a static Mac OS X library and wrap it in a bundled framework manually (I will copy what Xcode generates and just replace the static library ;)). Appreciate it.
Nader

1 Like

Fwiw, we are looking at full framework support (consuming and building) for a future update. No exact timeline i can promise though.

Hello Marc,

I am checking back on this, for your kind feedback.

Regards

Nader,

we support importing frameworks, bit not building them (you can build static or dynamic ic libraries and a matching .h file though, which should give you pretty much the same capabilities in terms of using the library you create from Xcode.

—marc

Thank you Marc,

Building it manually is what I have been doing so far (as per this case history), having it manually done though is error prone and time consuming. I would add this to my wish list :slightly_smiling_face:

Much appreciated your prompt response :+1:

I’ll see what I can do.

1 Like

Thanks, logged as bugs://82714

1 Like

I’d like to send you a new build in about an hour that should have this implemented (pending more testing). what’s your account name on remobjects.com?

1 Like

Thanks,

Emailed it to you,

Regards,
Nader

1 Like

New build is up. you’ll wanna create a Dynamic Library project ad (manually in textedit) add True as project setting.

Is this working ok for you?

Thank you Marc,

I am running the latest build now, but couldn’t get what I should do to test the feature

Much appreciated

If you create/have a Dynamic library project (output type “Library”), you should see a. new option “CreateFrameworkBundle”. setting that too true will make the build package up the framework.

Which section of settings should that be in ?

Hmm, seems that change to the Settings config got lost somehow:(. You’ll have to manually add the setting for now, <CreateFrameworkBundle>True</CreateFrameworkBundle>.

I get this when I build

E: Could not find a part of the path ‘/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/DynamicLibrary-2C9315C161EF13EDD07C41FD22DF58160748C7A4/Debug/Toffee-iOS/Device/DynamicLibrary.framework’.
D: | at System.IO.Error.WinIOError (System.Int32 errorCode, System.String maybeFullPath) [0x000f7] in :0 .
D: | at System.IO.FileSystemEnumerableIterator1[TSource].HandleError (System.Int32 hr, System.String path) [0x00006] in <b4d1a66727f44ba888b54966284fabb4>:0 . D: | at System.IO.FileSystemEnumerableIterator1[TSource].CommonInit () [0x00054] in :0 .
D: | at System.IO.FileSystemEnumerableIterator1[TSource]..ctor (System.String path, System.String originalUserPath, System.String searchPattern, System.IO.SearchOption searchOption, System.IO.SearchResultHandler1[TSource] resultHandler, System.Boolean checkHost) [0x000d6] in :0 .
D: | at System.IO.FileSystemEnumerableFactory.CreateFileNameIterator (System.String path, System.String originalUserPath, System.String searchPattern, System.Boolean includeFiles, System.Boolean includeDirs, System.IO.SearchOption searchOption, System.Boolean checkHost) [0x00009] in :0 .
D: | at System.IO.Directory.InternalGetFileDirectoryNames (System.String path, System.String userPathOriginal, System.String searchPattern, System.Boolean includeFiles, System.Boolean includeDirs, System.IO.SearchOption searchOption, System.Boolean checkHost) [0x00000] in :0 .
D: | at System.IO.Directory.InternalGetDirectories (System.String path, System.String searchPattern, System.IO.SearchOption searchOption) [0x00000] in :0 .
D: | at System.IO.Directory.GetDirectories (System.String path) [0x0000e] in :0 .
D: | at System.IO.Directory.RecursiveDelete (System.String path) [0x00000] in :0 .
D: | at System.IO.Directory.Delete (System.String path, System.Boolean recursive) [0x00009] in :0 .
D: | at RemObjects.Elements.RTL.Folder.Delete
$mapped (System.String self) [0x00000] in :0 .
D: | at RemObjects.Elements.RTL.Folder.Delete (System.String aFolderName) [0x00000] in :0 .
D: | at RemObjects.EBuild.Elements.ElementsDarwinCreateFrameworkBundle.Execute () [0x00096] in :0 .
D: | at RemObjects.EBuild.EBuildContext.RunTask________forTarget (RemObjects.EBuild.EBuildTask+MetaClass aTask, RemObjects.EBuild.EBuildValues aSettings, RemObjects.EBuild.EBuildObjects aObjects, RemObjects.EBuild.EBuildTarget aTarget) [0x0037c] in <4416c40b4c254882bd2e606906411ee8>:0 .
<- Task CreateFrameworkBundle failed with exception Could not find a part of the path ‘/Users/JohnMoshakis/Library/Application Support/RemObjects Software/EBuild/Obj/DynamicLibrary-2C9315C161EF13EDD07C41FD22DF58160748C7A4/Debug/Toffee-iOS/Device/DynamicLibrary.framework’. for DynamicLibrary, Toffee-iOS, took 0.0000s (0.0264s).
D: | at System.IO.Error.WinIOError (System.Int32 errorCode, System.String maybeFullPath) [0x000f7] in :0
D: | at System.IO.FileSystemEnumerableIterator1[TSource].HandleError (System.Int32 hr, System.String path) [0x00006] in <b4d1a66727f44ba888b54966284fabb4>:0 D: | at System.IO.FileSystemEnumerableIterator1[TSource].CommonInit () [0x00054] in :0
D: | at System.IO.FileSystemEnumerableIterator1[TSource]..ctor (System.String path, System.String originalUserPath, System.String searchPattern, System.IO.SearchOption searchOption, System.IO.SearchResultHandler1[TSource] resultHandler, System.Boolean checkHost) [0x000d6] in :0
D: | at System.IO.FileSystemEnumerableFactory.CreateFileNameIterator (System.String path, System.String originalUserPath, System.String searchPattern, System.Boolean includeFiles, System.Boolean includeDirs, System.IO.SearchOption searchOption, System.Boolean checkHost) [0x00009] in :0
D: | at System.IO.Directory.InternalGetFileDirectoryNames (System.String path, System.String userPathOriginal, System.String searchPattern, System.Boolean includeFiles, System.Boolean includeDirs, System.IO.SearchOption searchOption, System.Boolean checkHost) [0x00000] in :0
D: | at System.IO.Directory.InternalGetDirectories (System.String path, System.String searchPattern, System.IO.SearchOption searchOption) [0x00000] in :0
D: | at System.IO.Directory.GetDirectories (System.String path) [0x0000e] in :0
D: | at System.IO.Directory.RecursiveDelete (System.String path) [0x00000] in :0
D: | at System.IO.Directory.Delete (System.String path, System.Boolean recursive) [0x00009] in :0
D: | at RemObjects.Elements.RTL.Folder.Delete
$mapped (System.String self) [0x00000] in :0
D: | at RemObjects.Elements.RTL.Folder.Delete (System.String aFolderName) [0x00000] in :0
D: | at RemObjects.EBuild.Elements.ElementsDarwinCreateFrameworkBundle.Execute () [0x00096] in :0
D: | at RemObjects.EBuild.EBuildContext.RunTask________forTarget (RemObjects.EBuild.EBuildTask+MetaClass aTask, RemObjects.EBuild.EBuildValues aSettings, RemObjects.EBuild.EBuildObjects aObjects, RemObjects.EBuild.EBuildTarget aTarget) [0x0037c] in <4416c40b4c254882bd2e606906411ee8>:0
<- Task RemObjects.EBuild.Elements.ElementsDetermineFinalOutput failed for DynamicLibrary, took 0.0491s (0.3301s).

Is this correct ?

<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
  <PropertyGroup>
    <RootNamespace>DynamicLibrary</RootNamespace>
    <ProjectGuid>{EAD0030D-A36D-49ED-A393-D9C7EA53ED62}</ProjectGuid>
    <OutputType>Library</OutputType>
    <AssemblyName>DynamicLibrary</AssemblyName>
    <Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
    <SDK>iOS</SDK>
    <MangleTypeNames>True</MangleTypeNames>
    <CreateHeaderFile>True</CreateHeaderFile>
    <CreateFrameworkBundle>True</CreateFrameworkBundle>    
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
    <Optimize>False</Optimize>
    <OutputPath>.\Bin\Debug</OutputPath>
    <DefineConstants>DEBUG;TRACE;</DefineConstants>
    <GenerateDebugInfo>True</GenerateDebugInfo>
    <EnableAsserts>True</EnableAsserts>
  </PropertyGroup>
  <PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
    <OutputPath>.\Bin\Release</OutputPath>
    <GenerateDSym>True</GenerateDSym>
  </PropertyGroup>
  <ItemGroup>
    <Reference Include="CoreGraphics" />
    <Reference Include="Foundation" />
    <Reference Include="UIKit" />
    <Reference Include="rtl" />
    <Reference Include="libToffee" />
  </ItemGroup>
  <ItemGroup>
    <Compile Include="Library.pas" />
  </ItemGroup>
  <Import Project="$(MSBuildExtensionsPath)\RemObjects Software\Elements\RemObjects.Elements.Toffee.targets" />
</Project>

Can I get a full test case? Is this on Mac?

DynamicLibrary.zip (8.5 KB)

Yes. I created it using Fire and then edited the elements file.