Duplicate characters (two projects in the workspace use the same code)

A- draft module. There are several test targets, and the corresponding reusable code is compiled into a separate (static library) target. Auses a third-party logger registration library. The Lumberjack code was simply removed to the project.

B- This is another module project, but otherwise it has the same properties as A.

C- the main project. It depends on Aand B. He links libraries Aand B.

Compilation Cwill result in duplicate Lumberjack characters.

How can I create several separate module projects to ...

  • they don’t know each other,
  • use the same third-party code,
  • can be compiled and tested independently,
  • included in the main project without duplicate questions?
+3
source share
7 answers

Since you focus on OSX, the solution to your problem is to create Lumberjack as a basis (as opposed to referencing the source code in your A and B modules), and then using this structure wherever it is needed (i.e. in any project using modules A or B).

Indeed, Lumberjack already includes a project that will build Lumberjack.framework, check it out: CocoaLumberjack/Xcode/LumberjackFramework/Desktop/Lumberjack.xcodeproj.

, A B , , Lumberjack. , A (, ), , lumberjack ( , OSX SDK).

- " ", , .

A B C, , Lumberjack C.

, : , . , , .

, cocoapods - (cocoapod - , , , , , cocoapods ). . .

, .

+1

, sergio , .

  • Lumberjack , Lumberjack .
  • ProjectA ModuleA DemoA. Lumberjack ProjectA, . ModuleA Lumberjack Link Lumberjack ModuleA. DemoA . , , Lumberjack.
  • ProjectB ProjectA.
  • ProjectA, ProjectB Lumberjack . , , Lumberjack 3 , (, , ).
  • , Lumberjack, ModuleA ModuleB . , .
+2

, , , : Objective-C?

, . , , , , : Objective-C

, - - , , , . - #import <myFramework/MFMyAliases.h>

+1

ar? , , ,

ar -t libA.a

,

__.SYMDEF SORTED
Afile1.o
Afile2.o
Lumberjack1.o
Lumberjack2.o
Afile3.o
SomeOtherLibrary.o

Lumberjack .

a -d Lumberjack1.o Lumberjack2.o

C A.

+1

" , iPhone: " , . , , .

+1

A B ?

, *.m , .

Also, if you could use Aand Bcomprehensive Cocoapods , it would be better.

0
source

Try this .

It shares libraries / modules between different projects.

0
source

All Articles