-
Notifications
You must be signed in to change notification settings - Fork 133
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* maintenance: interface builder integration
Main reason -- to be able to compile Stub in Xcode without errors. What was fixed: ## Cannot code sign because the target does not have an Info.plist file Info.plist is now generated and included into xcode project. ## Undefined symbols for architecture arm64: "_main" Stub `int main() {}` is now generated and included into xcode project. ## multiple `FrameworkName/FrameworkName.h` not found Error while compiling pre-compiled header file where all framework are being referenced. XCode doesn't seem to recognise single arch framework. Changes where done: - propagate XCFrameworks instead of its framework. - clang modules are enabled now; - not all frameworks have umbrella header with same name, e.g. `FrameworkName/FrameworkName.h`, logic added to look for Swift umbrellas as well. - if umbrella header is not found -- framework is not included into pre-compiled headers. To have manual control over the logic and to be able to add extra imports and filter out not required config was extended with following section: ```xml <config> <tools> <ibx> <pch> <include>MyFramework/MyFramework.h</include> <include import="true">MyModule</include> <filter exclude="true">*Promises*</filter> </pch> </ibx> </tools> </config> ``` `pch` section allow to include additional frameworks with `include` tags. if `import` attribute is specified -- `@import` will be used instead of `#import` (works for modules). `filter` tag allows to exclude from pre-compiled header files reference to not required framework. For example `FBLPromises` causes following error: > fatal error: module 'PromisesObjC' in AST file
- Loading branch information
Showing
12 changed files
with
279 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
96 changes: 96 additions & 0 deletions
96
compiler/compiler/src/main/java/org/robovm/compiler/config/tools/IBXOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
/* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.robovm.compiler.config.tools; | ||
|
||
import org.simpleframework.xml.*; | ||
|
||
import java.util.ArrayList; | ||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
/** | ||
* Settings to control Interface Builder/Xcode integration, appears in tools section of config: | ||
* <config> | ||
* <tools> | ||
* <ibx> | ||
* <include>MyFramework/MyFramework.h</> | ||
* <include import="true">MyModule</> | ||
* <filter exclude=true>FBLPromises</filter> | ||
* <ibx/> | ||
* </tools> | ||
* </config> | ||
* @author dkimitsa | ||
*/ | ||
public class IBXOptions { | ||
/** | ||
* pre-compiled headers file generation options | ||
*/ | ||
@Element(required = false) | ||
private PCHOptions pch; | ||
|
||
public PCHOptions getPrecompileHeadersOptions() { | ||
return pch; | ||
} | ||
|
||
public static class PCHOptions { | ||
@ElementList(required = false, entry = "include", inline = true) | ||
private ArrayList<IncludeEntry> includes; | ||
|
||
@ElementList(required = false, entry = "filter", inline = true) | ||
private ArrayList<FilterEntry> filters; | ||
|
||
public List<IncludeEntry> getIncludes() { | ||
return includes != null ? includes : Collections.emptyList(); | ||
} | ||
|
||
public List<FilterEntry> getFilters() { | ||
return filters != null ? filters : Collections.emptyList(); | ||
} | ||
} | ||
|
||
public static class IncludeEntry { | ||
@Text | ||
String includeText; | ||
|
||
@Attribute(name = "import", required = false) | ||
boolean isImport = false; | ||
|
||
/** | ||
* @return text to be included into `#include <includeText>` or `@import includeText;` | ||
*/ | ||
public String getIncludeText() { | ||
return includeText; | ||
} | ||
|
||
public boolean isImport() { | ||
return isImport; | ||
} | ||
} | ||
|
||
public static class FilterEntry { | ||
@Text | ||
String antPathPattern; | ||
|
||
@Attribute(name = "exclude", required = false) | ||
boolean exclude = false; | ||
|
||
public String getAntPathPattern() { | ||
return antPathPattern; | ||
} | ||
|
||
public boolean isExclude() { | ||
return exclude; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.