Advertisement
mateorod

androidTarget-update-ci.diffgit

Jun 22nd, 2014
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 10.23 KB | None | 0 0
  1. 21:49:14 00:01     [ivy]
  2.                    Invalidated 12 targets containing 12 payload files.
  3. 21:49:14 00:01       [ivy-resolve]
  4. 21:49:14 00:01         [ivy]
  5. 21:49:14 00:01   [compile]
  6. 21:49:14 00:01     [jvm]
  7. 21:49:14 00:01       [jvm-compilers]
  8. 21:49:14 00:01   [test]
  9. 21:49:14 00:01     [pytest]
  10. 21:49:14 00:01       [run]
  11.                      ============== test session starts ===============
  12.                      platform linux2 -- Python 2.7.6 -- py-1.4.20 -- pytest-2.5.2
  13.                      plugins: cov, timeout
  14.                      collected 11 items
  15.                      
  16.                      tests/python/pants_test/tasks/test_jar_publish_integration.py ..
  17.                      tests/python/pants_test/python/test_interpreter_selection_integration.py .s.
  18.                      tests/python/pants_test/python/test_python_repl_integration.py .
  19.                      tests/python/pants_test/tasks/test_jvm_bundle_integration.py .
  20.                      tests/python/pants_test/python/test_python_run_integration.py s.
  21.                      tests/python/pants_test/tasks/test_scala_repl_integration.py .
  22.                      tests/python/pants_test/targets/test_scala_library_integration.py .
  23.                      
  24.                      ===== 9 passed, 2 skipped in 150.22 seconds ======
  25.                      
  26. 21:51:45 02:32     [junit]
  27. 21:51:45 02:32     [specs]
  28.                SUCCESS
  29.  
  30. [== CI SUCCESS ==]
  31.  
  32. mateor@mateor-HP-m6:~/development/pants$ git diff origin/master
  33. diff --git a/src/python/pants/backend/android/BUILD b/src/python/pants/backend/android/BUILD
  34. new file mode 100644
  35. index 0000000..ce110f7
  36. --- /dev/null
  37. +++ b/src/python/pants/backend/android/BUILD
  38. @@ -0,0 +1,11 @@
  39. +# coding=utf-8
  40. +# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
  41. +# Licensed under the Apache License, Version 2.0 (see LICENSE).
  42. +
  43. +python_library(
  44. +  name = 'plugin',
  45. +  sources = ['__init__.py', 'register.py'],
  46. +  dependencies = [
  47. +    pants('src/python/pants/backend/android/targets:android'),
  48. +  ]
  49. +)
  50. \ No newline at end of file
  51. diff --git a/src/python/pants/backend/android/__init__.py b/src/python/pants/backend/android/__init__
  52. new file mode 100644
  53. index 0000000..e69de29
  54. diff --git a/src/python/pants/backend/android/register.py b/src/python/pants/backend/android/register
  55. new file mode 100644
  56. index 0000000..49f19a0
  57. --- /dev/null
  58. +++ b/src/python/pants/backend/android/register.py
  59. @@ -0,0 +1,42 @@
  60. +# coding=utf-8
  61. +# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
  62. +# Licensed under the Apache License, Version 2.0 (see LICENSE).
  63. +
  64. +from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
  65. +                        print_function, unicode_literals)
  66. +
  67. +from pants.goal import Goal as goal
  68. +
  69. +from pants.backend.android.targets.android_binary import AndroidBinary
  70. +from pants.backend.android.targets.android_target import AndroidTarget
  71. +
  72. +
  73. +def target_aliases():
  74. +  return {
  75. +    'android_binary': AndroidBinary,
  76. +    'android_target': AndroidTarget,
  77. +  }
  78. +
  79. +
  80. +def object_aliases():
  81. +  return {}
  82. +
  83. +
  84. +def partial_path_relative_util_aliases():
  85. +  return {}
  86. +
  87. +
  88. +def applicative_path_relative_util_aliases():
  89. +  return {}
  90. +
  91. +
  92. +def target_creation_utils():
  93. +  return {}
  94. +
  95. +
  96. +def register_commands():
  97. +  pass
  98. +
  99. +
  100. +def register_goals():
  101. +  pass
  102. \ No newline at end of file
  103. diff --git a/src/python/pants/backend/android/targets/BUILD b/src/python/pants/backend/android/target
  104. new file mode 100644
  105. index 0000000..cc57051
  106. --- /dev/null
  107. +++ b/src/python/pants/backend/android/targets/BUILD
  108. @@ -0,0 +1,23 @@
  109. +# coding=utf-8
  110. +# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
  111. +# Licensed under the Apache License, Version 2.0 (see LICENSE).
  112. +
  113. +python_library(
  114. +  name = 'all',
  115. +  dependencies = [
  116. +    ':android',
  117. +  ],
  118. +)
  119. +
  120. +python_library(
  121. +  name = 'android',
  122. +  sources = [
  123. +    'android_binary.py',
  124. +    'android_target.py',
  125. +  ],
  126. +  dependencies = [
  127. +    pants('src/python/pants/base:payload'),
  128. +    pants('src/python/pants/base:target'),
  129. +    pants('src/python/pants/backend/core/targets:common'),
  130. +  ],
  131. +)
  132. \ No newline at end of file
  133. diff --git a/src/python/pants/backend/android/targets/__init__.py b/src/python/pants/backend/android/
  134. new file mode 100644
  135. index 0000000..e69de29
  136. diff --git a/src/python/pants/backend/android/targets/android_binary.py b/src/python/pants/backend/an
  137. new file mode 100644
  138. index 0000000..221a335
  139. --- /dev/null
  140. +++ b/src/python/pants/backend/android/targets/android_binary.py
  141. @@ -0,0 +1,40 @@
  142. +# coding=utf-8
  143. +# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
  144. +# Licensed under the Apache License, Version 2.0 (see LICENSE)
  145. +
  146. +from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
  147. +                        print_function, unicode_literals)
  148. +
  149. +from pants.backend.android.targets.android_target import AndroidTarget
  150. +
  151. +
  152. +class AndroidBinary(AndroidTarget):
  153. +  """Produces an Android binary."""
  154. +
  155. +  def __init__(self,
  156. +               name=None,
  157. +               sources=None,
  158. +               provides=None,
  159. +               dependencies=None,
  160. +               excludes=None,
  161. +               **kwargs):
  162. +    """
  163. +   :param string name: The name of this target, which combined with this
  164. +      build file defines the target :class:`pants.base.address.Address`.
  165. +    :param sources: A list of filenames representing the source code.
  166. +    :type sources: list of strings
  167. +    :param excludes: One or more :class:`pants.targets.exclude.Exclude` instances
  168. +      to filter this target's transitive dependencies against.
  169. +    :param package: Package name of app, e.g. 'com.pants.examples.hello'
  170. +    :type package: string
  171. +    :param resources: name of directory containing the android resources. Set as 'res' by default.
  172. +    :param build_tools_version: API for the Build Tools (separate from SDK version).
  173. +      Default to latest available
  174. +    :param target_sdk_version: Version of the Android SDK the android target is built for
  175. +    :param min_sdk_version:  Earliest supported SDK by the android target
  176. +    :param release_type: Which keystore is used to sign target: 'debug' or 'release'.
  177. +      Set as 'debug' by default.
  178. +    """
  179. +
  180. +    # TODO: Add some Compatibility error checks.
  181. +    super(AndroidBinary, self).__init__(name=name, sources=sources, **kwargs)
  182. diff --git a/src/python/pants/backend/android/targets/android_target.py b/src/python/pants/backend/an
  183. new file mode 100644
  184. index 0000000..d196423
  185. --- /dev/null
  186. +++ b/src/python/pants/backend/android/targets/android_target.py
  187. @@ -0,0 +1,61 @@
  188. +# coding=utf-8
  189. +# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
  190. +# Licensed under the Apache License, Version 2.0 (see LICENSE)
  191. +
  192. +from __future__ import (nested_scopes, generators, division, absolute_import, with_statement,
  193. +                        print_function, unicode_literals)
  194. +
  195. +from pants.base.payload import JvmTargetPayload
  196. +from pants.base.target import Target
  197. +
  198. +
  199. +class AndroidTarget(Target):
  200. +  """A base class for all Android targets"""
  201. +
  202. +  def __init__(self,
  203. +               address=None,
  204. +               sources=None,
  205. +               sources_rel_path=None,
  206. +               excludes=None,
  207. +               provides=None,
  208. +               package=None,
  209. +               resources="res",
  210. +               # most recent build_tools_version should be defined elsewhere
  211. +               build_tools_version="19.1.0",
  212. +               target_sdk_version=None,
  213. +               min_sdk_version=None,
  214. +               release_type="debug",
  215. +               **kwargs):
  216. +    """
  217. +    :param string name: The name of this target, which combined with this
  218. +      build file defines the target :class:`pants.base.address.Address`
  219. +    :param sources: A list of filenames representing the source code.
  220. +    :type sources: list of strings
  221. +    :param excludes: One or more :class:`pants.targets.exclude.Exclude` instances
  222. +      to filter this target's transitive dependencies against.
  223. +    :param package: Package name of app, e.g. 'com.pants.examples.hello'
  224. +    :type package: string
  225. +    :param resources: name of directory containing the android resources. Set as 'res' by default.
  226. +    :param build_tools_version: API for the Build Tools (separate from SDK version).
  227. +      Default to latest available
  228. +    :param target_sdk_version: Version of the Android SDK the android target is built for
  229. +    :param min_sdk_version:  Earliest supported SDK by the android target
  230. +    :param release_type: Which keystore is used to sign target: 'debug' or 'release'.
  231. +      Set as 'debug' by default.
  232. +    """
  233. +
  234. +    sources_rel_path = sources_rel_path or address.spec_path
  235. +    # No reasons why we might need AndroidPayload have presented themselves yet
  236. +    payload = JvmTargetPayload(sources=sources,
  237. +                               sources_rel_path=sources_rel_path,
  238. +                               provides=provides,
  239. +                               excludes=excludes)
  240. +    super(AndroidTarget, self).__init__(address=address, payload=payload, **kwargs)
  241. +
  242. +    self.add_labels('android')
  243. +    self.build_tools_version = build_tools_version
  244. +    self.min_sdk_version = min_sdk_version
  245. +    self.package = package
  246. +    self.release_type = release_type
  247. +    self.resources = resources
  248. +    self.target_sdk_version = target_sdk_version
  249. diff --git a/src/python/pants/base/target.py b/src/python/pants/base/target.py
  250. index d04c982..011b076 100644
  251. --- a/src/python/pants/base/target.py
  252. +++ b/src/python/pants/base/target.py
  253. @@ -94,6 +94,10 @@ class AbstractTarget(object):
  254.      """Returns True if the target is comprised of tests."""
  255.      return self.has_label('tests')
  256.  
  257. +  @property
  258. +  def is_android(self):
  259. +    """Returns True if the target is an android target."""
  260. +    return self.has_label('android')
  261.  
  262.  @manual.builddict()
  263.  class Target(AbstractTarget):
  264. mateor@mateor-HP-m6:~/development/pants$ git log origin/master -1
  265. commit bfc3f494a7d139f8f629a45ad0e2faa12dcab5d7
  266. Author: Stu Hood <stuhood@twitter.com>
  267. Date:   Fri Jun 20 16:10:15 2014 -0700
  268.  
  269.     Squashed commit of the following:
  270.    
  271.         Credit Larry and Tejal
  272.         Fix antlr_gen task and java_antly_library target
  273. mateor@mateor-HP-m6:~/development/pants$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement