2014-04-16 23 views
18

Tôi đã cài đặt Eclipse Luna 4.4-M6. Tôi đã thử cài đặt Google Plugin cho Eclipse 4.3 (Kepler), nhưng Eclipse sẽ không cho phép tôi cài đặt nó.Plugin Google dành cho Eclipse Luna?

Có cách nào để buộc cài đặt (ví dụ: bằng cách tải xuống và chỉnh sửa một số tệp kê khai hoặc khác) không? Hoặc điều này sẽ vô ích do phá vỡ những thay đổi giữa 4.3 và 4.4?

+0

Luna vẫn đang được phát triển (M6 là bản dựng cột mốc) nên các sản phẩm khác không có khả năng đã thử nghiệm với nó. –

+1

Tôi hiểu rằng Luna vẫn đang trong quá trình phát triển. Tôi đã tự hỏi nếu có một số cách để cài đặt các plugin anyway. Tôi đã sẵn sàng chấp nhận rủi ro đó. –

+1

Luna chính thức được phát hành ngay bây giờ nên chúng tôi chờ đợi trên google! –

Trả lời

2

Hóa ra có một cách để làm thay đổi biểu hiện để cho phép các Plugin Google cho Kepler để cài đặt trong Eclipse Luna. Cộng tác viên Ze Kritter trên Google Groups đã viết một tệp Apache Ant build.xml thực hiện công việc cần thiết, original here và được sao chép bên dưới.

Nó hoạt động rất tốt cho tôi. Tôi đã chạy thành công kịch bản lệnh này và cài đặt plugin vào Luna, và - ít nhất là cho GWT - nó có vẻ hoạt động như bình thường.

Theo số discussion thread trên Google Groups, có một số điểm không tương thích với plugin Maven (cá nhân tôi không sử dụng Maven) và plugin mới và được thử nghiệm của Google sẽ sớm ra mắt (cuối tháng 7 năm 2014).

<?xml version="1.0" encoding="UTF-8"?> 

