【问题标题】:git include compiled dll from another repositorygit包括从另一个存储库编译的dll
【发布时间】:2015-07-20 09:40:19
【问题描述】:

关于这个问题,我已经阅读了几个小时,但没有成功。
这是我的情况:

项目 A 的输出是一个已编译的 dll 文件,可用于其他项目
多人在做项目 A
项目 A 有自己的存储库,我们将其命名为 repoA
我不能在其他项目中包含该项目的源代码,我只能使用它编译的 dll。

项目 B 是 repoB 中的一个 Web 应用程序
多人在 B 项目上工作

所有项目都在同一台机器上(本地服务器)

那么,我怎样才能将 repoA 中的 dll 包含到所有其他项目(repoB ... repoZ)中,并在更新 repoA 时使其保持最新。

我正在使用 VS2013 和 msysGit

【问题讨论】:

    标签: git dll visual-studio-2013


    【解决方案1】:

    最好管理二进制依赖项:

    • 在不同的引用中 (different from a source control referential):最好使用像 Nexus 这样的人工引用
    • pom.xml 文件(包含在其他项目中)中,以声明您需要的依赖项(这样,每次在其他项目中开始构建时,您都会从 Nexus 获得所述依赖项)

    见“The Basics - Components, Repositories and Repository Formats”。

    我将这种方法用于各种项目(不仅仅是 Java maven 项目)

    ant -f %BUILD_SCRIPTS_DIRECTORY%\build.xml -lib Build\antlib dependencies
    

    build.xml 喜欢:

    <project name="aname" default="help" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
    
        <taskdef resource="net/sf/antcontrib/antlib.xml"/>
    
        <target name="dependencies" description="resolve dependencies" unless="run.test">
            <artifact:pom id="pom" file="pom.xml" />
            <artifact:dependencies filesetId="dep.builder" pomRefId="pom"/>
            <delete dir="${pom.build.directory}"/>
            <unzip dest="${pom.build.directory}" overwrite="true"> 
                <fileset refid="dep.builder"/>
            </unzip>            
        </target>
    
    </project>
    

    还有一个 pom.xml 声明依赖项,例如:

    <dependencies>
        <dependency>        
            <groupId>com.oracle.www</groupId>
            <artifactId>oci</artifactId>
            <version>10</version>
            <type>zip</type>
            <classifier>${targetplatform}</classifier>
        </dependency>
        <dependency>                
            <groupId>com.sophis.www</groupId>
            <artifactId>stlport</artifactId>
            <version>5.1</version>
            <type>zip</type>
            <classifier>${targetplatform}</classifier>
        </dependency>
        ...
    </dependencies>
    

    【讨论】:

      猜你喜欢
      • 2020-10-25
      • 2016-07-14
      • 2011-11-22
      • 2015-09-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-10-30
      • 2023-04-06
      相关资源
      最近更新 更多