idea怎么把源码发给别人(怎么把java代码发给别人)

今天给各位分享idea怎么把源码发给别人的知识,其中也会对怎么把java代码发给别人进行解释,如果能碰巧解决你现在面临的问题,别忘了关注本站,现在开始吧!

本文目录一览:

如何用 Intellij 导入 Android 源码?

针对定制源码或者原生源码来说,这些准备步骤都是必须的,没必要再强调了。

2-2 配置导入及使用

2-2-1 编译源码idegen模块及生成AS配置文件(*.ipr)

在开始编译idegen模块前,你一定知道需要先全局编译出out目录及相关文件吧,这个不再过多说了,我们通过如下命令编译idegen模块:

mmm development/tools/idegen/1

这行命令的意思是编译idegen这个模块项目,然后生成idegen.jar文件(不信你自己去查看这个模块的Android.mk的目标吧,不多解释)。运行完以后如果看到如下信息则说明编译OK:

......

#### make completed successfully (7 seconds) ####12

接着执行如下脚本:

development/tools/idegen/idegen.sh1

这行命令的意思是在根目录生成对应的android.ipr、android.iml IEDA工程配置文件。等待片刻得到类似如下信息说明OK:

Read excludes: 21ms

Traversed tree: 194799ms12

通过如上操作我们就完成了基本的源码配置工作。

2-2-2 导入Android Studio前的一些客户化操作

大家都知道使用Eclipse倒入源码很慢,Android Studio导入源码时也慢,所以建议修改android.iml文件(将自己不用的代码去掉),然后再导入Studio。

就像下面摘取的android.iml文件1887行开始的这些一样:

sourceFolder url="" isTestSource="true"/

sourceFolder url="" isTestSource="false"/

excludeFolder url=""/

excludeFolder url=""/

excludeFolder url=""/

excludeFolder url=""/

excludeFolder url=""/

excludeFolder url=""/

excludeFolder url=""/

excludeFolder url=""/

excludeFolder url=""/

excludeFolder url=""/

excludeFolder url=""/

excludeFolder url=""/1234567891011121314

我们可以仿照上面这段代码的excludeFolder url=""/写法一样过滤掉不需要的内容,这样在导入时就会快很多。

也可以通过Android Studio的Project Stucture 打开左侧Modules,然后将右侧Sources中一些目录Excluded掉。

2-2-3 使用Android Studio导入源码工程

有了如上的这些操作以后,我们打开Android Studio,然后选择打开一个现有的Android Studio项目,然后选择打开源码根目录下的android.ipr文件,然后出现如图一样的索引即可等待导入就行:tu

到目前为止我们就可以方便的使用Android Studio查看源码啦。如下图所示:

吊不屌!!!

2-3 使用技巧

上图我们看见了,可以通过Android Studio搜索整套源码的代码了。但是这时候如果你打开一个Service.java类,然后把鼠标放在其中任意方法的Intent参数上按住CTRL+鼠标左键跳转到Intent类你会发现跳转过去的是一个Intent.class文件,为啥呢?因为他跳转的是你的默认SDK中的jar内部的class文件。既然要修改查看整套源码,这么跳转得多蛋疼啊,所以我们需要配置让其能跳转到Intent.java文件,具体做法如下:

首先删掉依赖中的所有依赖,只保留下图中没被选中的那两个(当然你可以选择保留一些你用到的其他jar),如下:

接着点击加号的JARs or directories将你源码的frameworks及external和你用到的其他跳转目录添加到依赖中,然后apply即可。

这时候我们在像上面一样打开Service.java跳转Intent,你会发现像下图一样直接跳转到你源码路径下的Intent.java文件了,如下:

到此对于平时只是查看源码的人来说已经够用了。

3 总结

俗话说工欲善其事必先利其器,你会发现使用Android Studio比Eclipse和Source Insight都好很多(当然了,SubText还是很强大的),无论是代码提示还是跳转、还是Python Shell等插件支持等都很强大,慢慢体验吧。

顺带说一句,Google的野心真的很大,看来Android Studio即将要被他们打造为全能IDE了。

4 附加README

附上原版的英文README文档,英语高手直接看这里就行:

IDEGen automatically generates Android IDE configurations for IntelliJ IDEA

and Eclipse. Your IDE should be able to compile everything in a reasonable

amount of time with no errors.

If you’re using IntelliJ…

If this is your first time using IDEGen...

IDEA needs a lot of memory. Add "-Xms748m -Xmx748m" to your VM options

in "IDEA_HOME/bin/idea.vmoptions" on Linux or

"IntelliJ IDEA.app/Contents/Info.plist" on OS X.

Create a JDK configuration named "1.6 (No Libraries)" by adding a new

JDK like you normally would and then removing all of the jar entries

under the "Classpath" tab. This will ensure that you only get access to

Android's core libraries and not those from your desktop VM.

From the project's root directory...

Repeat these steps after each sync...

1) make (to produce generated .java source)

2) development/tools/idegen/idegen.sh

3) Open android.ipr in IntelliJ. If you already have the project open,

hit the sync button in IntelliJ, and it will automatically detect the

updated configuration.

If you get unexpected compilation errors from IntelliJ, try running

"Build - Rebuild Project". Sometimes IntelliJ gets confused after the

project changes significantly.

If you’re using Eclipse…

If this is your first time using IDEGen...

Edit eclipse.ini ("Eclipse.app/Contents/MacOS/eclipse.ini" on OS X) and

add "-Xms748m -Xmx748m" to your VM options.

Configure a JRE named "1.5 (No Libraries)" under "Preferences - Java -

Installed JREs". Remove all of the jar entries underneath "JRE system

libraries". Eclipse will not let you save your configuration unless at

least one jar is present, so include a random jar that won't get in the