<project name="gpe.4.luna" basedir="." default="update.end"> 
    <property environment="env"/> 

    <property name="project.base.dir" value="."/> 
    <property name="project.temp.dir" value="${project.base.dir}/temp"/> 
    <property name="project.plugin.dir" value="${project.base.dir}/plugin"/> 
    <property name="project.plugins.dir" value="${project.plugin.dir}/plugins"/> 
    <property name="e42.plugin.jar" value="${project.plugins.dir}/com.google.gdt.eclipse.platform.e42_3.6.0.v201406262229-rel-r43.jar"/> 
    <property name="artifacts.jar" value="${project.plugin.dir}/artifacts.jar"/> 
    <property name="content.jar" value="${project.plugin.dir}/content.jar"/> 

    <property name="plugin43.zip" value="com.google.gdt.eclipse.suite.4.3.update.site_3.6.0.zip"/> 
    <property name="plugin44.zip" value="com.google.gdt.eclipse.suite.4.4.update.site_3.6.0.zip"/> 

    <!-- 
     source: http://stackoverflow.com/a/5340557/3747097 
     Loads entries from a manifest file. 

     @jar  The jar from where to read 
     @file A manifest file to read 
     @prefix A prefix to prepend 
     @section The name of the manifest section to load 
    --> 
    <scriptdef name="loadManifest" language="javascript" loaderRef="sharedbuild-loaderRef"> 
     <attribute name="jar" /> 
     <attribute name="file" /> 
     <attribute name="prefix" /> 
     <attribute name="section" /> 
     <![CDATA[ 
      var jarname = attributes.get("jar"); 
      var filename = attributes.get("file"); 
      if (jarname != null && filename != null) { 
       self.fail("Only one of jar or file is required"); 
      } 
      var prefix = attributes.get("prefix"); 
      if (prefix == null) { 
       prefix = ""; 
      } 
      var section = attributes.get("section"); 

      var manifest; 
      if (jarname != null) { 
       var jarfile = new java.util.jar.JarFile(new java.io.File(jarname)); 
       manifest = jarfile.getManifest(); 
      } else if (filename != null) { 
       manifest = new java.util.jar.Manifest(new java.io.FileInputStream(new java.io.File(filename))); 
      } else { 
       self.fail("One of jar or file is required"); 
      } 

      if (manifest == null) { 
       self.log("No manifest in " + jar); 
      } else { 
       var attributes = (section == null) ? manifest.getMainAttributes() : manifest.getAttributes(section); 
       if (attributes != null) { 
        var iter = attributes.entrySet().iterator(); 
        while (iter.hasNext()) { 
         var entry = iter.next(); 
         // self.log("key " + entry.getKey()); 
         // self.log("value " + entry.getValue()); 
         project.setProperty(prefix + entry.getKey(), entry.getValue()); 
        } 
       } 
      } 
     ]]> 
    </scriptdef> 

    <!-- 
     source: http://giorgio-ferrara.blogspot.ru/2010/09/apache-ant-how-to-search-and-replace.html 
    --> 
    <macrodef name="replaceStringWithRegExp"> 
     <attribute name="string"/> 
     <attribute name="searchPattern"/> 
     <attribute name="replacementPattern"/> 
     <attribute name="property"/> 
     <sequential> 
      <tokens id="id"> 
       <concat> 
       <string value="@{string}"/> 
       <filterchain> 
        <tokenfilter> 
         <replaceregex pattern="@{searchPattern}" 
            replace="@{replacementPattern}" 
            flags="g"/> 
        </tokenfilter> 
       </filterchain> 
       </concat> 
      </tokens> 
      <property name="@{property}" value="${toString:id}"/> 
     </sequential> 
    </macrodef> 

    <target name="clean"> 
     <delete dir="${project.temp.dir}"/> 
     <delete dir="${project.plugin.dir}"/> 
     <delete file="${plugin44.zip}"/> 
    </target> 

    <target depends="clean" name="init"> 
     <mkdir dir="${project.temp.dir}"/> 
    </target> 

    <target depends="init" name="check.source"> 
     <condition property="plugin-not-found"> 
      <not> 
       <available file="${plugin43.zip}"/> 
      </not> 
     </condition> 
    </target> 

    <target depends="check.source" name="get.source" if="${plugin-not-found}"> 
     <get src="https://commondatastorage.googleapis.com/eclipse_toolreleases/products/gpe/release/3.6.0/4.3/com.google.gdt.eclipse.suite.4.3.update.site_3.6.0.zip" dest="."/> 
    </target> 

    <target depends="check.source, get.source" name="unzip.source"> 
     <unzip src="${plugin43.zip}" dest="${project.plugin.dir}"/> 
    </target> 

    <target depends="unzip.source" name="update.manifest"> 
     <checksum file="${e42.plugin.jar}" property="original.md5"/> 
     <loadManifest jar="${e42.plugin.jar}" prefix="e42.mf."/> 
     <replaceStringWithRegExp string="${e42.mf.Require-Bundle}" 
      searchPattern="(.*);bundle-version=&quot;\[3.8.0,3.10.0\)&quot;(.*)" 
      replacementPattern="\1\2" 
      property="Require-Bundle"/> 
     <!-- 
     <echo>${e42.mf.Require-Bundle}</echo> 
     <echo>${Require-Bundle}</echo> 
     --> 
     <jar update="true" file="${e42.plugin.jar}"> 
      <manifest> 
       <attribute name="Require-Bundle" value="${Require-Bundle}"/> 
      </manifest> 
     </jar> 
     <checksum file="${e42.plugin.jar}" property="updated.md5"/> 
     <!-- 
     <echo>${original.md5}</echo> 
     <echo>${updated.md5}</echo> 
     --> 
    </target> 

    <target depends="update.manifest" name="update.artifacts"> 
     <delete includeemptydirs="true"> 
      <fileset dir="${project.temp.dir}" includes="**/*"/> 
     </delete> 
     <unzip src="${artifacts.jar}" dest="${project.temp.dir}"/> 
     <replaceregexp byline="true"> 
      <regexp pattern="${original.md5}"/> 
      <substitution expression="${updated.md5}"/> 
      <fileset dir="${project.temp.dir}"/> 
     </replaceregexp> 
     <zip destfile="${artifacts.jar}" basedir="${project.temp.dir}"/> 
    </target> 

    <target depends="update.artifacts" name="update.content"> 
     <delete includeemptydirs="true"> 
      <fileset dir="${project.temp.dir}" includes="**/*"/> 
     </delete> 
     <unzip src="${content.jar}" dest="${project.temp.dir}"/> 
     <replaceregexp byline="true"> 
      <regexp pattern="name='org.eclipse.core.runtime' range='\[3.8.0,3.10.0\)'"/> 
      <substitution expression="name='org.eclipse.core.runtime' range='0.0.0'"/> 
      <fileset dir="${project.temp.dir}"/> 
     </replaceregexp> 
     <zip destfile="${content.jar}" basedir="${project.temp.dir}"/> 
    </target> 

    <target depends="update.content" name="create.updated.plugin"> 
     <zip destfile="${plugin44.zip}" basedir="${project.plugin.dir}"/> 
     <delete dir="${project.temp.dir}"/> 
     <delete dir="${project.plugin.dir}"/> 
    </target> 

    <target depends="create.updated.plugin" name="update.end"> 
     <echo message="plugin rebuild success"/> 
    </target> 

</project> 

tôi sẽ thêm các từ Eclipse Mars đây, vì vậy giải pháp này có thể được tìm thấy bằng cách tìm kiếm và có khả năng thích nghi cho việc phát hành tháng 6 năm 2015 của Eclipse.

+1

Phiên bản chính thức của GPE 3.7.0 hiện đã hoạt động: [https://dl.google.com/eclipse/plugin/4.4](https://dl.google.com/eclipse/plugin/4.4) (Eclipse Luna) –

7

Theo diễn đàn cộng đồng Google Plugin cho Eclipse, chúng tôi có thể mong đợi một plugin mới có hỗ trợ Luna vào giữa tháng 7.

https://groups.google.com/forum/#!topic/google-plugin-eclipse/4YACQROrB2U

+0

Cảm ơn bạn đã chỉ ra nhóm này. Tôi đã quản lý để cài đặt plugin Kepler trong Luna bằng cách sử dụng các hướng dẫn được cung cấp trong chuỗi thảo luận đó. Tôi đã upvoted bạn, nhưng đánh dấu câu trả lời của tôi như là câu trả lời chấp nhận vì nó cung cấp một cách để giải quyết vấn đề mà không liên quan đến chờ đợi ... :-) –

+0

Nó cuối cùng đã đến! –

2

Điều này dường như đã được giải quyết gần đây.

tôi không tìm thấy các plugin trong Marketplace như các văn bản này, nhưng có một trang web cập nhật: https://dl.google.com/eclipse/plugin/4.4

Bạn có thể đọc thêm về điều này tại https://developers.google.com/eclipse/docs/install-eclipse-4.4

+0

Đúng vậy, tôi thực sự đã thêm nhận xét vào hiệu ứng đó theo câu trả lời của tôi ở trên, nhưng tốt nhất là nên có câu trả lời đầy đủ chứ không phải chỉ là một nhận xét. Cảm ơn. –