Can't rename a dependency package in pubspec.yaml #563
Labels
closed-as-intended
Closed as the reported issue is expected behavior
type-bug
Incorrect behavior (everything from a crash to more subtle misbehavior)
<img src="https://avatars.githubusercontent.com/u/1721046?v=3" align="left" width="96" height="96"hspace="10"> Issue by alextekartik
Originally opened as dart-lang/sdk#10940
This is a feature request
I managed to add a relative path dependency in my app
name: myapp
description: A sample app
dependencies:
mylib:
path: ../mylib
and then import it in my source code
import 'package:mylib/mylib.dart';
However, the name 'mylib' is taken from the library package pubspec and if I want to change it (for example 'mynewlib'), I have to change the name everywhere (pubspec AND dart source code)
It also prevent having 2 packages with the same name (yes I know, weird, but I don't control what people put in pub.dartlang.org). What I'd like to do is something like
name: myapp
description: A sample app
dependencies:
mylib:
path: ../mylib
name: mynewlib
and have in source code
import 'package:mynewlib/mylib.dart';
However I cannot find the proper syntax and whether that's possible or not. (Sample code ready for testing is here: https://github.com/alextekartik/dart-test/tree/master/lib_test). To note that here I'm not talking about library name but package name (and naming the package mylib can be confusing)
See here: http://stackoverflow.com/questions/16791441/is-it-possible-to-give-a-different-name-to-a-package-dependency-in-pubspec
The text was updated successfully, but these errors were encountered: