'Tycho'에 해당되는 글 1건

tycho 를 이용해서 eclipse plugin 들을 빌드하기 위해서는 추가적으로 다음의 프로젝트가 필요하다.

- feature 프로젝트 : ex ) bizuma.ide.feature

- update site 프로젝트 : ex) bizuma.ide.update

- root 프로젝트 : ex) bizuma.ide.headless

- root 프로젝트는 packaging type 이 pom이 maven 프로젝트이다.


root 프로젝트 pom.xml 파일 작성



1.1 모듈 추가

1
2
3
4
5
<modules>
        <module>../bizmua.ide.module_a</module>
        <module>../bizmua.ide.feature</module>
        <module>../bizmua.ide.udpate</module>
    </modules>


현재 형상관리에 프로젝트가 

root

- bizuma.ide.module_a

- bizuma.ide.feature

....

와 같이 관리 되오 있다면 module 선언부에 모듈 경로는 ../ 가 없겠지만 추가하는 기존 플러그인 프로젝트로만 구성이 되어있는 상태에서 root 프로젝트를 추가하는 경우 위와 같이 경로를 잡아준다.

즉, root 프로젝트와 다른 플러그인 프로젝트는 같은 레벨에 존재 하게 될것이다.

1.2 repository 추가

1
2
3
4
5
6
7
<repositories>
        <repository>
            <id>kepler</id>
            <url>http://download.eclipse.org/releases/kepler</url>
            <layout>p2</layout>
        </repository>
    </repositories>


1.3 tycho 관련 maven 플러그인 추가

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.eclipse.tycho</groupId>
                    <artifactId>tycho-versions-plugin</artifactId>
                    <version>${tycho.version}</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>tycho-maven-plugin</artifactId>
                <version>${tycho.version}</version>
                <extensions>true</extensions>
            </plugin>
            <plugin>
                <groupId>org.eclipse.tycho</groupId>
                <artifactId>target-platform-configuration</artifactId>
                <version>${tycho.version}</version>
                <configuration>
                    <environments>
                        <environment>
                            <os>linux</os>
                            <ws>gtk</ws>
                            <arch>x86</arch>
                        </environment>
                        <environment>
                            <os>linux</os>
                            <ws>gtk</ws>
                            <arch>x86_64</arch>
                        </environment>
                        <environment>
                            <os>win32</os>
                            <ws>win32</ws>
                            <arch>x86</arch>
                        </environment>
                        <environment>
                            <os>win32</os>
                            <ws>win32</ws>
                            <arch>x86_64</arch>
                        </environment>
                        <environment>
                            <os>macosx</os>
                            <ws>cocoa</ws>
                            <arch>x86_64</arch>
                        </environment>
                    </environments>
                </configuration>
            </plugin>
        </plugins>
 
    </build>


각 플러그인 모듈에 pom.xml 파일 추가



root 프로젝트의 모듈에 추가되는 플러그인 프로젝트들(feature, udpate 프로젝트 포함)에 pom.xml 파일을 추가한다.

- 일반 플러그인 프로젝트 : 일반 플러그인 프로젝트의 packaging은 eclipse-plugin 이다.

1
2
3
4
5
6
7
8
<parent>
        <groupId>bizuma.ide</groupId>
        <artifactId>bizuma.ide.headless</artifactId>
        <version>1.0.0</version>
    </parent>
    
    <artifactId>bizuma.ide.module_a</artifactId>
    <packaging>eclipse-plugin</packaging>


- feature 프로젝트 : 위와 동일한 형식으로 작성하고 feature 프로젝트의 packaging은 eclipse-feature 이다.

- update 프로젝트 : 위와 동일한 형식으로 작성하고 udpate 프로젝트의 packaging은 eclipse-repository이다.


update 프로젝트 추가작업



- udpate 프로젝트를 eclipse IDE 에서 생성할경우 category.xml 파일을 생성되지 않는다. site.xml파일만 생성된다. udpate 프로젝트에 category.xml 파일을 생성해서 feature를 추가해준다.

- category.xml 파일 수정 : feature id에 버전을 0.0.0으로 수정한다. 추후 tycho 에서 수정 할지 모르겠지만 tycho를 이용해서 플러그인 버전을 변경할시에 pom.xml과 MANIFEST.MF, feature.xml 의 버전은 모두 동기화되지만 category.xml파일에 선언한 feature 버전은 업데이트 되지 않는 문제가 발생한다. 버전이 업그래이드 되지 않아서 feature를 찾을수 없는 문제가 발생하며 빌드 자채를 할수 없게된다. 버전을 0.0.0으로 변경해서 버전에 상관없이 빌드를 진행 할 수 있도록 한다.


feature 프로젝트 추가작업



- 빌드한 플러그인 모듈들을 추가한다.


eclipse plugin 빌드



root 프로젝트(bizuma.ide.headless)로 이동한다.

- 1) mvn -N versions:update-child-modules clean install

- 모듈들을 빌드 하기 전에 parent 가 빌드가 되어 있지 않을경우 먼저 parent 를 install 하기 위함이다.

- 2) mvn clean verify


위의 과정이 성공적으로 끝나면 udpate  프로젝트(bizuma.ide.update) 의 target 폴더 하위로 빌드가 되어 있음을 확인 할 수 있다.


빌드가 완료 되었다면 jenkins에 연동하는일은 기본이니 빌드 자동화를 하도록 하자. 


eclipse plugin version upgrade



릴리즈 혹은 패치를 해서 버전을 업그레이드를 해야 할 경우 eclipse plugin 을 빌드 하기 전에 pom.xml, feature.xml, MANIFEST.MF 파일들의 버전을 업그레이드 해야 한다. 이를 위해서는 root 프로젝트에서 다음의 명령으로 maven을 실행한다.

- mvn org.eclipse.tycho:tycho-versions-plugin:set-version -DnewVersion=x.x.x

성공적으로 완료될경우 pom.xml, feature.xml, MANIFEST.MF 파일들의 버전이 newVersion으로 변경되었음을 확인 할 수 있다.

version이 업그레이드 되면 다시 새로운 버전으로 eclipse build를 진행한다.





블로그 이미지

비추마

,