way.

From the project's root directory...

Repeat these steps after each sync...

1) make (to produce generated .java source)

2) development/tools/idegen/idegen.sh

3) Import the project root directory into your Eclipse workspace. If you

already have the project open, simply refresh it (F5).

Excluding source roots and jars

IDEGen keeps an exclusion list in the "excluded-paths" file. This file

has one regular expression per line that matches paths (relative to the

project root) that should be excluded from the IDE configuration. We

use Java's regular expression parser (see java.util.regex.Parser).

You can create your own additional exclusion list by creating an

"excluded-paths" file in the project's root directory. For example, you

might exclude all apps except the Browser in your IDE configuration with

this regular expression: "^packages/apps/(?!Browser)".

Controlling source root ordering (Eclipse)

You may want some source roots to come before others in Eclipse. Simply

create a file named "path-precedence" in your project's root directory.

Each line in the file is a regular expression that matches a source root

path (relative to the project's root directory). If a given source root's

path matches a regular expression that comes earlier in the file, that

source root will come earlier in the generated configuration. If a source

root doesn't match any of the expressions in the file, it will come last,

so you effectively have an implicit ".*" rule at the end of the file.

For example, if you want your applications's source root to come first,

you might add an expression like "^packages/apps/MyApp/src$" to the top

of the "path-precedence" file. To make source roots under ./out come last,

add "^(?!out/)" (which matches all paths that don't start with "out/").

IDEA 怎么导入java API与源码?

idea有import功能,可以导入本地源码和类库。

点File-- Import Porject,选择你本地的源码路径,根据向导提示导入,idea兼容四种IDE的工程:

1、Eclipse .project .classpath file,也就是你的源码中有eclipse的工程文件.project .classpath,就选择Eclipse类型,idea自动将它导入进来。你的Myeclipse也是一样。

2、Maven项目,你向导中选择maven项目,它将作为maven项目被导入idea

这两种是最常见的,另外两种就不说了。

如果你的源码中没有.project .classpath文件,也不是maven项目,在向导中你可以选择

Create project form existing sources

直接使用源码导入idea

intellij idea 怎么导入scala源码

打开IntelliJ IDEA 后,在菜单栏中选择 VCS→Check out from Version Control→Git,之后在 Git Repository URL 中填入 Spark 项目的地址,并指定好本地路径,如下图所示。

点击该窗口中的的 Clone 后,开始从 Github 中 clone 该项目,该过程试你网速而定,大概需要3-10分钟。

idea怎么分享java文件

可用打包工具。

在初始窗口中单击ImportProject,在文件树中选择您的项目,打开Import窗口,选择Eclipseoption,然后单击Next。导入完成后,主窗口将打开,项目目录在左侧,编辑区域在右侧。下图显示了目录树结构。人们发现。已经生成了idea目录和web_test.iml文件,它们是idea的IDE依赖文件。

选择左边的下一个菜单,模块,这是idea的概念。模块包含在项目下。对了,很多人会对这个概念感到困惑甚至鄙视,但确实是正确的。它来自于maven的想法。如果你看过一些大型开源软件,你就会知道开源nosql的源代码。一个项目将被开发成许多模块。但是对于常规的javaweb,不用担心那么多,只要明白一个项目就是一个模块,两者可以合二为一。

eclipse导入idea项目

idea项目得源码,我们不能直接在eclipse中使用,这个需要我们稍微做一下处理,之后eclipse中才能够使用。

我们在idea中,进入项目配置

idea中生成3个eclipse得配置文件

将生产得文件,放到idea得源码中,去除配置文件,实际上就是src文件跟pom文件

这样处理之后,eclipse就可以识别这个项目了,就能够正常开发使用了。

关于idea怎么把源码发给别人和怎么把java代码发给别人的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。


【免责声明】:

本站所发布的一切资源仅限用于学习和研究目的;不得将上述内容用于商业或者非法用途,否则,一切后果请用户自负。本站信息来自网络,版权争议与本站无关。您必须在下载后的24个小时之内,从您的电脑中彻底删除上述内容。如果您喜欢该程序,请支持正版软件,购买注册,得到更好的正版服务。

【关于转载】:

本站尊重互联网版权体系,本站部分图片、文章大部分转载于互联网、所有内容不代表本站观点、不对文章中的任何观点负责、转载的目的只用于给网民提供信息阅读,无任何商业用途,所有内容版权归原作者所有
如本站(文章、内容、图片、视频)任何资料有侵权,先说声抱歉;麻烦您请联系请后台提交工单,我们会立即删除、维护您的权益。非常感谢您的理解。

【附】:

二○○二年一月一日《计算机软件保护条例》第十七条规定:为了学习和研究软件内含的设计思想和原理,通过安装、显示、传输或者存储软件等方式使用软件的,可以不经软件著作权人许可,不向其支付报酬!鉴于此,也希望大家按此说明研究软件!

注:本站资源来自网络转载,版权归原作者和公司所有,如果有侵犯到您的权益,请第一时间联系我们处理!

-----------------------------------------------------------------------------------------------------------

【版权声明】:

一、本站致力于为源码爱好者提供国内外软件开发技术和软件共享,着力为用户提供优资资源。
二、本站提供的源码下载文件为网络共享资源,请于下载后的24小时内删除。如需体验更多乐趣,还请支持正版。
三、如有内容侵犯您的版权或其他利益的,请编辑邮件并加以说明发送到站长邮箱。站长会进行审查之后,情况属实的会在三个工作日内为您删除。
-----------------------------------------------------------------------------------------------------------


内容投诉
源码村资源网 » idea怎么把源码发给别人(怎么把java代码发给别人)
您需要 登录账户 后才能发表评论

发表评论

欢迎 访客 发表评论