%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/generator/
Upload File :
Create Path :
Current File : //lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/generator/eclipse.pyc

�
vפ\c@sidZddlmZddlZddlZddlZddlZddlZddl	Z	ddl
jjZ
eaiZx(ddddgD]Zdeee<q�Wx<d	d
ddd
dddddddgD]Zdee<q�Wded<d�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd �Zd!�Zd"�Zd#�Zd$�ZdS(%s�GYP backend that generates Eclipse CDT settings files.

This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML
files that can be imported into an Eclipse CDT project. The XML file contains a
list of include paths and symbols (i.e. defines).

Because a full .cproject definition is not created by this generator, it's not
possible to properly define the include dirs and symbols for each file
individually.  Instead, one set of includes/symbols is generated for the entire
project.  This works fairly well (and is a vast improvement in general), but may
still result in a few indexer issues here and there.

This generator has no automated tests, so expect it to be broken.
i����(tescapeNtINTERMEDIATE_DIRtPRODUCT_DIRtLIB_DIRtSHARED_LIB_DIRt$tRULE_INPUT_PATHtRULE_INPUT_ROOTtRULE_INPUT_NAMEtRULE_INPUT_DIRNAMEtRULE_INPUT_EXTtEXECUTABLE_PREFIXtEXECUTABLE_SUFFIXtSTATIC_LIB_PREFIXtSTATIC_LIB_SUFFIXtSHARED_LIB_PREFIXtSHARED_LIB_SUFFIXtCONFIGURATION_NAMEts$SHARED_INTERMEDIATE_DIRtSHARED_INTERMEDIATE_DIRc	Cs�|jdi�}x*|j�D]\}}|j||�qWtjj|�}|jd|�|dkr�ddljj}t	|dg�}t	|dg�}tj
j||�ndS(Ntgenerator_flagstOStwini����t+generator_additional_non_configuration_keyst"generator_additional_path_sections(tgettitemst
setdefaulttgyptcommont	GetFlavortgyp.generator.msvst	generatortmsvstgetattrtmsvs_emulationtCalculateCommonVariables(	tdefault_variablestparamsRtkeytvaltflavortmsvs_generatorRR((sZ/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/generator/eclipse.pytCalculateVariables5scCs1|jdi�}|jdt�r-tandS(sOCalculate the generator specific info that gets fed to input (called by
  gyp).Rtadjust_static_librariesN(RtFalsetTruet4generator_wants_static_library_dependencies_adjusted(R&R((sZ/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/generator/eclipse.pytCalculateGeneratorInputInfoGsc	Cs�t�}g}|r�tj|�}|jddddg�tjd|dtjdtjdtj�}	|	j�d	}
t}xv|
j	�D]e}|j
d
�r�t}q�n|j
d�r�Pn|r�|j�}
|
|kr�|j
|
�q�q�q�Wntjj|�}|dkr,|jd
i�}nxc|D][}||}||dkr3|d|}|dkr�tjj||�}|j|�}n
|d}xF|D]>}|j
d�r�|d}
|
|kr�|j
|
�q�q�q�W|jd�r�|d}x�|D]}}xt|D]l}
|
jd|�}
tjj|
�sstjj|�}|d|
}
tjj|
�}
n|j|
�qWqWq�q3q3Wt|�}|j�x*|D]"}||kr�|j
|�q�q�W|S(s�Calculate the set of include directories to be used.

  Returns:
    A list including all the include_dir's specified for every target followed
    by any include directories that were added as cflag compiler options.
  s-Es-xc++s-vt-targststdintstdouttstderris#includesEnd of search list.RRtconfigurationstcflagss-Iitinclude_dirss$SHARED_INTERMEDIATE_DIRt/(tsettshlextsplittextendt
subprocesstPopentPIPEtcommunicateR-t
splitlinest
startswithR.tstriptappendRRRRR#tMsvsSettingst	GetCflagsthas_keytreplacetostpathtisabstdirnametabspathtaddtlisttsort(ttarget_listttarget_dictstshared_intermediate_dirstconfig_nameR&t
compiler_pathtgyp_includes_settcompiler_includes_listtcommandtproctoutputtin_include_listtlinetinclude_dirR)Rttarget_namettargettconfigt
msvs_settingsR7tcflagR8tshared_intermediate_dirtbase_dirtall_includes_listtcompiler_include((sZ/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/generator/eclipse.pytGetAllIncludeDirectoriesPsh
		







		

c	Cs�tjj|d�\}}}||jdi�}x6|D].\}}|dkr<tjj|j|�Sq<Wx3dddgD]"}tjj|�}|r~|Sq~WdS(sDetermine a command that can be used to invoke the compiler.

  Returns:
    If this is a gyp project that has explicit make settings, try to determine
    the compiler from that.  Otherwise, see if a compiler was specified via the
    CC_target environment variable.
  itmake_global_settingstCCtCXXt	CC_targettgcc(sCCsCXX(	RRtParseQualifiedTargetRRJRKtjointtoplevel_dirtenviron(	RRtdatatoptionst
build_filet_tmake_global_settings_dictR'tvaluetcompiler((sZ/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/generator/eclipse.pytGetCompilerPath�s	c	Cs:i}tjj|�}|dkr9|jdi�}nx|D]�}	||	}
|dkr�tjj|
|�}|j|�}ng}||
dkr�|
d|}
|
d}ng}x�||D]t}|jdd�}t|�dkr�|j	d�n|dj
�|krq�n|dj
�||dj
�<q�Wq@W|dkrQ|S|r6tj|�}|jd	d
dg�t
jd|d
ddt
jdt
j�}|j�d}|jd�}xn|D]c}|j
�s�q�n|jdd�}|d}t|�dkr|d}nd}|||<q�Wn|S(s�Calculate the defines for a project.

  Returns:
    A dict that includes explict defines declared in gyp files along with all of
    the default defines that the compiler uses.
  RRR6tdefinest=it1is-Es-dMR1R2tcwdt.R3R4s
t ii(RRRRR#RFtGetComputedDefinesR<tlenRERDR;R=R>R?R@RA(RRRSRrRUR&RVtall_definesR)RR_R`Rbt
extra_definesRattarget_definestdefinetsplit_defineRYtcpp_proct
cpp_outputt	cpp_linestcpp_linetcpp_line_partsR'R(((sZ/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/generator/eclipse.pyt
GetAllDefines�sP



&


cCs||jd�|jd�xN|D]F}|jd|�x|D]}|jd|�q?W|jd�q!W|jd�dS(s9Write the includes section of a CDT settings export file.sT  <section name="org.eclipse.cdt.internal.ui.wizards.settingswizards.IncludePaths">
s=    <language name="holder for library settings"></language>
s    <language name="%s">
s;      <includepath workspace_path="false">%s</includepath>
s    </language>
s
  </section>
N(twrite(toutt
eclipse_langsR8tlangR^((sZ/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/generator/eclipse.pytWriteIncludePaths�s



	cCs�|jd�|jd�xp|D]h}|jd|�xAt|j��D]-}|jdt|�t||�f�qKW|jd�q!W|jd�dS(s7Write the macros section of a CDT settings export file.sN  <section name="org.eclipse.cdt.internal.ui.wizards.settingswizards.Macros">
s=    <language name="holder for library settings"></language>
s    <language name="%s">
s6      <macro><name>%s</name><value>%s</value></macro>
s    </language>
s
  </section>
N(R�tsortedtiterkeysR(R�R�RzR�R'((sZ/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/generator/eclipse.pytWriteMacross


	"c
	Cs�|d}|jdi�}tjj|jdd�|�}tjj|j|�}tjj|dd�tjj|d�g}	t|||||tjj|d�||	�t|||j|tjj|d��dS(	NRsRt
output_dirR�tobjtgenseclipse-cdt-settings.xmlseclipse-classpath.xml(RRJRKRoRptGenerateCdtSettingsFiletGenerateClasspathFile(
RRRSRrR&RURsRt	build_dirttoplevel_buildRT((sZ/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/generator/eclipse.pytGenerateOutputForConfigs,
	c
Cs�tjj|�t|d���}|jd�|jd�dddddd	g}	t|||�}
t||||||
�}t||	|�t||||||
�}t	||	|�|jd
�WdQXdS(Ntws'<?xml version="1.0" encoding="UTF-8"?>
s<cdtprojectproperties>
sC++ Source Files
C Source FilesAssembly Source FilesGNU C++sGNU CtAssemblys</cdtprojectproperties>
(
RRtEnsureDirExiststopenR�RyRhR�R�R�(
RRRSRrR&RUtout_nameRsRTR�R�RVR8Rz((sZ/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/generator/eclipse.pyR�;s

		cs�tjj|�tjd����fd�}|dt||���|dt||���|ddg�|dtjj	|d�g�tj
��j|�d	S(
s�Generates a classpath file suitable for symbol navigation and code
  completion of Java code (such as in Android projects) by finding all
  .java and .jar files used as action inputs.t	classpathcs�t�}xL|D]D}tjj|�rG|jtjj|���q|j|�qWxFt|�D]8}tj�d�}|jd|�|jd|�qeWdS(NtclasspathentrytkindRK(	R:RJRKRLROtrelpathR�tETt
SubElement(R�tpathst	rel_pathsRKt
entry_element(tresultRp(sZ/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/generator/eclipse.pytAddElementsYs	
tlibtsrctcons'org.eclipse.jdt.launching.JRE_CONTAINERR[s.eclipse-java-buildN(RRR�R�tElementtGetJavaJarstGetJavaSourceDirsRJRKRotElementTreeR�(RRRSRpR�R�R�((R�RpsZ/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/generator/eclipse.pyR�Qsccs�x�|D]�}||}x�|jdg�D]�}x{|dD]o}tjj|�ddkr;|jd�r;tjj|�r�|Vq�tjjtjj|�|�Vq;q;Wq*WqWdS(s1Generates a sequence of all .jars used as inputs.tactionstinputsis.jarRN(RRJRKtsplitextRCRLRoRM(RRRSRpR_R`tactiontinput_((sZ/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/generator/eclipse.pyR�ss

,c
csx|D]�}||}x�|jdg�D]�}x�|dD]�}tjj|�ddkr;|jd�r;tjjtjjtjj|�|��}|}xXtjj|�d	kr�tjj|�\}}	|s�||kr�|VPq�q�W|Vq;q;Wq*WqWdS(
sAGenerates a sequence of all likely java package root directories.R�R�is.javaRR�tjavaN(ssrcsjava(	RRJRKR�RCRMRotbasenameR<(
RRRSRpR_R`R�R�tdir_t
parent_searchRu((sZ/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/generator/eclipse.pyR��s

!cCs�|djrtd��n|jdi�jdd�}|rYt|||||�n?||ddj�}x$|D]}t|||||�qxWdS(sFGenerate an XML settings file that can be imported into a CDT project.Rss.--generator_output not implemented for eclipseRRaiR6N(tgenerator_outputtNotImplementedErrorRtNoneR�tkeys(RRRSRrR&tuser_configtconfig_namesRU((sZ/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/generator/eclipse.pytGenerateOutput�s


( t__doc__txml.sax.saxutilsRtos.pathRJR>Rt
gyp.commontgyp.msvs_emulationR;txml.etree.cElementTreetetreetcElementTreeR�R-R/tgenerator_default_variablesRMtunusedR+R0RhRyR�R�R�R�R�R�R�R�R�(((sZ/usr/lib/node_modules/npm/node_modules.bundled/node-gyp/gyp/pylib/gyp/generator/eclipse.pyt<module>sB

				Y		;			!		"	
	

Zerion Mini Shell 1.0