blob: 04698c55f75ee5fe116cbd0c689bb33c4a2ab990 [file] [log] [blame]
Nan Zhang5323f8e2017-05-10 13:37:54 -07001// Copyright 2017 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package python
16
17import (
18 "android/soong/android"
19)
20
21// This file handles installing python executables into their final location
22
23type pythonInstaller struct {
24 dir string
25
26 path android.OutputPath
27}
28
29func NewPythonInstaller(dir string) *pythonInstaller {
30 return &pythonInstaller{
31 dir: dir,
32 }
33}
34
35var _ installer = (*pythonInstaller)(nil)
36
37func (installer *pythonInstaller) install(ctx android.ModuleContext, file android.Path) {
Colin Cross5c517922017-08-31 12:29:17 -070038 installer.path = ctx.InstallFile(android.PathForModuleInstall(ctx, installer.dir),
39 file.Base(), file)
Nan Zhang5323f8e2017-05-10 13:37:54 -070040}